get_bkg¶
-
sherpa.astro.ui.
get_bkg
(id=None, bkg_id=None)¶ 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 of data set.
Parameters: - id (int or str, optional) – The data set. If not given then the default identifier is used, as returned by get_default_id.
- bkg_id (int or str, optional) – The identifier for this background, which is needed if there are multiple background estimates for the source.
Returns: data
Return type: a sherpa.astro.data.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)