detect_outliers

jwst.outlier_detection.imaging.detect_outliers(input_models, save_intermediate_results, good_bits, maskpt, snr1, snr2, scale1, scale2, backg, resample_data, weight_type, pixfrac, kernel, fillval, in_memory, make_output_path, pixmap_stepsize=1, pixmap_order=1)[source]

Flag outliers in imaging data.

Parameters:
input_modelsModelLibrary

The library of datamodels.

save_intermediate_resultsbool

If True, save intermediate results.

good_bitsint

Bit values indicating good pixels.

maskptfloat

The percentage of the mean weight to use as a threshold for masking.

snr1float

The signal-to-noise ratio threshold for first pass flagging, prior to smoothing.

snr2float

The signal-to-noise ratio threshold for secondary flagging, after smoothing.

scale1float

Scale factor used to scale the absolute derivative of the blot model for the first pass.

scale2float

Scale factor used to scale the absolute derivative of the blot model for the second pass.

backgfloat

Scalar background level to add to the blotted image. Ignored if input_model.meta.background.level is not None but input_model.meta.background.subtracted is False.

resample_databool

If True, resample the data before detecting outliers.

weight_typestr

The type of weighting kernel to use when resampling. Options are ‘ivm’ or ‘exptime’.

pixfracfloat

The pixel shrinkage factor to pass to drizzle.

kernelstr

The flux distribution kernel function to use when resampling.

fillvalstr

The value to use in the output for pixels with no weight or flux

in_memorybool

If True, keep the input models in memory. Otherwise, store them on disk in temporary files as they are processed to save memory at the expense of runtime.

make_output_pathfunction

The functools.partial() instance to pass to save_blot. Must be specified if save_blot is True.

pixmap_stepsizefloat, optional

Indicates the spacing in pixels at which the WCS is evaluated when computing the pixel map. Larger step sizes result in faster performance at the cost of accuracy. Interpolation is only performed if pixmap_stepsize > 1. Default is 1.

pixmap_orderint, optional

Interpolating spline order for pixel map computation. Must be 1 or 3. Default is 1.

Returns:
ModelContainer

The input models with outliers flagged.