    Set a data set.

set_data(id, data=None)
id - int or str, optional
data - instance of a sherpa.Data.Data-derived class
>>> d1 = get_data(2) >>> set_data(d1)

Copy the background data from the default data set into a new data set identified as 'bkg':

>>> set_data('bkg', get_bkg())

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The data set. If not given then the default identifier is used, as returned by `get_default_id` .
data
The new contents of the data set. This can be copied from an existing data set or loaded in from a file (e.g. `unpack_data` ).

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `data` parameter. If given two un-named arguments, then they are interpreted as the `id` and `data` parameters, respectively.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023