fft_clean_subarray

jwst.clean_flicker_noise.clean_flicker_noise.fft_clean_subarray(image, mask, detector, npix_iter=512, fc=(1061, 1211, 49943, 49957), exclude_outliers=True, sigrej=4, minfrac=0.05)[source]

Fit and remove background noise in frequency space for a subarray image.

Parameters:
imagendarray of float

The image to be cleaned.

maskndarray of bool

The mask that indicates which pixels are to be used in fitting.

detectorstr

The name of the detector from which the data originate.

npix_iterint

Number of pixels to process simultaneously. Default 512. Should be at least a few hundred to access sub-kHz frequencies in areas where most pixels are available for fitting. Previous default behavior corresponds to npix_iter of infinity.

fctuple

Apodizing filter definition. These parameters are tunable. The defaults happen to work well for NIRSpec BOTS exposures:

  1. Unity gain for f < fc[0]

  2. Cosine roll-off from fc[0] to fc[1]

  3. Zero gain from fc[1] to fc[2]

  4. Cosine roll-on from fc[2] to fc[3]

Default (1061, 1211, 49943, 49957)

exclude_outliersbool

Find and mask outliers in the fit? Default: True

sigrejfloat

Number of sigma to clip when identifying outliers. Default: 4.

minfracfloat

Minimum fraction of pixels locally available in the mask in order to attempt a correction. Default: 0.05 (i.e., 5%)

Returns:
cleaned_imagendarray of float

The cleaned image.