radio-astro-tools / spectral-cube

Library for reading and analyzing astrophysical spectral data cubes
http://spectral-cube.rtfd.org
BSD 3-Clause "New" or "Revised" License
95 stars 62 forks source link

Question about writing BUNIT as 'Jy/beam' instead of 'beam-1 Jy' #806

Closed spectram closed 8 months ago

spectram commented 2 years ago

SpectralCube.write() seems to save BUNIT as 'beam-1 Jy'. This is creating issues running SoFiA2. The space after beam-1 also makes parsing unnecessarily cumbersome.

keflavich commented 2 years ago

What's SoFiA2?

Unfortunately, that format is what is expected in the FITS standard:

>>> from astropy import units as u
>>> (u.Jy/u.beam).to_string('FITS')
'beam-1 Jy'

Since this is an upstream issue (it is coming directly from astropy), I suggest opening an issue there.

spectram commented 2 years ago

SoFiA is an HI source finding tool. https://github.com/SoFiA-Admin/SoFiA-2 I will first check with SoFiA2 authors before raising the issue in Astropy. I reckon there could be other factors involved.