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: DataContainer

Class 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_SPEC

str

PypeIt spectrograph designation

ext_mode

str

Extraction mode (options: BOX, OPT)

flux_stack

numpy.ndarray

numpy.floating

Flux array from coadded orders, in units of counts/s or 10^-17 erg/s/cm^2/Ang; see fluxed

fluxed

bool

Boolean indicating if the spectrum is fluxed.

ivar_stack

numpy.ndarray

numpy.floating

Inverse variance array of coadded orders (matches units of flux)

mask_stack

numpy.ndarray

numpy.integer

Mask array of coadded orders (1=Good,0=Bad)

setup_name

str

Echelle spectrograph setup

sigma_stack

numpy.ndarray

numpy.floating

One sigma noise array of coadded orders, equivalent to 1/sqrt(ivar) (matches units of flux)

spect_meta

dict

header dict

wave_stack

numpy.ndarray

numpy.floating

Wavelength array from individual, coadded orders

Parameters:
  • wave

  • wave_grid_mid

  • flux

  • PYP_SPEC

  • ivar

  • mask

  • telluric

  • obj_model

  • ext_mode

  • fluxed

head0

Primary header

Type:

astropy.io.fits.Header

spect_meta

Parsed meta from the header

Type:

dict

spectrograph

Build from PYP_SPEC

Type:

pypeit.spectrographs.spectrograph.Spectrograph

_bundle()[source]

Override the base class method simply to set the HDU extension name.

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 datamodel needed for each implementation of a DataContainer derived 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 set otype=float and otype=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 atype keyword 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, datamodel components are restricted to have otype that are tuple, int, float, numpy.integer, numpy.floating, numpy.ndarray, or astropy.table.Table objects. E.g., datamodel values for otype cannot be dict.

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:
version = '1.0.0'

Current datamodel version number.