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:
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
Examples
>>> bg = get_bkg()
>>> bg = get_bkg('flare', 2)