median_with_resampling

jwst.outlier_detection.utils.median_with_resampling(input_models, resamp, maskpt, save_intermediate_results=False, make_output_path=None, buffer_size=None, return_error=False)[source]

Compute a median image with resampling.

The median is performed across resampled groups, for both imaging and spectral modes.

Parameters:
input_modelsModelLibrary

The input datamodels.

resampResampleImage

The controlling object for the resampling process.

maskptfloat

The weight threshold for masking out low weight pixels.

save_intermediate_resultsbool

If True, save the drizzled models and median model to FITS.

make_output_pathfunction or None

The functools.partial() instance to pass to internal function for saving the median image. Must be specified if save_intermediate_results is True. Default is None.

buffer_sizeint

The size of chunk in bytes that will be read into memory when computing the median. This parameter has no effect if the input library has its on_disk attribute set to False.

return_errorbool, optional

If True, an approximate median error is computed alongside the median science image.

Returns:
median_datandarray

The median data array.

median_wcsWCS

A WCS corresponding to the median data.

median_errorndarray or None, optional

A median error estimate, returned only if return_error is True. If resamp.compute_err is not set to “driz_err”, None will be returned.