median_clean
- jwst.clean_flicker_noise.clean_flicker_noise.median_clean(image, mask, axis_to_correct, fit_by_channel=False)[source]
Fit and remove background noise via median values along one image axis.
- Parameters:
- imagendarray of float
The image to be cleaned.
- maskndarray of bool
The mask that indicates which pixels are to be used in fitting. True indicates a background pixel.
- axis_to_correctint
For NIR detectors, the axis to correct should be the detector slow readout direction. Values expected are 1 or 2, following the JWST datamodel definition (
meta.subarray.slowaxis). For MIRI, flicker noise appears along the vertical direction, soaxis_to_correctshould be set to 1 (median along the y-axis).- fit_by_channelbool, optional
If set, flicker noise is fit independently for each detector channel. Ignored for MIRI and for subarray data.
- Returns:
- cleaned_imagendarray of float
The cleaned image.