Spectrum Object

Defining Spectrum Class

class smsyn.io.spectrum.Spectrum[source]

A light superclass on top of numpy record array that stores header information and and read and write to fits objects.

Args:
wav (array): wavelengths corresponding to each pixel in the
flux array
flux (array): continuum-normalized flux as a function of
rest wavelength

uflux (array): relative flux uncertainty header (dict): dictionary containing metadata associated with the

observed spectrum. Similar to a header from a fits file. Required keys: object, observation
to_fits(outfile, clobber=True)[source]

Save to FITS

Save a Spectrum object as a mutli-extension fits file.

Args:
outfile (string): name of output file name clobber (bool): if true, will overwrite existing file
smsyn.io.spectrum.read_fits(filename)[source]

Read spectrum from fits file

Read in a spectrum as saved by the Spectrum.to_fits method into a Spectrum object

Args:
filename (string): path to fits file
Returns:
Spectrum object