telluric_correct

sofia_redux.instruments.fifi_ls.telluric_correct.telluric_correct(filename, atran_dir=None, cutoff=0.6, use_wv=False, skip_corr=False, write=False, outdir=None)[source]

Correct spectra for atmospheric absorption features.

The procedure is:

  1. Identify ATRAN file to use. Smooth it to the spectral resolution of the input file.

  2. Interpolate the atmospheric transmission data onto the wavelength value of each spexel. Divide the data at each point by the transmission value.

  3. Create FITS file and (optionally) write results to disk.

The output FITS file contains FLUX, STDDEV, LAMBDA, XS, YS, RA, and DEC arrays in the same dimensions as the input. Additionally, UNCORRECTED_FLUX and UNCORRECTED_STDDEV image extensions are appended, containing a copy of the input FLUX and STDDEV arrays. An interpolated ATRAN extension is also appended, matching the dimensions of LAMBDA. The full unsmoothed transmission data is also appended as an image extension, in a n_atran x 2 array, for reference.

Parameters:
filenamestr

FITS file to be telluric corrected. Should have been generated by fifi_ls.combine_grating_scans.

atran_dirstr, optional

Path to a directory containing ATRAN reference FITS files. If not provided, the default set of files packaged with the pipeline will be used.

cutofffloat, optional

Used as the fractional transmission below which data will be set to NaN. Set to 0 to keep all data.

use_wvbool, optional

If set, water vapor values from the header will be used to select the correct ATRAN file.

skip_corrbool, optional

If set, telluric correction will not be applied, but ATRAN spectra will still be attached to the output file.

writebool, optional

If True, write to disk and return the path to the output file. If False, return the HDUL. The output filename is created from the input filename, with the suffix ‘SCM’ replaced with ‘TEL’.

outdirstr, optional

Directory path to write output. If None, output files will be written to the same directory as the input files.

Returns:
fits.HDUList or str

Either the HDU (if write is False) or the filename of the output file (if write is True)