sofia_redux.calibration: Flux Calibration Algorithms

The sofia_redux.calibration package contains data reduction algorithms for the flux calibration of imaging instruments. It is designed to be used with SOFIA pipelines, integrated into the sofia_redux package. Currently, the FORCAST, FLITECAM, and HAWC+ instruments are supported.

Getting Started

Using Calibration Utilities

The primary calibration functions provided by this package are:

  1. Apply a correction for atmospheric opacity

  2. Compute aperture photometry and calibration parameters on known flux standards

  3. Apply flux calibration to an image

The easiest access to these functions are provided in the sofia_redux.calibration.pipecal_util submodule, as apply_tellcor, run_photometry, and apply_fluxcal respectively. A standalone script, called sofia_redux.calibration.pipecal_applyphot is also available to directly calculate photometry and store the results in FITS headers.

Submodule

Reference/API

sofia_redux.calibration.pipecal_applyphot Module

Calculate aperture photometry and update FITS header.

Functions

pipecal_applyphot(fitsfile[, srcpos, ...])

Calculate photometry on a FITS image and store results to FITS header.

sofia_redux.calibration.pipecal_calfac Module

Calculate a calibration factor from a standard flux value.

Functions

pipecal_calfac(flux, flux_err, config)

Calculate the calibration factor for a flux standard.

sofia_redux.calibration.pipecal_config Module

Calibration configuration.

Functions

pipecal_config(header)

Parse all reference files and return appropriate configuration values.

read_respfile(fname, spectel)

Read response files.

sofia_redux.calibration.pipecal_fitpeak Module

Fit a 2D function to an image.

Functions

elliptical_gaussian(coords[, baseline, ...])

Function for an elliptical Gaussian profile.

elliptical_lorentzian(coords[, baseline, ...])

Function for an elliptical Lorentzian profile.

elliptical_moffat(coords[, baseline, dpeak, ...])

Function for an elliptical Moffat profile.

pipecal_fitpeak(image[, profile, estimates, ...])

Fit a peak profile to a 2D image.

sofia_redux.calibration.pipecal_photometry Module

Fit a source and perform aperture photometry.

Functions

pipecal_photometry(image, variance[, ...])

Perform aperture photometry and profile fits on image data.

sofia_redux.calibration.pipecal_rratio Module

Calculate response ratio for atmospheric correction.

Functions

pipecal_rratio(za, altwv, za_ref, altwv_ref, ...)

Calculate the R ratio for a given ZA and Altitude or PWV.

sofia_redux.calibration.pipecal_util Module

Utility and convenience functions for common pipecal use cases.

Functions

average_za(header)

Robust average of zenith angle from FITS header.

average_alt(header)

Robust average of altitude from FITS header.

average_pwv(header)

Robust average of precipitable water vapor from FITS header.

guess_source_position(header, image[, srcpos])

Estimate the position of a standard source in the image.

add_calfac_keys(header, config)

Add calibration-related keywords to a header.

add_phot_keys(header, phot[, config, srcpos])

Add photometry-related keywords to a header.

get_fluxcal_factor(header, config[, update, ...])

Retrieve a flux calibration factor from configuration.

apply_fluxcal(data, header, config[, ...])

Apply a flux calibration factor to an image.

get_tellcor_factor(header, config[, update, ...])

Retrieve a telluric correction factor from configuration.

apply_tellcor(data, header, config[, ...])

Apply a telluric correction factor to an image.

run_photometry(data, header, var, config, ...)

Run photometry on an image of a standard source.

sofia_redux.calibration.pipecal_error Module

Base class for pipecal errors.

Classes

PipeCalError

A ValueError raised by pipecal functions.