create_mask

jwst.clean_flicker_noise.clean_flicker_noise.create_mask(input_model, mask_science_regions=False, n_sigma=2.0, fit_histogram=False, single_mask=False)[source]

Create a mask identifying background pixels.

Parameters:
input_modelJwstDataModel

Science data model, containing rate data with all necessary pre-processing already performed.

mask_science_regionsbool, optional

For NIRSpec, mask regions of the image defined by WCS bounding boxes for slits/slices, as well as any regions known to be affected by failed-open MSA shutters. This requires the assign_wcs and msaflagopen steps to have been run on the input_model. For MIRI imaging, mask regions of the detector not used for science. This requires that DO_NOT_USE flags are set in the DQ array for the input_model.

n_sigmafloat, optional

Sigma threshold for masking outliers.

fit_histogrambool, optional

If set, the ‘sigma’ used with n_sigma for clipping outliers is derived from a Gaussian fit to a histogram of values. Otherwise, a simple iterative sigma clipping is performed.

single_maskbool, optional

If set, a single mask will be created, regardless of the number of input integrations. Otherwise, the mask will be a 3D cube, with one plane for each integration.

Returns:
maskndarray of bool

2D or 3D image mask