subtract_bg

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

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.

Parameters:

inputs : DataFileList or DataFile

Input, bias-subtracted images, in the raw data format, each of which must have an entry named ‘bg_reg’ in its cals dictionary, specifying the unilluminated detector regions to use for background estimation; see background_regions.

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

Names of output images containing the background-subtracted spectra. If

None (default), the names of the DataFile instances returned will be

constructed from those of the corresponding input files, prefixed with ‘b’ as in the Gemini IRAF package.

x_order, y_order : int or list of int, optional

Order of the Legendre surface fit along rows and columns, respectively, for each CCD (or all CCDs if a single integer). With the default of None, orders of [5,9,5] or [5,5,9,5,5,5] are used for x and [5,7,5] or [5,5,7,5,5,5] for columns, as appropriate. The index of the higher number may need adjusting by the user to match the CCD where the IFU slits overlap (if applicable). This logic will probably be made a bit more intelligent in a future version.

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

Returns:

outimage : DataFileList

The background-subtracted images produced by gfscatsub.