clean

sofia_redux.instruments.forcast.clean.clean(data, badmap=None, header=None, variance=None, propagate_nan=False, **kwargs)[source]

Replaces bad pixels in an image with approximate values

Interpolates over bad values. If the clean method used for jailbar pattern removal is FFT, it is applied here. If it is median, it is applied to the science in stack or to the calibrations in getcal.

Parameters:
datanumpy.ndarray

Input data array (nimage, nrow, ncol)

badmapnumpy.ndarray, optional

Bad pixel map (nrow, ncol) of bools. False = good pixel, True = bad pixel

headerastropy.io.fits.header.Header

Input header, will be updated with HISTORY messages

variancenumpy.ndarray, optional

Variance array (nimage, ncol, nrow) to update in parallel with the data array

propagate_nanbool, optional

If set, bad pixels will be set to NaN instead of interpolated over.

kwargs

Optional parameters to pass into mask interp. The most relevant default settings are maxap=6, order=3. See interpolate.maskinterp for further details

Returns:
numpy.ndarray, numpy.ndarray

Cleaned data array (nimage, ncol, nrow) Propagated variance array (nimage, ncol, nrow)