get_bkg

sherpa.astro.ui.get_bkg(id: IdType | None = None, bkg_id: IdType | None = None) DataPHA

Return the background for a PHA data set.

Function to return the background for a PHA data set. The object returned by the call can be used to query and change properties of the background.

Parameters:
  • id (int, str, or None, optional) – The data set. If not given then the default identifier is used, as returned by get_default_id.

  • bkg_id (int, str, or None, optional) – The identifier for this background, which is needed if there are multiple background estimates for the source.

Returns:

data

Return type:

a DataPHA object

Raises:

See also

get_data

Return the data set by identifier.

load_bkg

Load the backgreound from a file and add it to a PHA data set.

set_bkg

Set the background for a PHA data set.

Examples

>>> bg = get_bkg()
>>> bg = get_bkg('flare', 2)