    Return the dependent axis of a data set.

get_dep(id=None, filter=False, bkg_id=None)
Alias: get_counts
id - int or str, optional
filter - bool, optional
bkg_id - int or str, optional

This function returns the data values (the dependent axis) for each point or pixel in the data set.

>>> load_arrays(1, [10, 15, 19], [4, 5, 9], Data1D) >>> get_dep() array([4, 5, 9])
>>> x0 = [10, 15, 12, 19] >>> x1 = [12, 14, 10, 17] >>> y = [4, 5, 9, -2] >>> load_arrays(2, x0, x1, y, Data2D) >>> get_dep(2) array([4, 5, 9, -2])

If the filter flag is set then the return will be limited to the data that is used in the fit:

>>> load_arrays(1, [10, 15, 19], [4, 5, 9]) >>> ignore_id(1, 17, None) >>> get_dep() array([4, 5, 9]) >>> get_dep(filter=True) array([4, 5])

An example with a PHA data set named 'spec':

>>> notice_id('spec', 0.5, 7) >>> yall = get_dep('spec') >>> yfilt = get_dep('spec', filter=True) >>> yall.size 1024 >>> yfilt.size 446

For images, the data is returned as a one-dimensional array:

>>> load_image('img', 'image.fits') >>> ivals = get_dep('img') >>> ivals.shape (65536,)

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The identifier for the data set to use. If not given then the default identifier is used, as returned by

`get_default_id` .
filter
Should the filter attached to the data set be applied to the return value or not. The default is False .
bkg_id
Set if the values returned should be from the given background component, instead of the source data set.

The return value from this function is:

axis -- The dependent axis values. The model estimate is compared to these values during fitting. For PHA data sets, the return array will match the grouping scheme applied to the data set. This array is one-dimensional, even for two dimensional (e.g. image) data.

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

December 2023