Fussing with OH line lists and analysis


In [1]:
# imports
from pkg_resources import resource_filename

from astropy.table import Table

Generate a faux line list

Read TripleSpec line list


In [10]:
tspec_file = resource_filename('arclines', 'data/NIST/tspec_OH_skyline.ascii')

In [11]:
tspec = Table.read(tspec_file, format='ascii')
tspec[0:5]


Out[11]:
Table length=5
wave
float64
8016.2674
8028.0092
8054.2285
8064.4015
8104.7308

Build it up


In [12]:
oh_lines = tspec.copy()

In [13]:
oh_lines['ion'] = 'OH'
oh_lines['NIST'] = 1
oh_lines['Instr'] = 32
oh_lines['amplitude'] = 10000. # make believe
oh_lines['Source'] = 'tspec_PYPIT.json'

In [14]:
oh_line_file = resource_filename('arclines', 'data/lists/OH_lines.dat')

In [15]:
oh_lines.write(oh_line_file, format='ascii.fixed_width')


WARNING: AstropyDeprecationWarning: /data/Projects/Python/arclines/arclines/data/lists/OH_lines.dat already exists. Automatically overwriting ASCII files is deprecated. Use the argument 'overwrite=True' in the future. [astropy.io.ascii.ui]

NIRSPEC R24000 list


In [2]:
nirspec_file = resource_filename('arclines', 'data/misc/nirspec_OH_R24000_vacuum.ascii')

In [4]:
nirspec = Table.read(nirspec_file, format='ascii')

In [5]:
nirspec[0:5]


Out[5]:
Table length=5
WavelengthRelative_Strength
float64float64
9479.56153.8
9505.41816.1
9521.79340.6
9555.19910.3
9569.71423.1

In [7]:
oh_lines = Table()
oh_lines['wave'] = nirspec['Wavelength']
oh_lines['amplitude'] = nirspec['Relative_Strength']
oh_lines['ion'] = 'OH'
oh_lines['NIST'] = 0
oh_lines['Instr'] = 32
oh_lines['Source'] = 'nirspec_OH_R24000_vacuum.ascii'

In [12]:
outfile = resource_filename('arclines', 'data/lists/OH_R24000_lines.dat')

In [13]:
oh_lines.write(outfile, format='ascii.fixed_width')

In [ ]: