Skip to content

Commit

Permalink
Add simple spectral line look up function. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelley M. Hess committed Nov 16, 2022
1 parent 4c806ea commit 26c7cd2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/modules/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,28 @@ def create_pv(source, filename, opt_view=6*u.arcmin, min_axis=False):
return mask_pv


def line_lookup(spec_line):
"""Return rest frequency and object to convert to optical velocities for requested line.
:param line:
:type line:
:return:
:rtype:
"""

if (spec_line == None) or (spec_line == 'HI'):
restfreq_line = 1420405751.77 * u.Hz
optical = u.doppler_optical(restfreq_line)
elif spec_line == 'CO':
restfreq_line = 115.27120180 * u.GHz
optical = u.doppler_optical(restfreq_line)
else:
print("ERROR: Unrecognized spectral line. Try 'HI' or 'CO'.")
exit()

return {'name': spec_line, 'restfreq': restfreq_line, 'optical':optical}


def plot_labels(source, ax, default_beam, x_color='k'):
"""Plot labels on spatial plots depending on the coordinate frame.
Expand Down

0 comments on commit 26c7cd2

Please sign in to comment.