"""
.. module:: jwstspectrum
:synopsis: Class definitions for a JWST Spectrum object.
.. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
#--------------------
# Built-In Imports
#--------------------
from __future__ import absolute_import
#--------------------
# Package Imports
#--------------------
from spec_plots import __version__
#--------------------
[docs]
class JWSTSpectrum():
"""
Defines a JWST spectrum, including wavelegnth, flux, flux errors, and DQ
values.
:raises: ValueError
"""
def __init__(self, wl_arr, fl_arr, fle_arr, dq_arr, wl_unit, fl_unit,
orig_file=None):
"""
Create a JWSTSpectrum object.
:param wl_arr: The array of wavelength values.
:type wl_arr: numpy.ndarray
:param fl_arr: The array of flux values.
:type fl_arr: numpy.ndarray
:param fle_arr: The array of flux uncertainty values.
:type fle_arr: numpy.ndarray
:param dq_arr: The array of DQ values.
:type dq_arr: numpy.ndarray
:param wl_unit: The unit of the wavelength values.
:type wl_unit: astropy.units.core.Unit
:param fl_unit: The unit of the flux values.
:type fl_unit: astropy.units.core.Unit
:param orig_file: Original FITS file read to create the spectrum
(includes full path).
:type orig_file: str
"""
# Record the original file name.
self.orig_file = orig_file
# Record the wavelength, flux, flux uncertainty, and DQ values.
self.wavelengths = wl_arr
self.wavelengths_unit = wl_unit
self.fluxes = fl_arr
self.fluxes_unit = fl_unit
self.fluxerrs = fle_arr
self.dqs = dq_arr
#--------------------