pypeit.orderstack module
Module for the SpecObj classes
- class pypeit.orderstack.OrderStack(wave_stack, flux_stack, ivar_stack=None, mask_stack=None, PYP_SPEC=None, sigma_stack=None, ext_mode=None, fluxed=None, setup_name=None)[source]
Bases:
DataContainerClass to handle the coadded array of orders from a single setup of an Echelle spectrum.
One generates one of these objects for each echelle setup in the exposure. They are instantiated by the echelle coadding routine, and then all coadding and setup information for the object are added as attributes
The datamodel attributes are:
Version: 1.0.0
Attribute
Type
Array Type
Description
PYP_SPECstr
PypeItspectrograph designationext_modestr
Extraction mode (options: BOX, OPT)
flux_stackFlux array from coadded orders, in units of counts/s or 10^-17 erg/s/cm^2/Ang; see
fluxedfluxedbool
Boolean indicating if the spectrum is fluxed.
ivar_stackInverse variance array of coadded orders (matches units of flux)
mask_stackMask array of coadded orders (1=Good,0=Bad)
setup_namestr
Echelle spectrograph setup
sigma_stackOne sigma noise array of coadded orders, equivalent to 1/sqrt(ivar) (matches units of flux)
spect_metadict
header dict
wave_stackWavelength array from individual, coadded orders
- Parameters:
wave
wave_grid_mid
flux
PYP_SPEC
ivar
mask
telluric
obj_model
ext_mode
fluxed
- Variables:
head0 (astropy.io.fits.Header) – Primary header
spect_meta (
dict) – Parsed meta from the headerspectrograph (
pypeit.spectrographs.spectrograph.Spectrograph) – Build from PYP_SPEC
- datamodel = {'PYP_SPEC': {'descr': '``PypeIt`` spectrograph designation', 'otype': <class 'str'>}, 'ext_mode': {'descr': 'Extraction mode (options: BOX, OPT)', 'otype': <class 'str'>}, 'flux_stack': {'atype': <class 'numpy.floating'>, 'descr': 'Flux array from coadded orders, in units of counts/s or 10^-17 erg/s/cm^2/Ang; see ``fluxed``', 'otype': <class 'numpy.ndarray'>}, 'fluxed': {'descr': 'Boolean indicating if the spectrum is fluxed.', 'otype': <class 'bool'>}, 'ivar_stack': {'atype': <class 'numpy.floating'>, 'descr': 'Inverse variance array of coadded orders (matches units of flux)', 'otype': <class 'numpy.ndarray'>}, 'mask_stack': {'atype': <class 'numpy.integer'>, 'descr': 'Mask array of coadded orders (1=Good,0=Bad)', 'otype': <class 'numpy.ndarray'>}, 'setup_name': {'descr': 'Echelle spectrograph setup', 'otype': <class 'str'>}, 'sigma_stack': {'atype': <class 'numpy.floating'>, 'descr': 'One sigma noise array of coadded orders, equivalent to 1/sqrt(ivar) (matches units of flux)', 'otype': <class 'numpy.ndarray'>}, 'spect_meta': {'descr': 'header dict', 'otype': <class 'dict'>}, 'wave_stack': {'atype': <class 'numpy.floating'>, 'descr': 'Wavelength array from individual, coadded orders', 'otype': <class 'numpy.ndarray'>}}
Provides the class data model. This is undefined in the abstract class and should be overwritten in the derived classes.
The format of the
datamodelneeded for each implementation of aDataContainerderived class is as follows.The datamodel itself is a class attribute (i.e., it is a member of the class, not just of an instance of the class). The datamodel is a dictionary of dictionaries: Each key of the datamodel dictionary provides the name of a given datamodel element, and the associated item (dictionary) for the datamodel element provides the type and description information for that datamodel element. For each datamodel element, the dictionary item must provide:
otype: This is the type of the object for this datamodel item. E.g., for a float or a numpy.ndarray, you would setotype=floatandotype=np.ndarray, respectively.descr: This provides a text description of the datamodel element. This is used to construct the datamodel tables in the pypeit documentation.
If the object type is a numpy.ndarray, you should also provide the
atypekeyword that sets the type of the data contained within the array. E.g., for a floating point array containing an image, your datamodel could be simply:datamodel = {'image' : dict(otype=np.ndarray, atype=float, descr='My image')}
More advanced examples are given in the top-level module documentation.
Currently,
datamodelcomponents are restricted to haveotypethat aretuple,int,float,numpy.integer,numpy.floating, numpy.ndarray, or astropy.table.Table objects. E.g.,datamodelvalues forotypecannot bedict.
- internals = ['head0', 'filename', 'spectrograph', 'spect_meta', 'history']
Defines the current datmodel.
- to_file(ofile, primary_hdr=None, history=None, **kwargs)[source]
Over-load
pypeit.datamodel.DataContainer.to_file()to deal with the header- Parameters:
ofile (
str) – Filenameprimary_hdr (astropy.io.fits.Header, optional)
**kwargs – Passed to super.to_file()
- version = '1.0.0'
Current datamodel version number.