contam_corr

jwst.wfss_contam.wfss_contam.contam_corr(input_model, waverange, photom, max_cores, orders=None, magnitude_limit=None, max_pixels_per_chunk=50000.0, oversample_factor=2)[source]

Correct contamination in WFSS spectral cutouts.

Parameters:
input_modelMultiSlitModel

Input data model containing 2D spectral cutouts. May be modified by processing: make a copy before calling this function, if needed.

waverangeWavelengthrangeModel

Wavelength range reference file model

photomNrcWfssPhotomModel or NisWfssPhotomModel

Photom (flux cal) reference file model

max_coresstr or int

Number of cores to use for multiprocessing. If set to ‘none’ (the default), then no multiprocessing will be done. The other allowable string values are ‘quarter’, ‘half’, and ‘all’, which indicate the fraction of cores to use for multi-proc. The total number of cores includes the SMT cores (Hyper Threading for Intel). If an integer is provided, it will be the exact number of cores used.

orderslist, optional

List of spectral orders to process. If None, all orders defined in the wavelengthrange file will be processed.

magnitude_limitfloat, optional

Isophotal AB magnitude limit for sources to be included in the contamination correction. The magnitude limit is applied per spectral order, where the orders are scaled relative to order 0 based on their photometric response as read from the photom reference file. This means that generally fewer sources will be dispersed in higher orders. If None, no magnitude limit is applied and all sources are included.

max_pixels_per_chunkint, optional

Maximum number of pixels to disperse simultaneously.

oversample_factorint, optional

Wavelength oversampling factor.

Returns:
output_modelMultiSlitModel

A copy of the input_model that has been corrected

simul_modelImageModel

Full-frame simulated image of the grism exposure

contam_modelMultiSlitModel

Contamination estimate images for each source slit