ignore

sherpa.ui.ignore(lo=None, hi=None, **kwargs)

Exclude data from the fit.

Select one or more ranges of data to exclude by filtering on the independent axis value. The filter is applied to all data sets.

Parameters:
  • 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 :b means exclude everything up to, and including b, and a: means exclude everything that is higher than, or equal to, a.
  • hi (number, optional) – The upper bound of the filter when lo is not a string.

See also

ignore_id()
Exclude data from the fit for a data set.
sherpa.astro.ui.ignore2d()
Exclude a spatial region from an image.
notice()
Include data in the fit.
show_filter()
Show any filters applied to a data set.

Notes

The order of ignore and notice calls is important, and the results are a union, rather than intersection, of the combination.

For binned data sets, the bin is excluded if the ignored range falls anywhere within the bin.

The units used depend on the analysis setting of the data set, if appropriate.

To filter a 2D data set by a shape use ignore2d.

Examples

Ignore all data points with an X value (the independent axis) between 12 and 18. For this one-dimensional data set, this means that the second bin is ignored:

>>> load_arrays(1, [10,15,20,30], [5,10,7,13])
>>> ignore(12, 18)
>>> get_dep(filter=True)
array([ 5,  7, 13])

Filtering X values that are 25 or larger means that the last point is also ignored:

>>> ignore(25, None)
>>> get_dep(filter=True)
array([ 5,  7])

The notice call removes the previous filter, and then a multi-range filter is applied to exclude values between 8 and 12 and 18 and 22:

>>> notice()
>>> ignore("8:12,18:22")
>>> get_dep(filter=True)
array([10, 13])