# unsubtract¶

sherpa.astro.ui.unsubtract(id=None)

Undo any background subtraction for the data set.

The unsubtract function undoes any changes made by subtract. After this command, anything that uses the data set - such as a plot, fit, or error analysis - will use the original data values. Models should be re-fit if subtract is called.

Parameters

id (int or str, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by get_default_id.

Raises

sherpa.utils.err.ArgumentErr – If the data set does not contain a PHA data set.

fit()

Fit one or more data sets.

subtract()

Subtract the background estimate from a data set.

Notes

The subtracted field of a PHA data set is set to False when the background is not subtracted.

Examples

Remove the background subtraction from the default data set.

>>> subtract()
>>> get_data().subtracted
False


Remove the background subtraction from the data set labelled ‘src’:

>>> subtract('src')
>>> get_data('src').subtracted
False