I’ve finally gotten around to polishing up a package that I’ve wanted to have for a very long time. That is, a units package that includes a bunch of the crazy astronomy units that we’ve come to rely on.
Unitful v0.1.0 made it possible to create packages that extend Unitful with additional units, so we can build on Unitful to provide astronomy units without polluting everybody else’s namespace with Mpc, Gyr, Jy, Msun, etc.
Unitful v0.4.0, which is on the horizon, will add support for logarithmic units. Then we can start to think about also providing units for magnitudes and metallicities, but that’s not here yet.
So I present UnitfulAstro.jl in its current state. You can find the list of available units in the docs or the Github readme. I would really like this package, or something similar, to be used across the Julia astronomy ecosystem, and therefore I’d love to hear any comments or feedback before I go to register this package.
Should UnitfulAstro.jl be moved to the JuliaAstro organization?
Am I missing any units that you would like to have?
Do you also think magnitudes per square arcsecond is the silliest unit you’ve ever seen?
Very cool!
If you find it useful and it makes your life easier, consider incorporating UnitfulAngles.jl for everything angle-related in your package. If there are any angles missing, PR any changes you’d like to see!
I think I was under the impression that UnitfulAngles, was defining 1 turn == 1, instead of 1 rad == 1, which is why I shied away from the package, but I see that this isn’t the case. I think UnitfulAstro could definitely import arcminute, arcsecond, and hourAngle from UnitfulAngles.
It would be kind of nice if arcminutes and arcseconds were defined based on degrees instead of turns. This makes the common conversion to/from degrees exact.