subtract_soss_bkg

jwst.background.background_sub_soss.subtract_soss_bkg(input_model, bkg_name, soss_source_percentile, soss_bkg_percentile)[source]

Subtract a scaled template reference background from input SOSS data.

Derive a separate scaling factor left and right of the background discontinuity; select the best template from the library of templates in the reference file using the root-mean-square of the residuals.

Parameters:
input_modelCubeModel or ImageModel

The science data, typically multi-integration CubeModel but possibly an ImageModel.

bkg_namestr

The name of the background reference file.

soss_source_percentilefloat

The threshold percentile used as a cutoff - all pixels above the threshold are deemed source and are not used for background template matching.

soss_bkg_percentilelist of float

A 2-member list describing the lower and upper limits of the background flux percentiles to use for calculation of the scaling factor.

Returns:
CubeModel or ImageModel

The background-subtracted science datamodel.