Exclude channels marked as bad in a PHA data set.
ignore_bad(id=None, bkg_id=None) id - int or str, optional bkg_id - int or str, optional
Ignore any bin in the PHA data set which has a quality value that is larger than zero.
Remove any bins that are marked bad in the default data set:
>>> load_pha('src.pi') >>> ignore_bad() dataset 1: 1:256 Channel (unchanged)
The data set 'jet' is grouped, and a filter applied. After ignoring the bad-quality points, the filter has been removed and will need to be re-applied:
>>> group_counts('jet', 20) >>> notice_id('jet', 0.5, 7) dataset jet: 0.00146:14.9504 -> 0.438:13.4612 Energy (keV) >>> get_filter('jet') '0.437999993563:13.461199760437' >>> ignore_bad('jet') WARNING: filtering grouped data with quality flags, previous filters deleted dataset jet: 0.438:13.4612 -> 0.00146:14.9504 Energy (keV) >>> get_filter('jet') '0.001460000058:14.950400352478'
The parameters for this function are:
|id||The data set to change. If not given then the default identifier is used, as returned by `get_default_id` .|
|bkg_id||The identifier for the background (the default of none uses the first component).|
The `load_pha` command - and others that create a PHA data set - do not exclude these bad-quality bins automatically.
If the data set has been grouped, then calling `ignore_bad` will remove any filter applied to the data set. If this happens a warning message will be displayed.
Changes in CIAO
Changed in CIAO 4.15
The change in the filter is now reported for the dataset, to match the behavior of `notice` and `ignore` .
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.