FIFILSReduction

class sofia_redux.pipeline.sofia.fifils_reduction.FIFILSReduction[source]

Bases: Reduction

FIFI-LS reduction steps.

Primary image reduction algorithms are defined in the FIFI-LS package (fifi-ls). Some utilities come from the sofia_redux.toolkit package or the sofia_redux.spectroscopy 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.

Initialize the reduction object.

Methods Summary

apply_static_flat()

Apply flat correction.

checkhead()

Check input headers.

combine_grating_scans()

Combine grating scans.

combine_nods()

Combine nod pairs.

correct_wave_shift()

Correct wavelengths for barycentric shift.

fit_ramps()

Fit voltage ramps to derive average flux from samples.

flux_calibrate()

Calibrate flux to physical units.

lambda_calibrate()

Calibrate wavelengths.

load(data)

Load input data to make it available to reduction steps.

load_fits([check_header])

Load FITS data into memory.

register_viewers()

Return a new QADViewer.

resample()

Resample pixels onto a regular grid.

set_display_data([raw])

Store display data for QAD Viewer.

spatial_calibrate()

Calibrate pixel positions.

specmap()

Generate a quick-look image and spectral plot.

split_grating_and_chop()

Split data into separate files/extensions by chop/grating.

subtract_chops()

Subtract chop pairs for sky background removal.

telluric_correct()

Apply telluric correction.

update_output(hdul, prodtype)

Update output FITS file after a pipeline step.

write_output(hdul)

Write an output FITS file to disk.

Methods Documentation

apply_static_flat()[source]

Apply flat correction.

checkhead()[source]

Check input headers.

Compares header keywords to requirements. Halts reduction if the abort parameter is True and the headers do not meet requiremnts.

combine_grating_scans()[source]

Combine grating scans.

combine_nods()[source]

Combine nod pairs.

correct_wave_shift()[source]

Correct wavelengths for barycentric shift.

fit_ramps()[source]

Fit voltage ramps to derive average flux from samples.

flux_calibrate()[source]

Calibrate flux to physical units.

lambda_calibrate()[source]

Calibrate wavelengths.

load(data)[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 product type in the first FITS 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.

load_fits(check_header=False)[source]

Load FITS data into memory.

Handles raw data, as well as intermediate data.

Loaded data are stored in the input attribute.

register_viewers()[source]

Return a new QADViewer.

resample()[source]

Resample pixels onto a regular grid.

set_display_data(raw=False)[source]

Store display data for QAD Viewer.

Parameters:
rawbool

If True, display data is taken from self.rawfiles. If False, display data is taken from self.input

spatial_calibrate()[source]

Calibrate pixel positions.

specmap()[source]

Generate a quick-look image and spectral plot.

Calls sofia_redux.visualization.quicklook.make_image to make the image. Calls sofia_redux.instruments.fifi_ls.get_lines to get commonly-observed FIFI-LS wavelengths.

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.

split_grating_and_chop()[source]

Split data into separate files/extensions by chop/grating.

subtract_chops()[source]

Subtract chop pairs for sky background removal.

telluric_correct()[source]

Apply telluric correction.

update_output(hdul, prodtype)[source]

Update output FITS file after a pipeline step.

Adds a HISTORY message with the pipeline step name and parameters.

Parameters:
hdulastropy.io.fits.HDUList

Output FITS HDUList.

write_output(hdul)[source]

Write an output FITS file to disk.

Outname is joined to self.output_directory, before writing.

Parameters:
hdulastropy.io.fits.HDUList

FITS HDUList to write.

Returns:
str

Full path to the output file.