Data processing steps

Initially, most of these steps wrap existing tasks in the Gemini IRAF package (reimplementing their APIs) as if they were native Python functions; these and the steps implemented in Python both operate on DataFileList objects and can be mixed & matched relatively transparently (to the extent practical when using IRAF databases etc.; see their individual docstrings).

Reference/API

ndmapper.lib.cosmetics Module

Functions

init_bpm(*args, **kwargs) Initialize a bad pixel mask array from a string listing the corresponding regions in NumPy or IRAF/FITS syntax.
add_bpm(*args, **kwargs) Incorporate an existing bad pixel mask into the corresponding flags attributes of the input DataFile instances.
lacosmic_spec(input_ndd[, x_order, y_order, ...]) Detect and clean cosmic rays in a 2D wavelength-dispersed image, using the well-known LA Cosmic algorithm of van Dokkum (2001)*, as implemented in McCully’s optimized version for Python, “lacosmicx”+.
clean_cosmic_rays(*args, **kwargs) Identify pixels contaminated by cosmic ray flux, using McCully’s version of the LACosmic algorithm (see lacosmic_spec), record the detections in a copy of the input flags array and replace bad values with an estimate of the clean value, based on a masked mean of surrounding pixels.

ndmapper.lib.gemini Module

Functions

gemini_iraf_helper() Define a few common default values for Gemini IRAF tasks in one place (just to avoid more repetition of static values than necessary) and convert some Python defaults to be more appropriate for the IRAF tasks.
clean_pixels(*args, **kwargs) Replace each pixel whose corresponding flags value matches one or more non-zero bits of the bitmask with a (locally- or globally-) interpolated estimate of its true, uncontaminated value.

ndmapper.lib.gmos Package

Functions

clean_pixels(*args, **kwargs) Replace each pixel whose corresponding flags value matches one or more non-zero bits of the bitmask with a (locally- or globally-) interpolated estimate of its true, uncontaminated value.
make_bias(*args, **kwargs) Combine individual bias exposures to produce a reference bias frame for calibrating other data.

ndmapper.lib.gmos.spec Package

Functions

apply_flux_cal(*args, **kwargs) Apply a previously-measured sensitivity spectrum to each input to convert the data values to spectrophotometric flux units.
calibrate_flux(*args, **kwargs) Generate an instrumental sensitivity spectrum in magnitudes from the 1D integrated spectrum of a spectrophotometric standard star.
clean_pixels(*args, **kwargs) Replace each pixel whose corresponding flags value matches one or more non-zero bits of the bitmask with a (locally- or globally-) interpolated estimate of its true, uncontaminated value.
make_bias(*args, **kwargs) Combine individual bias exposures to produce a reference bias frame for calibrating other data.
normalize_QE(*args, **kwargs) Correct for relative differences in quantum efficiency as a function of wavelength between the constituent GMOS CCDs (to avoid discontinuities between the detectors etc.).
shift_spectra(*args, **kwargs) Apply a zero-point shift to the wavelength calibrations of the input spectra, eg.

ndmapper.lib.gmos.spec.ifu Module

Functions

make_bias(*args, **kwargs) Combine individual bias exposures to produce a reference bias frame for calibrating other data.
clean_pixels(*args, **kwargs) Replace each pixel whose corresponding flags value matches one or more non-zero bits of the bitmask with a (locally- or globally-) interpolated estimate of its true, uncontaminated value.
calibrate_flux(*args, **kwargs) Generate an instrumental sensitivity spectrum in magnitudes from the 1D integrated spectrum of a spectrophotometric standard star.
apply_flux_cal(*args, **kwargs) Apply a previously-measured sensitivity spectrum to each input to convert the data values to spectrophotometric flux units.
normalize_QE(*args, **kwargs) Correct for relative differences in quantum efficiency as a function of wavelength between the constituent GMOS CCDs (to avoid discontinuities between the detectors etc.).
shift_spectra(*args, **kwargs) Apply a zero-point shift to the wavelength calibrations of the input spectra, eg.
prepare(*args, **kwargs) Update the meta-data from raw GMOS images in preparation for subsequent processing.
subtract_bias(*args, **kwargs) Subtract overscan level & pixel-to-pixel variations in zero point.
extract_spectra(*args, **kwargs) Extract one spectrum per IFU fibre from each 2D spectrogram to produce row-stacked 1D spectra, mosaicking the separate GMOS CCDs beforehand and adding an approximate wavelength solution to the headers afterwards.
calibrate_wavelength(*args, **kwargs) Determine an absolute wavelength solution for each row (fibre) of the input spectra.
rectify_wavelength(*args, **kwargs) Resample (“transform”) fibre spectra onto a pixel array with a linear wavelength increment.
make_flat(*args, **kwargs) Generate a normalized flat field calibration spectrum that includes both fibre-to-fibre and pixel-to-pixel variations, by fitting the average continuum and dividing each fibre spectrum by the result (scaled to match its wavelength solution).
subtract_sky(*args, **kwargs) Create an average sky spectrum over rows corresponding to the background IFU field and subtract it from each fibre spectrum (image row).
resample_to_cube(*args, **kwargs) Resample fibre spectra onto a 3D “data cube”, interpolating spatially over the hexagonal/triangular grid of the IFU.
sum_spectra(*args, **kwargs) Sum over fibre spectra in the main “object” IFU field to produce a 1D output spectrum.
background_regions(*args, **kwargs) Determine unilluminated regions of the detector, which can subsequently be used (with optional user modifications) to estimate an instrumental background or scattered light level as a function of position.
subtract_bg(*args, **kwargs) Model the instrumental background or scattered light level as a function of position in the input files (based on the counts within specified nominally-unilluminated regions) and subtract the result from each input to remove the estimated contamination.
align_wcs(*args, **kwargs) Measure spatial offsets between IFU data cubes, by comparing their image features (summed over wavelength), and update their WCS zero points accordingly, to match the first cube in inputs.
mosaic(*args, **kwargs) Resample and co-add IFU data cubes onto a single, mosaicked output cube (with registration determined by their WCS zero-point differences).
log_rebin(*args, **kwargs) Resample the wavelength axis of each x-y-lambda data cube onto constant increments in log(wavelength), ie.

Entries without links are inherited from their parent module, in which the full documentation can be found.