create_flat_field

jwst.flatfield.flat_field.create_flat_field(wl, f_flat_model, s_flat_model, d_flat_model, xstart, xstop, ystart, ystop, exposure_type, dispaxis, slit_name, slit_nt=None)[source]

Extract and combine flat field components for NIRSpec.

Parameters:
wlndarray

Wavelength at each pixel of the 2-D slit array. This array has shape (ystop - ystart, xstop - xstart).

f_flat_modelNirspecFlatModel, NirspecQuadFlatModel, or None

Flat field for the fore optics.

s_flat_modelNirspecFlatModel or None

Flat field for the spectrograph.

d_flat_modelNirspecFlatModel or None

Flat field for the detector.

xstart, xstop, ystart, ystopint

Starting and end pixel numbers (zero indexed) for the slice containing the data for the current slit. The start and stop values are Python slice notation, i.e., the region to be extracted is [ystart:ystop, xstart:xstop].

exposure_typestr

Exposure type for the input.

dispaxisint

1 means horizontal dispersion, 2 means vertical dispersion.

slit_namestr or None

The name of the slit currently being processed.

slit_ntnamedtuple or None, optional

For MSA data only, info about the current slit.

Returns:
flat_2dndarray of float

The flat field, interpolated over wavelength, same shape as wl. Divide the 2-D extracted spectrum by this array to correct for flat-field variations.

flat_dqndarray of uint32

The data quality array corresponding to flat_2d.

flat_errndarray of float

The error array corresponding to flat_2d.