OutlierDetection

class jwst.outlier_detection.outlier_detection.OutlierDetection(input_models, reffiles=None, **pars)[source]

Bases: object

Main class for performing outlier detection.

This is the controlling routine for the outlier detection process. It loads and sets the various input data and parameters needed by the various functions and then controls the operation of this process through all the steps used for the detection.

Notes

This routine performs the following operations:

1. Extracts parameter settings from input model and merges
   them with any user-provided values
2. Resamples all input images into grouped observation mosaics.
3. Creates a median image from all grouped observation mosaics.
4. Blot median image to match each original input image.
5. Perform statistical comparison between blotted image and original
   image to identify outliers.
6. Updates input data model DQ arrays with mask of detected outliers.

Initialize the class with input ModelContainers.

Parameters:
  • input_models (list of DataModels, str) – list of data models as ModelContainer or ASN file, one data model for each input image

  • pars (dict, optional) – Optional user-specified parameters to modify how outlier_detection will operate. Valid parameters include: - resample_suffix

Attributes Summary

default_suffix

Methods Summary

blot_median(median_model)

Blot resampled median image back to the detector images.

build_suffix(**pars)

Build suffix.

create_median(resampled_models)

Create a median image from the singly resampled images.

detect_outliers(blot_models)

Flag DQ array for cosmic rays in input images.

do_detection()

Flag outlier pixels in DQ of input images.

Attributes Documentation

default_suffix = 'i2d'

Methods Documentation

blot_median(median_model)[source]

Blot resampled median image back to the detector images.

build_suffix(**pars)[source]

Build suffix.

Class-specific method for defining the resample_suffix attribute using a suffix specific to the sub-class.

create_median(resampled_models)[source]

Create a median image from the singly resampled images.

Notes

This version is simplified from astrodrizzle’s version in the following ways: - type of combination: fixed to ‘median’ - ‘minmed’ not implemented as an option

detect_outliers(blot_models)[source]

Flag DQ array for cosmic rays in input images.

The science frame in each ImageModel in input_models is compared to the corresponding blotted median image in blot_models. The result is an updated DQ array in each ImageModel in input_models.

Parameters:
  • input_models (JWST ModelContainer object) – data model container holding science ImageModels, modified in place

  • blot_models (JWST ModelContainer object) – data model container holding ImageModels of the median output frame blotted back to the wcs and frame of the ImageModels in input_models

Returns:

The dq array in each input model is modified in place

Return type:

None

do_detection()[source]

Flag outlier pixels in DQ of input images.