- sherpa.astro.ui.ignore_id(ids, lo=None, hi=None, **kwargs)¶
Exclude data from the fit for a data set.
Select one or more ranges of data to exclude by filtering on the independent axis value. The filter is applied to the given data set, or sets.
Changed in version 4.14.0: Integrated data sets - so Data1DInt and DataPHA when using energy or wavelengths - now ensure that the
hiargument is exclusive and better handling of the
loargument when it matches a bin edge. This can result in the same filter selecting a smaller number of bins than in earlier versions of Sherpa.
lo (number or str, optional) – The lower bound of the filter (when a number) or a string expression listing ranges in the form
a:b, with multiple ranges allowed, where the ranges are separated by a
,. The term
:bmeans exclude everything up to
b(an exclusive limit for integrated datasets), and
a:means exclude everything that is higher than, or equal to,
hi (number, optional) – The upper bound of the filter when
lois not a string.
bkg_id (int or str, optional) – The filter will be applied to the associated background component of the data set if
bkg_idis set. Only PHA data sets support this option; if not given, then the filter is applied to all background components as well as the source data.
The units used depend on the
analysissetting of the data set, if appropriate.
To filter a 2D data set by a shape use
Ignore all data points with an X value (the independent axis) between 12 and 18 for data set 1:
>>> ignore_id(1, 12, 18)
Ignore the range up to 0.5 and 7 and above, for data sets 1, 2, and 3:
>>> ignore_id([1,2,3], None, 0.5) >>> ignore_id([1,2,3], 7, None)
Apply the same filter as the previous example, but to data sets “core” and “jet”:
>>> ignore_id(["core","jet"], ":0.5,7:")