MasterBackgroundStep

class jwst.master_background.MasterBackgroundStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]

Bases: JwstStep

MasterBackgroundStep: Compute and subtract master background from spectra

Create a Step instance.

Parameters:
  • name (str, optional) – The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.

  • parent (Step instance, optional) – The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.

  • config_file (str or pathlib.Path, optional) – The path to the config file that this step was initialized with. Use to determine relative path names of other config files.

  • **kws (dict) – Additional parameters to set. These will be set as member variables on the new Step instance.

Attributes Summary

class_alias

spec

Methods Summary

process(input)

Compute and subtract a master background spectrum

Attributes Documentation

class_alias = 'master_background'
spec
user_background = string(default=None) # Path to user-supplied master background
save_background = boolean(default=False) # Save computed master background
force_subtract = boolean(default=False) # Force subtracting master background
output_use_model = boolean(default=True)

Methods Documentation

process(input)[source]

Compute and subtract a master background spectrum

Parameters:
  • input (ImageModel, IFUImageModel, ModelContainer, association) – Input target datamodel(s) to which master background subtraction is to be applied

  • user_background (None, string, or MultiSpecModel) – Optional user-supplied master background 1D spectrum, path to file or opened datamodel

  • save_background (bool, optional) – Save computed master background.

  • force_subtract (bool, optional) – Optional user-supplied flag that overrides step logic to force subtraction of the master background. Default is False, in which case the step logic determines if the calspec2 background step has already been applied and, if so, the master background step is skipped. If set to True, the step logic is bypassed and the master background is subtracted.

Returns:

result – The background-subtracted science datamodel(s)

Return type:

ImageModel, IFUImageModel, ModelContainer