apply_master_background

jwst.master_background.nirspec_utils.apply_master_background(source_model, bkg_model, inverse=False)[source]

Subtract 2D master background signal from each source slitlet.

Parameters:
source_modelMultiSlitModel

The input data model containing all source slit instances. Updated in place.

bkg_modelMultiSlitModel

The data model containing 2D background slit instances.

inversebool

Invert the math operations used to apply the background.

Returns:
source_model: MultiSlitModel

The output background-subtracted data model.