    Return the quality flags for a PHA data set.

get_quality(id=None, bkg_id=None)
id - int or str, optional
bkg_id - int or str, optional

The function returns the quality value for each channel in the PHA data set.

Copy the quality array from the default data set to data set 2:

>>> qual1 = get_quality() >>> set_quality(2, qual1)

Return the quality array of the background component labelled 2 for the 'histate' data set:

>>> qual = get_quality('histate', bkg_id=2)

Change the quality setting for all channels below 30 in the default data set to 5 (considered bad by the user):

>>> chans, = get_indep() >>> qual = get_quality() >>> qual[chans < 30] = 5

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` .
bkg_id
Set if the quality flags should be taken from a background associated with the data set.

The return value from this function is:

qual -- The quality value for each channel in the PHA data set. This array is not grouped or filtered - that is, there is one element for each channel in the PHA data set. Changes to the elements of this array will change the values in the dataset (is is a reference to the values used to define the quality, not a copy).

Notes

The meaning of the quality column is taken from the OGIP standard, which says that 0 indicates a "good" channel, 1 and 2 are for channels that are identified as "bad" or "dubious" (respectively) by software, 5 indicates a "bad" channel set by the user, and values of 3 or 4 are not used.

References

K. A. Arnaud, I. M. George & A. F. Tennant, "The OGIP Spectral File Format"

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

December 2023