exposure_oneoverf_correction

grizli.jwst_utils.exposure_oneoverf_correction(file, axis=None, thresholds=[5, 4, 3], erode_mask=None, manual_mask=None, nirspec_prism_mask=False, dilate_iterations=3, deg_pix=64, make_plot=True, init_model=0, in_place=False, skip_miri=True, force_oneoverf=False, verbose=True, **kwargs)[source]

1/f correction for individual exposure

  1. Create a “background” mask with sep

  2. Identify sources above threshold limit in the background-subtracted image

  3. Iterate a row/column correction on threshold-masked images. A chebyshev polynomial is fit to the correction array to try to isolate just the high-frequency oscillations.

Parameters
filestr

JWST raw image filename

axisint

Axis over which to calculated the correction. If None, then defaults to axis=1 (rows) for NIRCam and axis=1 (columns) for NIRISS.

thresholdslist

List of source identification thresholds

erode_maskbool

Erode the source mask to try to remove individual pixels that satisfy the S/N threshold. If None, then set to False if the exposure is a NIRISS dispersed image to avoid clipping compact high-order spectra from the mask and True otherwise (for NIRISS imaging and NIRCam generally).

manual_maskarray-like, None

Manually-defined mask with valid pixels set to True. Should have the same dimensions as the exposure data, i.e., (2048, 2048).

nirspec_prism_maskbool

Make an automatic mask for NIRSpec PRISM exposures for axis=1 mask using only pixels that won’t have PRISM spectra.

dilate_iterationsint

Number of binary_dilation iterations of the source mask

deg_pixint

Scale in pixels for each degree of the smooth chebyshev polynomial

make_plotbool

Make a diagnostic plot

init_modelscalar, array-like

Initial correction model, e.g., for doing both axes

in_placebool

If True, remove the model from the ‘SCI’ extension of file

skip_miribool

Don’t run on MIRI exposures

force_oneoverfbool

Force the correction even if the ONEFEXP keyword is already set

verbosebool

Print status messages

Returns
figFigure, None

Diagnostic figure if make_plot=True

modelarray-like

The row- or column-average correction array