# UnitfulAstro.jl

**URL:** <https://discourse.julialang.org/t/unitfulastro-jl/6004>\
**Category:** Astro/Space\
**Tags:** package, announcement\
**Created:** [September 20, 2017, 4:23pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004 "2017-09-20T16:23:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Eastwood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_eastwood/32/669_2.png) [@Michael\_Eastwood](https://discourse.julialang.org/u/Michael_Eastwood)\
**Post date:** [September 20, 2017, 4:23pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/1 "2017-09-20T16:23:23Z")

</div>

Hello fellow astro Julians.

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?

Let me know!

**Documentation:** [Home · UnitfulAstro.jl](http://juliaastro.github.io/UnitfulAstro.jl/latest/)  
**Github:** [https://github.com/JuliaAstro/UnitfulAstro.jl](https://github.com/JuliaAstro/UnitfulAstro.jl)

Edit (9/22): Updated links after the repository was transferred to JuliaAstro.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [September 20, 2017, 4:58pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/2 "2017-09-20T16:58:30Z")

</div>

I really like the idea!

> [@Michael\_Eastwood](#):
>
> Am I missing any units that you would like to have?

I think all important units are already there, if I remember other relevant units I’ll open an issue 😉

> [@Michael\_Eastwood](#):
>
> Should UnitfulAstro.jl be moved to the JuliaAstro organization?

I personally believe this could be a useful addition to the organization, so we can use a single package for all units-related stuff.

Also @kbarbary may want to chime in.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 20, 2017, 5:46pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/3 "2017-09-20T17:46:56Z")

</div>

Very cool!  
If you find it useful and it makes your life easier, consider incorporating [UnitfulAngles.jl](https://github.com/yakir12/UnitfulAngles.jl) for everything angle-related in your package. If there are any angles missing, PR any changes you’d like to see!

---

<div class="post-metadata">

**Author:** ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Post date:** [September 20, 2017, 5:51pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/4 "2017-09-20T17:51:19Z")

</div>

> [@Michael\_Eastwood](#):
>
> Am I missing any units that you would like to have?

SFU (solar flux unit) would be nice, 1 SFU = 10^−19 erg s^−1 cm^−2 Hz^−1

> **[Solar flux unit](https://en.wikipedia.org/wiki/Solar_flux_unit)**
>
> The solar flux unit (sfu) is a convenient measure of spectral flux density often used in solar radio observations, such as the F10.7 solar activity index: 
> See jansky for further information about related units; one Jy = 104 = 
> 10−26 W⋅m−2⋅Hz−1 = 10−23 erg⋅s−1⋅cm−2⋅Hz−1.
>  
> This standards- or measurement-related article is a stub. You can help Wikipedia by expanding it.

---

<div class="post-metadata">

**Author:** ![Michael\_Eastwood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_eastwood/32/669_2.png) [@Michael\_Eastwood](https://discourse.julialang.org/u/Michael_Eastwood)\
**Post date:** [September 20, 2017, 6:03pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/5 "2017-09-20T18:03:47Z")

</div>

> [@yakir12](#):
>
> 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.

> [@KajWiik](#):
>
> SFU (solar flux unit) would be nice, 1 SFU = 10^−19 erg s^−1 cm^−2 Hz^−1

Sure!

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 20, 2017, 6:05pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/6 "2017-09-20T18:05:57Z")

</div>

Yea, we argued about that, but it all stemmed from a misunderstanding on my part. It’s all good now 😛

---

<div class="post-metadata">

**Author:** ![Michael\_Eastwood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_eastwood/32/669_2.png) [@Michael\_Eastwood](https://discourse.julialang.org/u/Michael_Eastwood)\
**Post date:** [September 20, 2017, 6:48pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/7 "2017-09-20T18:48:44Z")

</div>

I pushed: [https://github.com/mweastwood/UnitfulAstro.jl/commit/a02c3e87ec4bb2571b2d8a53d6ce533499d91dd6](https://github.com/mweastwood/UnitfulAstro.jl/commit/a02c3e87ec4bb2571b2d8a53d6ce533499d91dd6)

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.

---

<div class="post-metadata">

**Author:** ![kbarbary](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kbarbary](https://discourse.julialang.org/u/kbarbary)\
**Post date:** [September 20, 2017, 11:01pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/8 "2017-09-20T23:01:21Z")

</div>

I’d support bringing this under the JuliaAstro organization, if @Michael_Eastwood wants to!

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 21, 2017, 7:14am UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/9 "2017-09-21T07:14:29Z")

</div>

Done. Let me know if it’s all good.

---

<div class="post-metadata">

**Author:** ![Michael\_Eastwood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_eastwood/32/669_2.png) [@Michael\_Eastwood](https://discourse.julialang.org/u/Michael_Eastwood)\
**Post date:** [September 21, 2017, 4:05pm UTC](https://discourse.julialang.org/t/unitfulastro-jl/6004/10 "2017-09-21T16:05:30Z")

</div>

> [@kbarbary](#):
>
> I’d support bringing this under the JuliaAstro organization, if @Michael_Eastwood wants to!

Alright, let’s do it!

> [@yakir12](#):
>
> Done. Let me know if it’s all good.

Looks good to me at first glance, thanks!
