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 the sofia_redux.spectroscopy package, and some utilities come from the sofia_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.

baseheadastropy.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

combine_response()

Scale, combine, and smooth instrument response.

combine_spectra()

Combine spectra.

extract_spectra()

Extract 1D spectra from apertures.

flux_calibrate()

Calibrate spectral flux.

load(data[, param_class])

Load input data to make it available to reduction steps.

locate_apertures()

Automatically find aperture centers.

make_profiles()

Rectify spectral images and produce spatial profile fits.

make_response()

Make spectral response curve.

merge_apertures()

Merge apertures to a single 1D spectrum.

register_viewers()

Return a new QADViewer, ProfileViewer, and SpectralViewer.

set_apertures()

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.

stack_dithers()

Combine images at common dither positions.

subtract_background()

Subtract background along columns.

trace_continuum()

Trace continuum at aperture locations.

Methods Documentation

combine_response()[source]

Scale, combine, and smooth instrument response.

combine_spectra()[source]

Combine spectra.

Calls sofia_redux.toolkit.image.coadd.coadd and sofia_redux.toolkit.image.combine.combine_images for coaddition. The combination method may be configured in parameters.

extract_spectra()[source]

Extract 1D spectra from apertures.

flux_calibrate()[source]

Calibrate spectral flux.

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.

locate_apertures()[source]

Automatically find aperture centers.

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.

make_response()[source]

Make spectral response curve.

merge_apertures()[source]

Merge apertures to a single 1D spectrum.

register_viewers()[source]

Return a new QADViewer, ProfileViewer, and SpectralViewer.

set_apertures()[source]

Set aperture radii.

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.

subtract_background()[source]

Subtract background along columns.

trace_continuum()[source]

Trace continuum at aperture locations.