    Return the filter expression for a data set.

get_filter(id=None)
id - int or str, optional

This returns the filter expression, created by one or more calls to `ignore` and `notice` , for the data set.

The default filter is the full dataset, given in the format

lowval:hival (for a `Data1D` dataset like this these are inclusive limits):

>>> load_arrays(1, [10, 15, 20, 25], [5, 7, 4, 2]) >>> get_filter() '10.0000:25.0000'

The `notice` call restricts the data to the range between 14 and 30. The resulting filter is the combination of this range and the data:

>>> notice(14, 30) >>> get_filter() '15.0000:25.0000'

Ignoring the point at x=20 means that only the points at

x=15 and x=25 remain, so a comma-separated list is used:

>>> ignore(19, 22) >>> get_filter() '15.0000,25.0000'

The filter equivalent to the per-bin array of filter values:

>>> set_filter([1, 1, 0, 1]) >>> get_filter() '10.0000:15.0000,25.0000'

For an integrated data set (Data1DInt and DataPHA with energy or wavelength units)

>>> load_arrays(1, [10, 15, 20, 25], [15, 20, 23, 30], [5, 7, 4, 2], Data1DInt) >>> get_filter() '10.0000:30.0000'

For integrated datasets the limits are now inclusive only for the lower limit, but in this the end-point ends within a bin so is is included:

>>> notice(17, 28) >>> get_filter() '15.0000:30.0000'

There is no data in the range 23 to 24 so the ignore doesn't change anything:

>>> ignore(23, 24) >>> get_filter() '15.0000:30.0000'

However it does match the range 22 to 23 and so changes the filter:

>>> ignore(22, 23) >>> get_filter() '15.0000:20.0000,25:000:30.0000'

Return the filter for data set 3:

>>> get_filter(3)

PARAMETERS

The parameter for this function is:

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` .

The return value from this function is:

filter -- The empty string or a string expression representing the filter used. For PHA data dets the units are controlled by the analysis setting for the data set.

Changes in CIAO

The filter expressions have been tweaked for Data1DInt and PHA data sets (when using energy or wavelength units) and now describe the full range of the bins, rather than the mid-points.

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

December 2023