MasterBackgroundStep

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

Bases: jwst.stpipe.Step

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 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

spec

Methods Summary

process(input)

Compute and subtract a master background spectrum

Attributes Documentation

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

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