Skip to content

Commit

Permalink
Fix SB calculation for cubes generated by SpectralCube with 'beam-1 J…
Browse files Browse the repository at this point in the history
…y*Hz' (#48)
  • Loading branch information
kmhess committed Feb 15, 2023
1 parent 84ef74b commit ddc5502
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ def sbr2nhi(sbr, bunit, bmaj, bmin):
:return: column density
:rtype: float
"""
# NEED TO ADD UNITS THAT ANNOYINGLY COME OUT OF SPECTRAL CUBE! DONE?
if (bunit == 'Jy/beam*m/s') or (bunit == 'Jy/beam*M/S'):
nhi = 1.104e+21 * sbr / bmaj / bmin
elif bunit == 'Jy/beam*Hz':
elif (bunit == 'Jy/beam*Hz') or (bunit == 'beam-1 Jy*Hz'):
nhi = 2.330e+20 * sbr / bmaj / bmin
else:
print("\tWARNING: Mom0 imag units are not Jy/beam*m/s or Jy/beam*Hz. Cannot convert to HI column density.")
Expand Down

0 comments on commit ddc5502

Please sign in to comment.