-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add mas (milliarcsecond) unit #7
base: master
Are you sure you want to change the base?
Conversation
I'm not sure it's worth a new unit for what is actually a submultiple of another unit. But yes, this is probably used only in Astronomy |
It is widely used in interferometry (of course). I have |
Any updates on this? As I understand you are not very opposed to this. |
Don't the SI prefixes already do this? |
arcsecond belongs to UnitfulAngles so that is where you would need to modify things like using SI prefixes. If you only want
|
Yes, I'm not totally against because I know how much "mas" is used in astronomy, it's just that this isn't a brand-new unit but a power-of-ten multiple of another unit. I was going to suggest to make arcseconds in |
It does not seem to work using |
|
^up
Much more has passed :) |
Speaking of multiples of other base cgs/SI units, isn't angstrom already one? I'm all for commonly used astro units like this being supported! |
I'm concerned about adding a special unit when it is explicitly a multiple of a base. Angstrom gets a pass because it is "Angstrom" and not "deci-nano-meter". A clear example of why we want natural prefix behavior would be reporting astrometry using micro-arcseconds or |
Ahh, that's a good point about naming conventions. Would this mean that doing both: 1) aliasing |
Properly registering |
Oh, that's so cool. Thanks for the info! |
Hey folks, this definition conflicts with Unitful's "attosecond". See: yakir12/UnitfulAngles.jl#30. Thoughts on the best solution? |
I'm eager to hear ideas as well. The least elegant solution I can think of is somehow disabling attosecond when UnitfulAngles is loaded. |
One option is to add the milliarcsecond and microarcsecond directly (and not allow prefixing). As far as I can tell these are the only two prefixes used with arcsecond. UnitfulAngles.jl would then include all units in this table. Something like: @unit mas "mas" Milliarcsecond Arcsecond//1_000 false
@unit μas "μas" Microarcsecond Arcsecond//1_000_000 false |
I think I'm in favor of that, despite my reluctance previously. |
I should have read this thread more carefully. I see this common sentiment and I agree:
I took a look at the actual SI Brochure (section 4 Non-SI units that are accepted for use with the SI) and they mention:
So indeed it seems that different prefixes are used other then milli- and micro- (even the symbol Nonetheless, if possible we should try to avoid conflict with units in Unitful (however rare). Maybe a better option would be to keep it as an alias (as currently implemented) that displays as @unit as_s "as" ArcsecondShort °//3600 true Then julia> 10u"as_s"
10 as
julia> 1.2u"μas_s"
1.2 μas
julia> 6.23u"mas_s"
6.23 mas The typed name could be anything, here I used |
@cmichelenstrofer good idea that compromises different approaches, but I actually think I prefer #7 (comment) My thinking is that, I think that if we do @unit mas "mas" Milliarcsecond Arcsecond//1_000 false
@unit μas "μas" Microarcsecond Arcsecond//1_000_000 false
@unit pas "pas" Picoarcsecond Arcsecond//1_000_000_000 false we simultaneously cover an overwhelming majority of use-cases (e.g., I never using anything more precise than mas) while not sacrificing user interface (having to type This is...not the most beautiful, idiomatic, or elegant solution, but I think it's more important to have something that works good enough rather than trying to perfectly engineer a solution. |
FYI I recently created a new package, DimensionfulAngles.jl to treat angles as a dimension and I included the |
No description provided.