interpolate_flat

jwst.flatfield.flat_field.interpolate_flat(image_flat, image_dq, image_err, image_wl, wl)[source]

Interpolate within the 3-D flat field image to get a 2-D flat.

Parameters:
image_flatndarray

3D array, corresponding to slice [:, ystart:ystop, xstart:xstop] of the flat field reference image. This slice covers the spatial extent of the extracted 2-D spectrum and includes all of the wavelength axis (the first axis) of the reference image.

image_dqndarray

2D or 3D array corresponding to slice [..., ystart:ystop, xstart:xstop] of the data quality array for the flat field reference image.

image_errndarray

2D or 3D array corresponding to slice [..., ystart:ystop, xstart:xstop] of the error array for the flat field reference image.

image_wlndarray

The 1D wavelength for each plane of the flat field reference image.

wlndarray

The wavelength at each pixel of the 2D extracted science spectrum.

Returns:
flat_2dndarray of float32

The flat field, interpolated over wavelength, same shape as wl. Divide the 2D 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 float32

The error array corresponding to flat_2d.