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:
idint, str, or None, optional

The data set. If not given then the default identifier is used, as returned by get_default_id.

bkg_idint, str, or None, optional

The identifier for this background, which is needed if there are multiple background estimates for the source.

Returns:
dataa DataPHA object
Raises:
sherpa.utils.err.ArgumentErr

If the data set does not contain a PHA data set.

sherpa.utils.err.IdentifierErr

If no data set is associated with this identifier.

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)