pypeit.specobj module
Module for the SpecObj classes
- class pypeit.specobj.SpecObj(PYPELINE, DET, OBJTYPE='unknown', SLITID=None, ECH_ORDER=None, ECH_ORDERINDX=None, PYP_SPEC=None)[source]
Bases:
DataContainerClass to handle single spectra from a single exposure.
One generates one of these objects for each spectrum in the exposure. They are instantiated by the object finding routine, and then all spectral extraction information for the object are assigned as attributes
The datamodel attributes are:
Version: 1.1.14
Attribute
Type
Array Type
Description
BOX_CHI2float
Reduced chi2 of the model fit for this spectral pixel
BOX_COUNTSfloat
Boxcar flux (counts)
BOX_COUNTS_IVARfloat
Inverse variance of optimally extracted flux using modelivar image (counts^2)
BOX_COUNTS_NIVARfloat
Boxcar extracted noise variance, sky+read noise only (counts^2)
BOX_COUNTS_SIGfloat
Boxcar extracted noise from IVAR (counts)
BOX_COUNTS_SIG_DETfloat
Boxcar extracted detector noise (counts)
BOX_COUNTS_SKYfloat
Boxcar extracted sky (counts)
BOX_FLAMfloat
Boxcar flux (erg/s/cm^2/Ang)
BOX_FLAM_IVARfloat
Boxcar flux inverse variance (1e-17 erg/s/cm^2/Ang)^-2
BOX_FLAM_SIGfloat
Boxcar flux uncertainty (1e-17 erg/s/cm^2/Ang)
BOX_FLATfloat
Boxcar extracted flatfield spectrum, normalized to the peak value.
BOX_FRAC_USEfloat
Fraction of pixels in the object profile subimage used for this extraction
BOX_FWHMfloat
Spectral FWHM (in Angstroms) at every pixel of the boxcar extracted flux.
BOX_MASKMask for boxcar extracted flux. True=good
BOX_NPIXfloat
Number of pixels used for the boxcar extraction; can be fractional
BOX_R_ASECfloat
Size of boxcar radius (arcsec)
BOX_R_PIXfloat
Size of boxcar radius (pixels)
BOX_WAVEfloat
Boxcar Wavelengths in vacuum (Angstroms)
DECfloat
Declination (J2000) decimal degree
DETstr
A string identifier for the reduced detector or mosaic.
DETECTORObject with the detector or mosaic metadata
ECH_FRACPOSfloat, numpy.floating
Synced echelle fractional location of the object on the slit
ECH_FRACPOS_IDint, numpy.integer
Echelle fractional location of the object on the slit multiplied by 1000 used as a unique identifier for the naming model
ECH_NAMEstr
Name of the object for echelle data. Same as NAME above but order numbers are omitted giving a unique name per object.
ECH_OBJIDint, numpy.integer
Object ID for echelle data. Each object is given an index in the order it appears increasing from from left to right. These are one based.
ECH_ORDERint, numpy.integer
Physical echelle order
ECH_ORDERINDXint, numpy.integer
Order indx, analogous to SLITID for echelle. Zero based.
FLEX_SHIFT_GLOBALfloat
Global shift of the spectrum to correct for spectralflexure (pixels). This is based on the sky spectrum atthe center of the slit
FLEX_SHIFT_LOCALfloat
Local shift of the spectrum to correct for spectralflexure (pixels). This should be a small correction tothe global value, and is based on the sky spectrumextracted near the object
FLEX_SHIFT_TOTALfloat
Total shift of the spectrum to correct for spectralflexure (pixels). This is the sum of the global andlocal FLEX_SHIFT
FWHMfloat
Spatial FWHM of the object (pixels)
FWHMFITfloat
Spatial FWHM across the detector (pixels)
MASKDEF_EXTRACTbool
Boolean indicating if this is a forced extraction at the expected location from slitmask design.
MASKDEF_IDint, numpy.integer
Slitmask definition ID
MASKDEF_OBJMAGfloat
Magnitude of the object from the slitmask definition
MASKDEF_OBJMAG_BANDstr
Magnitude band of the object from the slitmask definition
MASKDEF_OBJNAMEstr
Name of the object from the slitmask definition
NAMEstr
Name of the object following the naming model
OBJIDint, numpy.integer
Object ID for multislit data. Each object is given an index for the slit it appears increasing from from left to right. These are one based.
OBJTYPEstr
Object type (e.g., standard, science)
OPT_CHI2float
Reduced chi2 of the model fit for this spectral pixel
OPT_COUNTSfloat
Optimal flux (counts)
OPT_COUNTS_IVARfloat
Inverse variance of optimally extracted flux using modelivar image (counts^2)
OPT_COUNTS_NIVARfloat
Optimally extracted noise variance, sky+read noise only (counts^2)
OPT_COUNTS_SIGfloat
Optimally extracted noise from IVAR (counts)
OPT_COUNTS_SIG_DETfloat
Optimally extracted detector noise (counts)
OPT_COUNTS_SKYfloat
Optimally extracted sky (counts)
OPT_FLAMfloat
Optimal flux (1e-17 erg/s/cm^2/Ang)
OPT_FLAM_IVARfloat
Optimal flux inverse variance (1e-17 erg/s/cm^2/Ang)^-2
OPT_FLAM_SIGfloat
Optimal flux uncertainty (1e-17 erg/s/cm^2/Ang)
OPT_FLATfloat
Optimally extracted flatfield spectrum, normalised to the peak value.
OPT_FRAC_USEfloat
Fraction of pixels in the object profile subimage used for this extraction
OPT_FWHMfloat
Spectral FWHM (in Angstroms) at every pixel of the optimally extracted flux.
OPT_MASKMask for optimally extracted flux. True=good
OPT_WAVEfloat
Optimal Wavelengths in vacuum (Angstroms)
PYPELINEstr
Name of the PypeIt pipeline mode
PYP_SPECstr
PypeIt spectrograph name
RAfloat
Right Ascension (J2000) decimal degree
S2Nfloat
Median signal to noise ratio of the extracted spectrum(OPT if available, otherwise BOX)
SLITIDint, numpy.integer
PypeIt slit ID (aka SPAT_ID).
SPAT_FRACPOSfloat, numpy.floating
Fractional location of the object on the slit
SPAT_FWHMfloat
Spatial FWHM of the object (arcsec)
SPAT_PIXPOSfloat, numpy.floating
Spatial location of the trace on detector (pixel) at half-way
SPAT_PIXPOS_IDint, numpy.integer
Nearest integer spatial location of the trace on detector (pixel) at half-way used as a unique identifier for the naming model
SPEC_DETArray of detector indices for each pixel in the spectral direction. This is only available for mosaic reductions.
TRACE_SPATfloat
Object trace along the spec (spatial pixel)
VEL_CORRfloat
Relativistic velocity correction for wavelengths
VEL_TYPEstr
Type of heliocentric correction (if any)
WAVE_RMSfloat, numpy.floating
RMS (pix) for the wavelength solution for this slit.
ech_snrfloat, numpy.floating
Median S/N of the echelle of the spectrum
hand_extract_flagbool
Boolean indicating if this is a forced extraction at the location provided by the user.
maskwidthfloat, numpy.floating
Size (in units of spatial fwhm) of the region used for local sky subtraction
signfloat
Sign of the object profile (+1 or -1). + is a positive profile above the sky background.
smash_peakfluxfloat
Peak value of the spectral direction collapsed spatial profile
smash_snrfloat
Peak S/N ratio of the spectral direction collapsed patial profile
trace_specint, numpy.integer
Array of pixels along the spectral direction
- Parameters:
PYPELINE (
str) – Name of thePypeItpipeline method. Allowed options are MultiSlit, Echelle, or SlicerIFU.DET (
str) – The name of the detector or mosaic from which the spectrum was extracted. For example, DET01.OBJTYPE (
str, optional) – Object type. For example: ‘unknown’, ‘standard’, ‘science’.SLITID (
int, optional) – For multislit and SlicerIFU reductions, this is an identifier for the slit (max=9999).ECH_ORDER (
int, optional) – Physical order number.ECH_ORDERINDX (
int, optional) – Running index for the order.
- __repr__()[source]
Over-ride print representation
- Returns:
Basics of the Data Container
- Return type:
- _bundle(**kwargs)[source]
Override base class to handle inclusion of
DetectorContainerorMosaicobjects for each spectrum.
- apply_flux_calib(wave_zp, zeropoint, exptime, tellmodel=None, extinct_correct=False, airmass=None, extinct_file=None, extrap_sens=False)[source]
Apply a sensitivity function to our spectrum
FLAM, FLAM_SIG, and FLAM_IVAR are generated
- Parameters:
wave_zp (numpy.ndarray) – Zeropoint wavelength array
zeropoint (numpy.ndarray) – zeropoint array
exptime (float) – Exposure time
tellmodel (numpy.ndarray, optional) – Telluric model. To be applied to the sensitivity function. Only used to generate the std fluxed QA plot. It should be None otherwise. To telluric correct the data, use the telluric correct method.
extinct_correct (bool, optional) – If True, apply atmospheric extinction correction
airmass (float, optional) – Airmass
extinct_file (str, optional) – Either (1) one of the extinction files provided by pypeit (see Extinction Correction), (2) the path to a local file on disk, or (3) set
extinct_file='closest'to have the code find the most relevant extinction data based on the longitude and latitude of the telescope for the spectrograph used to observe the spectrum.extrap_sens (bool, optional) – Extrapolate the sensitivity function (instead of crashing out)
- apply_helio(vel_corr, refframe)[source]
Apply a heliocentric correction
Wavelength arrays are modified in place
- best_ext_match(extract=None, fluxed=True)[source]
Determine the extraction and calibration type that best matches a user request.
Precedence is given to the requested extraction and calibration types. Beyond that, optimal extraction takes precedence over boxcar extraction, and flux-calibrated data take precedence over uncalibrated counts.
- Parameters:
extract (
str, optional) – The extraction used to produce the spectrum. Must be either None,'BOX'(for a boxcar extraction), or'OPT'for optimal extraction. If None, the optimal extraction will be returned, if it exists, otherwise the boxcar extraction will be returned.fluxed (
bool, optional) – If True, return the flux calibrated spectrum, if it exists. If the flux calibration hasn’t been performed orfluxed=False, the spectrum is returned in counts.
- Returns:
The adjusted extraction type (
'BOX'or'OPT') and the adjusted calibration type (True for flux-calibrated, False for uncalibrated counts).- Return type:
- boxcar_arcsec()[source]
Return the boxcar radius in arcsec
- Returns:
Boxcar radius in arcsec
- Return type:
- datamodel = {'BOX_CHI2': {'atype': <class 'float'>, 'descr': 'Reduced chi2 of the model fit for this spectral pixel', 'otype': <class 'numpy.ndarray'>}, 'BOX_COUNTS': {'atype': <class 'float'>, 'descr': 'Boxcar flux (counts)', 'otype': <class 'numpy.ndarray'>}, 'BOX_COUNTS_IVAR': {'atype': <class 'float'>, 'descr': 'Inverse variance of optimally extracted flux using modelivar image (counts^2)', 'otype': <class 'numpy.ndarray'>}, 'BOX_COUNTS_NIVAR': {'atype': <class 'float'>, 'descr': 'Boxcar extracted noise variance, sky+read noise only (counts^2)', 'otype': <class 'numpy.ndarray'>}, 'BOX_COUNTS_SIG': {'atype': <class 'float'>, 'descr': 'Boxcar extracted noise from IVAR (counts)', 'otype': <class 'numpy.ndarray'>}, 'BOX_COUNTS_SIG_DET': {'atype': <class 'float'>, 'descr': 'Boxcar extracted detector noise (counts)', 'otype': <class 'numpy.ndarray'>}, 'BOX_COUNTS_SKY': {'atype': <class 'float'>, 'descr': 'Boxcar extracted sky (counts)', 'otype': <class 'numpy.ndarray'>}, 'BOX_FLAM': {'atype': <class 'float'>, 'descr': 'Boxcar flux (erg/s/cm^2/Ang)', 'otype': <class 'numpy.ndarray'>}, 'BOX_FLAM_IVAR': {'atype': <class 'float'>, 'descr': 'Boxcar flux inverse variance (1e-17 erg/s/cm^2/Ang)^-2', 'otype': <class 'numpy.ndarray'>}, 'BOX_FLAM_SIG': {'atype': <class 'float'>, 'descr': 'Boxcar flux uncertainty (1e-17 erg/s/cm^2/Ang)', 'otype': <class 'numpy.ndarray'>}, 'BOX_FLAT': {'atype': <class 'float'>, 'descr': 'Boxcar extracted flatfield spectrum, normalized to the peak value.', 'otype': <class 'numpy.ndarray'>}, 'BOX_FRAC_USE': {'atype': <class 'float'>, 'descr': 'Fraction of pixels in the object profile subimage used for this extraction', 'otype': <class 'numpy.ndarray'>}, 'BOX_FWHM': {'atype': <class 'float'>, 'descr': 'Spectral FWHM (in Angstroms) at every pixel of the boxcar extracted flux.', 'otype': <class 'numpy.ndarray'>}, 'BOX_MASK': {'atype': <class 'numpy.bool'>, 'descr': 'Mask for boxcar extracted flux. True=good', 'otype': <class 'numpy.ndarray'>}, 'BOX_NPIX': {'atype': <class 'float'>, 'descr': 'Number of pixels used for the boxcar extraction; can be fractional', 'otype': <class 'numpy.ndarray'>}, 'BOX_R_ASEC': {'descr': 'Size of boxcar radius (arcsec)', 'otype': <class 'float'>}, 'BOX_R_PIX': {'descr': 'Size of boxcar radius (pixels)', 'otype': <class 'float'>}, 'BOX_WAVE': {'atype': <class 'float'>, 'descr': 'Boxcar Wavelengths in vacuum (Angstroms)', 'otype': <class 'numpy.ndarray'>}, 'DEC': {'descr': 'Declination (J2000) decimal degree', 'otype': <class 'float'>}, 'DET': {'descr': 'A string identifier for the reduced detector or mosaic.', 'otype': <class 'str'>}, 'DETECTOR': {'descr': 'Object with the detector or mosaic metadata', 'otype': (<class 'pypeit.images.detector_container.DetectorContainer'>, <class 'pypeit.images.mosaic.Mosaic'>)}, 'ECH_FRACPOS': {'descr': 'Synced echelle fractional location of the object on the slit', 'otype': (<class 'float'>, <class 'numpy.floating'>)}, 'ECH_FRACPOS_ID': {'descr': 'Echelle fractional location of the object on the slit multiplied by 1000 used as a unique identifier for the naming model', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'ECH_NAME': {'descr': 'Name of the object for echelle data. Same as NAME above but order numbers are omitted giving a unique name per object.', 'otype': <class 'str'>}, 'ECH_OBJID': {'descr': 'Object ID for echelle data. Each object is given an index in the order it appears increasing from from left to right. These are one based.', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'ECH_ORDER': {'descr': 'Physical echelle order', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'ECH_ORDERINDX': {'descr': 'Order indx, analogous to SLITID for echelle. Zero based.', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'FLEX_SHIFT_GLOBAL': {'descr': 'Global shift of the spectrum to correct for spectralflexure (pixels). This is based on the sky spectrum atthe center of the slit', 'otype': <class 'float'>}, 'FLEX_SHIFT_LOCAL': {'descr': 'Local shift of the spectrum to correct for spectralflexure (pixels). This should be a small correction tothe global value, and is based on the sky spectrumextracted near the object', 'otype': <class 'float'>}, 'FLEX_SHIFT_TOTAL': {'descr': 'Total shift of the spectrum to correct for spectralflexure (pixels). This is the sum of the global andlocal FLEX_SHIFT', 'otype': <class 'float'>}, 'FWHM': {'descr': 'Spatial FWHM of the object (pixels)', 'otype': <class 'float'>}, 'FWHMFIT': {'atype': <class 'float'>, 'descr': 'Spatial FWHM across the detector (pixels)', 'otype': <class 'numpy.ndarray'>}, 'MASKDEF_EXTRACT': {'descr': 'Boolean indicating if this is a forced extraction at the expected location from slitmask design. ', 'otype': <class 'bool'>}, 'MASKDEF_ID': {'descr': 'Slitmask definition ID', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'MASKDEF_OBJMAG': {'descr': 'Magnitude of the object from the slitmask definition', 'otype': <class 'float'>}, 'MASKDEF_OBJMAG_BAND': {'descr': 'Magnitude band of the object from the slitmask definition', 'otype': <class 'str'>}, 'MASKDEF_OBJNAME': {'descr': 'Name of the object from the slitmask definition', 'otype': <class 'str'>}, 'NAME': {'descr': 'Name of the object following the naming model', 'otype': <class 'str'>}, 'OBJID': {'descr': 'Object ID for multislit data. Each object is given an index for the slit it appears increasing from from left to right. These are one based.', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'OBJTYPE': {'descr': 'Object type (e.g., standard, science)', 'otype': <class 'str'>}, 'OPT_CHI2': {'atype': <class 'float'>, 'descr': 'Reduced chi2 of the model fit for this spectral pixel', 'otype': <class 'numpy.ndarray'>}, 'OPT_COUNTS': {'atype': <class 'float'>, 'descr': 'Optimal flux (counts)', 'otype': <class 'numpy.ndarray'>}, 'OPT_COUNTS_IVAR': {'atype': <class 'float'>, 'descr': 'Inverse variance of optimally extracted flux using modelivar image (counts^2)', 'otype': <class 'numpy.ndarray'>}, 'OPT_COUNTS_NIVAR': {'atype': <class 'float'>, 'descr': 'Optimally extracted noise variance, sky+read noise only (counts^2)', 'otype': <class 'numpy.ndarray'>}, 'OPT_COUNTS_SIG': {'atype': <class 'float'>, 'descr': 'Optimally extracted noise from IVAR (counts)', 'otype': <class 'numpy.ndarray'>}, 'OPT_COUNTS_SIG_DET': {'atype': <class 'float'>, 'descr': 'Optimally extracted detector noise (counts)', 'otype': <class 'numpy.ndarray'>}, 'OPT_COUNTS_SKY': {'atype': <class 'float'>, 'descr': 'Optimally extracted sky (counts)', 'otype': <class 'numpy.ndarray'>}, 'OPT_FLAM': {'atype': <class 'float'>, 'descr': 'Optimal flux (1e-17 erg/s/cm^2/Ang)', 'otype': <class 'numpy.ndarray'>}, 'OPT_FLAM_IVAR': {'atype': <class 'float'>, 'descr': 'Optimal flux inverse variance (1e-17 erg/s/cm^2/Ang)^-2', 'otype': <class 'numpy.ndarray'>}, 'OPT_FLAM_SIG': {'atype': <class 'float'>, 'descr': 'Optimal flux uncertainty (1e-17 erg/s/cm^2/Ang)', 'otype': <class 'numpy.ndarray'>}, 'OPT_FLAT': {'atype': <class 'float'>, 'descr': 'Optimally extracted flatfield spectrum, normalised to the peak value.', 'otype': <class 'numpy.ndarray'>}, 'OPT_FRAC_USE': {'atype': <class 'float'>, 'descr': 'Fraction of pixels in the object profile subimage used for this extraction', 'otype': <class 'numpy.ndarray'>}, 'OPT_FWHM': {'atype': <class 'float'>, 'descr': 'Spectral FWHM (in Angstroms) at every pixel of the optimally extracted flux.', 'otype': <class 'numpy.ndarray'>}, 'OPT_MASK': {'atype': <class 'numpy.bool'>, 'descr': 'Mask for optimally extracted flux. True=good', 'otype': <class 'numpy.ndarray'>}, 'OPT_WAVE': {'atype': <class 'float'>, 'descr': 'Optimal Wavelengths in vacuum (Angstroms)', 'otype': <class 'numpy.ndarray'>}, 'PYPELINE': {'descr': 'Name of the PypeIt pipeline mode', 'otype': <class 'str'>}, 'PYP_SPEC': {'descr': 'PypeIt spectrograph name', 'otype': <class 'str'>}, 'RA': {'descr': 'Right Ascension (J2000) decimal degree', 'otype': <class 'float'>}, 'S2N': {'descr': 'Median signal to noise ratio of the extracted spectrum(OPT if available, otherwise BOX)', 'otype': <class 'float'>}, 'SLITID': {'descr': 'PypeIt slit ID (aka SPAT_ID).', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'SPAT_FRACPOS': {'descr': 'Fractional location of the object on the slit', 'otype': (<class 'float'>, <class 'numpy.floating'>)}, 'SPAT_FWHM': {'descr': 'Spatial FWHM of the object (arcsec)', 'otype': <class 'float'>}, 'SPAT_PIXPOS': {'descr': 'Spatial location of the trace on detector (pixel) at half-way', 'otype': (<class 'float'>, <class 'numpy.floating'>)}, 'SPAT_PIXPOS_ID': {'descr': 'Nearest integer spatial location of the trace on detector (pixel) at half-way used as a unique identifier for the naming model', 'otype': (<class 'int'>, <class 'numpy.integer'>)}, 'SPEC_DET': {'atype': <class 'numpy.integer'>, 'descr': 'Array of detector indices for each pixel in the spectral direction. This is only available for mosaic reductions.', 'otype': <class 'numpy.ndarray'>}, 'TRACE_SPAT': {'atype': <class 'float'>, 'descr': 'Object trace along the spec (spatial pixel)', 'otype': <class 'numpy.ndarray'>}, 'VEL_CORR': {'descr': 'Relativistic velocity correction for wavelengths', 'otype': <class 'float'>}, 'VEL_TYPE': {'descr': 'Type of heliocentric correction (if any)', 'otype': <class 'str'>}, 'WAVE_RMS': {'descr': 'RMS (pix) for the wavelength solution for this slit.', 'otype': (<class 'float'>, <class 'numpy.floating'>)}, 'ech_snr': {'descr': 'Median S/N of the echelle of the spectrum', 'otype': (<class 'float'>, <class 'numpy.floating'>)}, 'hand_extract_flag': {'descr': 'Boolean indicating if this is a forced extraction at the location provided by the user. ', 'otype': <class 'bool'>}, 'maskwidth': {'descr': 'Size (in units of spatial fwhm) of the region used for local sky subtraction', 'otype': (<class 'float'>, <class 'numpy.floating'>)}, 'sign': {'descr': 'Sign of the object profile (+1 or -1). + is a positive profile above the sky background.', 'otype': <class 'float'>}, 'smash_peakflux': {'descr': 'Peak value of the spectral direction collapsed spatial profile', 'otype': <class 'float'>}, 'smash_snr': {'descr': 'Peak S/N ratio of the spectral direction collapsed patial profile', 'otype': <class 'float'>}, 'trace_spec': {'atype': (<class 'int'>, <class 'numpy.integer'>), 'descr': 'Array of pixels along the spectral direction', 'otype': <class 'numpy.ndarray'>}}
Defines the current datmodel.
- extract_boxcar(imgminsky, ivar, mask, waveimg, skyimg, fwhmimg=None, flatimg=None, base_var=None, count_scale=None, noise_floor=None)[source]
Perform a boxcar extraction on the provided image.
This is a simple wrapper for
extract_boxcar()that saves the results to attributes of this object; seeextract_boxcar()for descriptions of the function arguments.If
trace_specis currently None, this sets it to an index array that matches the length of the first (spectral) axis of the provided image; e.g.,trace_spec = [0 ... imgminsky.shape[0]-1].The function uses
BOX_R_PIXandTRACE_SPATto set the box width and center as a function of spectral pixel.This fills the following properties:
BOX_WAVE,BOX_COUNTS,BOX_COUNTS_IVAR,BOX_COUNTS_SIG,BOX_COUNTS_NIVAR,BOX_MASK,BOX_FWHM,BOX_FLAT,BOX_COUNTS_SKY,BOX_COUNTS_SIG_DET, andBOX_NPIX.
- extract_optimal(imgminsky, ivar, mask, waveimg, skyimg, thismask, oprof, min_frac_use=0.9, fwhmimg=None, flatimg=None, base_var=None, count_scale=None, noise_floor=None)[source]
Perform an optimal extraction on the provided image.
This is a simple wrapper for
extract_optimal()that saves the results to attributes of this object; seeextract_optimal()for descriptions of the function arguments.If
trace_specis currently None, this sets it to an index array that matches the length of the first (spectral) axis of the provided image; e.g.,trace_spec = [0 ... imgminsky.shape[0]-1].The function uses
BOX_R_PIXandTRACE_SPATto set the box width and center as a function of spectral pixel; these are only used to set the wavelength of an extracted pixel in the case when the optimal extraction leads to a fully masked pixel.This fills the following properties:
OPT_WAVE,OPT_COUNTS,OPT_COUNTS_IVAR,OPT_COUNTS_SIG,OPT_COUNTS_NIVAR,OPT_MASK,OPT_FWHM,OPT_FLAT,OPT_COUNTS_SKY,OPT_COUNTS_SIG_DET,OPT_FRAC_USE, andOPT_CHI2.
- classmethod from_arrays(PYPELINE, wave, counts, ivar, flat=None, mode='OPT', DET='DET01', SLITID=0, **kwargs)[source]
- internals = ['smash_peakflux', 'smash_snr', 'hand_extract_flag', 'hand_extract_spec', 'hand_extract_spat', 'hand_extract_det', 'hand_extract_fwhm', 'prof_nsigma', 'min_spat', 'max_spat', 'ech_frac_was_fit', 'spectrograph']
A list of strings identifying a set of internal attributes that are not part of the datamodel.
- med_fwhm()[source]
Return median spatial FWHM of the spectrum
- Returns:
Median spatial FWHM in arcsec
- Return type:
- med_s2n()[source]
Return median S/N of the spectrum Uses OPT_COUNTS if present and then BOX_COUNTS
- Returns:
float
- property mnx_wave
Return min, max wavelength of the spectrum Uses OPT_WAVE if present and then BOX_WAVE
- Returns:
min, max (float)
- Return type:
- property platescale
Return the platescale in arcsec/pixel and includes the binning factor
- Returns:
Platescale in arcsec/pixel
- Return type:
- ready_for_extraction()[source]
Simple method to check all the items are filled and ready for skysub and extraction.
- Returns:
True if all checks have passed
- Return type:
- set_name()[source]
Construct the
PypeItname for this object.The
PypeItname depends on the type of data being processed:For multislit and SlicerIFU data, the name is
SPATnnnn-SLITmmmm-{DET}, wherennnnis the nearest integer pixel in the spatial direction (at the spectral midpoint) where the object was extracted,mmmmis the slit identification number, and{DET}is the string identifier for the detector or mosaic.For echelle data, the name is
OBJnnnn-{DET}-ORDERoooo, wherennnnis 1000 times the fractional position along the spatial direction rounded to the nearest integer,{DET}is the string identifier for the detector or mosaic, andoooois the echelle order.
For echelle data, this modifies both
ECH_NAMEandNAME; otherwise, only the latter is set.
- property slit_order
- property slit_orderindx
- to_hdu(**kwargs)[source]
Override the base class function to force the main datamodel attributes to be written to an astropy.io.fits.BinTableHDU object. This is identical to the base class method except
force_to_bintblis always set to True.
- update_flex_shift(shift, flex_type='local')[source]
Store the total spectral flexure shift in pixels
- Parameters:
shift (float) – additive spectral flexure in pixels
- version = '1.1.14'
Current datamodel version number.