lincor

sofia_redux.instruments.exes.lincor.lincor(data, header)[source]

Correct raw readout frames for detector nonlinearity.

Uses the linearity coefficients file stored in header[‘LINFILE’] to apply a correction to each raw readout frame. Each frame in the file corresponds to a polynomial correction coefficient for each pixel in the frame.

This algorithm subtracts the data from a bias level obtained from an input dark file, calculates the polynomial correction from the coefficients file, then applies it to any pixel between the upper and lower limits. The upper limit for each pixel is set in the first plane of the coefficients file. The lower limit is set in header[‘LO_LIM’].

Parameters:
datanumpy.ndarray

[nframe, nspec, nspat] input data array.

headerfits.Header

Input FITS header array.

Returns:
corrected_data, masknumpy.ndarray, numpy.ndarray

The corrected data (numpy.float64) and mask (bool) where True indicates a good pixel, False indicates bad. Both arrays are the same shape as data.