correct_wave_shift¶
- sofia_redux.instruments.fifi_ls.correct_wave_shift.correct_wave_shift(filename, write=False, outdir=None)[source]¶
Correct wavelength shift due to motion of the Earth.
The procedure is as follows.
Read the FITS header and the wavelengths from the input file.
Calculate the wavelength shift due to barycentric motion.
Apply the (reverse) shift to wavelengths in the LAMBDA extension.
Create a FITS file and (optionally) write results to disk.
The output FITS file matches the extensions and dimensions of the input FITS file, with an additional UNCORRECTED_LAMBDA extension attached, containing a copy of the input, uncorrected wavelengths.
- Parameters:
- filenamestr
FITS file to be corrected. Should have been created with fifi_ls.combine_grating_scans or fifi_ls.telluric_correct or fifi_ls.flux_calibrate.
- writebool, optional
If True, write to disk and return the path to the output file. If False, return the HDUList. The output filename is created from the input filename, with the suffix ‘SCM’, ‘TEL’, or ‘CAL’ replaced with ‘WSH’.
- 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)