make_flat

ndmapper.lib.gmos.spec.ifu.make_flat(*args, **kwargs)[source] [edit on github]

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).

This requires the modified version of the IRAF task gfresponse found in the “ifudrgmos” version of the GMOS package (r145+), published at http://drforum.gemini.edu/topic/gmos-ifu-data-reduction-scripts/.

Parameters:

inputs : DataFileList or DataFile

Input images, each containing extracted fibre spectra of a spatially flat, spectrally smooth source (normally the GCal Quartz-Halogen lamp), with known wavelength solutions. Each input must already have an associated entry named ‘arc’ in its cals dictionary (whose name is currently used to find the corresponding IRAF database files).

flat_names : str-like or list of str-like, optional

Names of output normalized flat-field images, one per input. If None (default), the names of the DataFile instances returned will be constructed from those of the input files by appending ‘_flat’. [To do: should this combine the inputs & produce only one output?]

order : int, optional

Order of the Chebyshev continuum fit (default 45).

sample : str, optional

The range of sample pixels in the wavelength dimension to use for continuum fitting (currently IRAF convention, default ‘*’).

See “help gfresponse” in IRAF for more detailed information.

Returns:

outimages : DataFileList

The normalized flat field produced by gfresponse.