get_bkg_source
- sherpa.astro.ui.get_bkg_source(id: IdType | None = None, bkg_id: IdType | None = None)
Return the model expression for the background of a PHA data set.
This returns the model expression created by
set_bkg_modelorset_bkg_source. It does not include any instrument response.- Parameters:
- Returns:
- model
asherpa.models.Modelobject This can contain multiple model components. Changing attributes of this model changes the model used by the data set.
- model
See also
delete_bkg_modelDelete the background model expression for a data set.
get_bkg_modelReturn the model expression for the background of a PHA data set.
list_model_idsList of all the data sets with a source expression.
set_bkg_modelSet the background model expression for a PHA data set.
show_bkg_modelDisplay the background model expression for a data set.
Examples
Return the background model expression for the default data set:
>>> bkg = get_bkg_source() >>> len(bkg.pars) 2