    Set the dependent axis of a data set.

set_counts(id, val=None, bkg_id=None)
Alias: set_dep
id - int or str, optional
val - array
bkg_id - int or str, optional

Create a 1D data set with values at (0,4), (2,10), (4,12), (6,8), (8,2), and (10,12):

>>> dataspace1d(0, 10, 2, dstype=Data1D) >>> set_dep([4, 10, 12, 8, 2, 12])

Set the values for the source and background of the data set 'src':

>>> set_dep('src', y1) >>> set_dep('src', bg1, bkg_id=1)

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The data set to use. If not given then the default identifier is used, as returned by `get_default_id` .
val
The array of values for the dependent axis.
bkg_id
Set to identify which background component to set. The default value ( none ) means that this is for the source component of the data set.

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 `val` parameter. If given two un-named arguments, then they are interpreted as the `id` and `val` parameters, respectively.

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

December 2023