FORCASTSpectroscopyReduction¶
- class sofia_redux.pipeline.sofia.forcast_spectroscopy_reduction.FORCASTSpectroscopyReduction[source]¶
Bases:
FORCASTReduction
FORCAST spectroscopy reduction steps.
Primary image reduction algorithms are defined in the DRIP package (
sofia_redux.instruments.forcast
). Spectroscopy-related algorithms are pulled from thesofia_redux.spectroscopy
package, and some utilities come from thesofia_redux.toolkit
package. This reduction object requires that all three packages be installed.This reduction object defines a method for each pipeline step that calls the appropriate algorithm from its source packages.
- Attributes:
- prodtype_mapdict
Maps the pipeline step to a product type, to assign to the PRODTYPE key. Keys are pipeline step function names.
- prodnamesdict
3-letter file type code, to assign to the output of a pipeline step. Keys are the product types (as defined in prodtype_map).
- step_mapdict
Inverse of the prodtype_map, for looking up pipeline step names from product types. Keys are the product types.
- prodtypeslist
List of product types, corresponding to the currently loaded recipe. This list is populated whenever the recipe attribute is set.
- default_recipelist
Processing recipe used for most input data.
- response_recipelist
Alternate processing recipe to use when input data is marked as a flux standard (OBSTYPE=STANDARD_TELLURIC). Instrumental response spectra are generated instead of a final calibrated, combined spectrum.
- basehead
astropy.io.fits.Header
Header for the first raw input file loaded, used for calibration configuration.
- calresdict-like
Reduction mode and auxiliary file configuration mapping, as returned from the sofia_redux.instruments.forcast
getcalpath
function.- wcs_keyslist
List of header keywords used for tracking and propagating the spectral world coordinate system.
Initialize the reduction object.
Methods Summary
Scale, combine, and smooth instrument response.
Combine spectra.
Extract 1D spectra from apertures.
Calibrate spectral flux.
load
(data[, param_class])Load input data to make it available to reduction steps.
Automatically find aperture centers.
Rectify spectral images and produce spatial profile fits.
Make spectral response curve.
Merge apertures to a single 1D spectrum.
Return a new QADViewer, ProfileViewer, and SpectralViewer.
Set aperture radii.
set_display_data
([raw, filenames, regions, ...])Store display data for QAD and Matplotlib viewers.
specmap
()Generate a quick-look image and spectral plot.
Combine images at common dither positions.
Subtract background along columns.
Trace continuum at aperture locations.
Methods Documentation
- combine_spectra()[source]¶
Combine spectra.
Calls
sofia_redux.toolkit.image.coadd.coadd
andsofia_redux.toolkit.image.combine.combine_images
for coaddition. The combination method may be configured in parameters.
- load(data, param_class=None)[source]¶
Load input data to make it available to reduction steps.
The process is:
Call the parent load method to initialize data reduction variables.
Use the first loaded FITS header to determine and load the DRIP configuration (
sofia_redux.instruments.forcast.getcalpath
,sofia_redux.instruments.forcast.configuration
).Use the loaded configuration and the product type in the base header to determine the data processing recipe.
Load parameters for all steps.
Load the data immediately if starting from an intermediate step; otherwise, just load the raw headers and defer loading the data from the FITS files.
After this step, the input attribute is populated as required for the first pipeline step in the recipe.
- Parameters:
- datalist of str or str
Input file paths to load.
- param_classclass, optional
Parameters to instantiate, if not FORCASTImagingParameters. Initialization arguments must match.
- make_profiles()[source]¶
Rectify spectral images and produce spatial profile fits.
The rectified images and profiles are stored in self.input for continued processing.
If the
atmosthresh
parameters is set to a number > 0, then an atran file associated with the data will be retrieved from the FORCAST data default, and used to determine spatial profile regions that should be ignored for the profile fits.
- set_display_data(raw=False, filenames=None, regions=None, specviewer='eye')[source]¶
Store display data for QAD and Matplotlib viewers.
- Parameters:
- rawbool
If True, display data is taken from self.rawfiles. If False, display data is taken from self.input
- filenameslist of str, optional
If provided and
raw
is False, file names will be passed to QADViewer instead of self.input.- regionslist of str, optional
File names of DS9 region files to pass to QADViewer.
- specmap()[source]¶
Generate a quick-look image and spectral plot.
Calls
sofia_redux.visualization.quicklook.make_image
.The output from this step is identical to the input, so is not saved. As a side effect, a PNG file is saved to disk to the same base name as the input file, with a ‘.png’ extension.
- stack_dithers()[source]¶
Combine images at common dither positions.
Calls
sofia_redux.toolkit.image.combine.combine_images
for image coaddition.The combination method may be configured in parameters, or skipped entirely.