sofia_redux.instruments.fifi_ls: FIFI-LS Data Reduction Algorithms

The sofia_redux.instruments.fifi_ls package contains data reduction algorithms for the FIFI-LS instrument. It is designed to be used with the sofia_redux package, so it does not provide its own interfaces or workflows. Basic usage via the Redux interface is described below. See the sofia_redux.pipeline documentation for more information on the pipeline interfaces, or the API documentation below for more information on FIFI-LS algorithms.

Reference/API

sofia_redux.instruments.fifi_ls Package

sofia_redux.instruments.fifi_ls.apply_static_flat Module

Functions

clear_flat_cache()

Clear all data from the flat cache.

get_flat_from_cache(specfile, spatfile, obsdate)

Retrieves flat data from the flat cache.

store_flat_in_cache(specfile, spatfile, ...)

Store flat data in the flat cache.

get_flat(header)

Return flat data table

apply_flat_to_hdul(hdul, flatdata[, skip_err])

Divide extension data by static flat.

apply_static_flat(filename[, outdir, write, ...])

Apply pre-reduced and normalized flat to FIFI-LS data.

wrap_apply_static_flat(files[, outdir, ...])

Wrapper for apply_static_flat over multiple files.

sofia_redux.instruments.fifi_ls.combine_grating_scans Module

Functions

get_lambda_overlap(hdul)

Get overlapping wavelengths for all extensions.

combine_extensions(hdul[, correct_bias])

Combine all extensions into a single extension.

combine_grating_scans(filename[, ...])

Combine separate grating positions in FIFI-LS data.

wrap_combine_grating_scans(files[, outdir, ...])

Wrapper for combine_grating_scans over multiple files.

sofia_redux.instruments.fifi_ls.combine_nods Module

Functions

classify_files(filenames[, offbeam])

Extract various properties of all files for subsequent combination.

combine_extensions(df[, b_nod_method])

Find a B nod for each A nod.

combine_nods(filenames[, offbeam, ...])

Combine nods of ramp-fitted, chop-subtracted data.

sofia_redux.instruments.fifi_ls.correct_wave_shift Module

Functions

correct_lambda(hdul)

Correct LAMBDA extension in HDU list.

correct_wave_shift(filename[, write, outdir])

Correct wavelength shift due to motion of the Earth.

wrap_correct_wave_shift(files[, outdir, ...])

Wrapper for correct_wave_shift over multiple files.

sofia_redux.instruments.fifi_ls.fit_ramps Module

Functions

get_readout_range(header)

Returns the readout range as extracted from header.

resize_data(data, readout_range, indpos[, ...])

Trim and reshape data to separate ramps.

fit_data(data[, s2n, threshold, ...])

Applies linear fit (y = ax + b) over the second dimension of a 4D array.

process_extension(hdu, readout_range[, ...])

Wrapper to process a single HDU extension.

fit_ramps(filename[, s2n, threshold, ...])

Fit straight lines to raw voltage ramps to calculate corresponding flux.

wrap_fit_ramps(files[, s2n, threshold, ...])

Wrapper for fit_ramps over multiple files.

sofia_redux.instruments.fifi_ls.flux_calibrate Module

Functions

apply_response(hdul, response)

Apply response data to data in an HDUList.

flux_calibrate(filename[, response_file, ...])

Convert spectra to physical flux units.

wrap_flux_calibrate(files[, outdir, ...])

Wrapper for flux_calibrate over multiple files.

sofia_redux.instruments.fifi_ls.get_atran Module

Functions

clear_atran_cache()

Clear all data from the atran cache.

get_atran_from_cache(atranfile, resolution)

Retrieves atmospheric transmission data from the atran cache.

store_atran_in_cache(atranfile, resolution, ...)

Store atran data in the atran cache.

get_atran(header[, resolution, filename, ...])

Retrieve reference atmospheric transmission data.

sofia_redux.instruments.fifi_ls.get_badpix Module

Functions

clear_badpix_cache()

Clear all data from the badpix cache.

get_badpix_from_cache(badpixfile)

Retrieves bad pixel masks or default file from the badpix cache.

store_badpix_in_cache(badpixfile, badpix)

Store badpix data in the badpix cache.

read_defaults_table()

Read the badpix defaults table.

get_badpix(header[, filename])

Retrieve bad pixel data.

sofia_redux.instruments.fifi_ls.get_resolution Module

Functions

clear_resolution_cache()

Clear all data from the resolution cache.

get_resolution_from_cache(resfile)

Retrieves table from the resolution cache.

store_resolution_in_cache(resfile, resolution)

Store resolution data in the resolution cache.

get_resolution(header[, wmean, spatial])

Retrieve expected spectral or spatial resolution.

sofia_redux.instruments.fifi_ls.get_response Module

Functions

clear_response_cache()

Clear all data from the response cache.

get_response_from_cache(responsefile)

Retrieves response data from the response cache.

store_response_in_cache(responsefile, response)

Store response data in the response cache

get_response(header[, filename])

Retrieve instrumental response data.

sofia_redux.instruments.fifi_ls.lambda_calibrate Module

Functions

clear_wavecal_cache()

Clear all data from the wavecal cache.

get_wavecal_from_cache(wavecalfile)

Retrieves wavelength calibration data from the wavecal cache.

store_wavecal_in_cache(wavecalfile, wavecal)

Store wavecal data in the wavecal cache.

read_wavecal([calfile])

Read and return the data from the wavecal file.

wave(ind, date, dichroic[, blue, wavecal])

Calculate wavelengths for each spectral pixel.

lambda_calibrate(filename[, obsdate, ...])

Apply spectral calibration.

wrap_lambda_calibrate(files[, outdir, ...])

Wrapper for lambda_calibrate over multiple files.

sofia_redux.instruments.fifi_ls.make_header Module

Functions

create_requirements_table([default_file, ...])

Create the header keyword requirements definition table.

clear_requirements_table()

Clear all data from the requirements cache.

get_keyword_comments()

Get the keyword comments table from the cache.

get_keyword_table([filename])

Returns a dataframe containing the header requirements.

get_keyword_comments_table([filename])

Returns a dictionary containing header keyword comments.

update_basehead(basehead, table, headers)

Update the base header with values that may be missing.

order_headers(headers)

Order headers based on contents.

make_header([headers, checkheader, ...])

Standardize and combine input headers.

sofia_redux.instruments.fifi_ls.readfits Module

Functions

readfits(filename[, checkheader])

Read a FIFI-LS FITS file and return data and header.

sofia_redux.instruments.fifi_ls.resample Module

Functions

combine_files(filenames[, naif_id_key, ...])

Combine all files into a single dataset.

get_grid_info(combined[, oversample, ...])

Get output coordinate system and useful parameters.

generate_exposure_map(combined, grid_info[, ...])

Create the exposure map from combined files.

rbf_mean_combine(combined, grid_info[, ...])

Combines multiple datasets using radial basis functions and mean combine.

local_surface_fit(combined, grid_info[, ...])

Resamples combined data on regular grid using local polynomial fitting.

make_hdul(combined, grid_info[, append_weights])

Create final HDU List from combined data and gridding info.

resample(filenames[, target_x, target_y, ...])

Resample unevenly spaced FIFI-LS pixels to regular grid.

perform_scan_reduction(filenames[, ...])

Reduce the files using a scan reduction.

cleanup_scan_reduction(combined)

Remove all temporary files created during a scan reduction.

sofia_redux.instruments.fifi_ls.spatial_calibrate Module

Functions

clear_spatial_cache()

Clear all data from the spatial cache.

get_spatial_from_cache(spatialfile, obsdate)

Retrieves spatial data from the spatial cache.

store_spatial_in_cache(spatialfile, obsdate, ...)

Store spatial data in the spatial cache.

offset_xy(date[, blue])

Calculate X and Y offsets for each spaxel.

get_deltavec_coeffs(header, obsdate[, ...])

Read the correct delta vector spatial coefficients.

calculate_offsets(hdul[, obsdate, flipsign, ...])

Calculate X and Y spatial offsets.

spatial_calibrate(filename[, obsdate, ...])

Apply spatial calibration (x and y offsets).

wrap_spatial_calibrate(files[, outdir, ...])

Wrapper for spatial_calibrate over multiple files.

sofia_redux.instruments.fifi_ls.split_grating_and_chop Module

Functions

get_channel(hdul[, channel_index])

Returns RED or BLUE channel extracted from header and data.

get_split_params(hdul[, channel_index, ...])

Check if a file can be split by basic header checks.

trim_data(hdul, params)

Remove partial ramps and "unpaired" chop plateaus.

name_output_files(hdul)

Names the split files.

separate_chops(hdul, params)

Separate data into different files, by chop index.

split_grating_and_chop(filename[, write, outdir])

Split FIFI-LS raw data file into separate FITS files.

wrap_split_grating_and_chop(files[, outdir, ...])

Wrapper for split_grating_and_chop over multiple files.

sofia_redux.instruments.fifi_ls.subtract_chops Module

Functions

get_chop_pair(chop0_file)

Given the chop 0 filename, return the chop 0 and chop 1 HDU lists.

subtract_extensions(hdul0, hdul1[, add_only])

Subtract extensions in the correct order.

subtract_chops(chop0_file[, outdir, ...])

Subtract chops of ramp-fitted data.

wrap_subtract_chops(files[, outdir, ...])

Wrapper for subtract_chops over multiple files.

sofia_redux.instruments.fifi_ls.telluric_correct Module

Functions

apply_atran(hdul, atran[, cutoff, ...])

Apply transmission data to data in an HDUList.

telluric_correct(filename[, atran_dir, ...])

Correct spectra for atmospheric absorption features.

wrap_telluric_correct(files[, outdir, ...])

Wrapper for telluric_correct over multiple files.