FLITECAMReduction

class sofia_redux.pipeline.sofia.flitecam_reduction.FLITECAMReduction[source]

Bases: FORCASTReduction

FLITECAM reduction steps.

Primary image reduction algorithms are defined in the flitecam package (sofia_redux.instruments.flitecam). Calibration-related algorithms are pulled from the sofia_redux.calibration 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.

cal_confdict-like

Flux calibration and atmospheric correction configuration, as returned from the pipecal pipecal_config function.

Initialize the reduction object.

Methods Summary

check_header()

Check input headers.

correct_linearity()

Correct flux for nonlinearity.

getfilename(header[, update, prodtype, filenum])

Create an output filename from an input header.

getfilenum(filename)

Get the file number from a file name.

load(data[, param_class])

Load input data to make it available to reduction steps.

Methods Documentation

check_header()[source]

Check input headers.

Calls sofia_redux.instruments.flitecam.hdcheck.hdcheck to compare header keywords to requirements. Halts reduction if the abort parameter is True and the headers do not meet requirements.

correct_linearity()[source]

Correct flux for nonlinearity.

Also calculates the error on the flux, after linearity correction.

getfilename(header, update=True, prodtype='RAW', filenum='UNKNOWN')[source]

Create an output filename from an input header.

Parameters:
headerfits.Header

Header to create filename from.

updatebool, optional

If set, FILENAME key will be added or updated in the header.

prodtypestr, optional

Three letter product type designator.

filenumstr or list, optional

List of file numbers to concatenate for filename.

Returns:
str

The output name.

getfilenum(filename)[source]

Get the file number from a file name.

Returns UNKNOWN if file number can’t be parsed.

Parameters:
filenamestr

File name to parse. Raw filenames (not starting with F[d]+) are assumed to be \*[_-][filenum].?.fits. Processed filenames are assumed to be \*_[filenum].fits.

Returns:
str or list

File number(s), formatted to 4 digits.

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