Last modified: December 2013

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.11 Sherpa v1


Context: filtering


Apply an include filter to 1D data by dataset id


notice_id( ids, [lo,hi,bkg_id] )
notice_id( ids, expr, bkg_id )


The notice_id command specifies the portion of 1D data to be included in the analysis. The filter is applied to the specified dataset IDs; to operate on all datasets without having to list the IDs, use the notice command ("ahelp notice").

When a filter is applied to a source data set, it is also automatically applied to all associated background data sets. A different filter for a background can still be imposed afterward, using the bkg_id parameter to filter just the background.

The units for the limits are determined by the "units" field of the data structure: channels, energy (keV), or wavelength (angstrom). The value can be obtained by using the get_analysis command ("ahelp get_analysis").

If no limits are supplied, all data points in the specified datasets are included. Noticing the entire set is a method of clearing any filters that have been applied. It is also possible to specify just a lower limit or just an upper limit; the unspecified value will remain at the data minimum or maximum.

If the data is binned (or grouped) and the endpoint of the interval falls within a bin (group), the entire bin (group) is included in the filter. Note that the bin (group) with the last channel which has the energy included in the filter will be noticed.

Two-dimensional Data Filtering

To apply an include filter to 2D data, use the notice2d command ("ahelp notice2d") or the notice2d_id command ("ahelp notice2d_id").


Example 1

sherpa> set_analysis(1, "channel")
sherpa> notice_id(1, 100, 500, bkg_id=2)

Ignore all data points below channel 100 and above channel 500 in the second background dataset associated with source dataset 1. Note that for default PHA type analysis with supplied RMF/ARF files, set_analysis needs to be issued before the notice_id in channel space. By default the PHA type analysis are set to energy.

Example 2

sherpa> notice_id([1,2])

The command is called without any limits defined, so all data points in datasets 1 and 2 are included.

Example 3

sherpa> notice_id("src", 1.0, 6.0)

Include only data in the 1.0-6.0 keV range in the dataset labeled "src".

Example 4

sherpa> notice_id(2, "0.1:5, 6:7")

Notice the bins in dataset 2 between 0.1 and 5 keV and between 6 and 7 keV.

Example 5

sherpa> set_analysis("channel")
sherpa> notice_id(2, 200, None)

or the equivalent expression:

sherpa> notice_id(2, "200:")

The lower-limit of the filter is set at channel 200, but the upper-limit is undefined so that all data above channel 200 is included in the analysis. Note that the two notice_id expressions are equivalent here and result in the same range of data to be included in the analysis.

Example 6

sherpa> ignore_id([2,4])
sherpa> notice_id([2,4], None, 8.0)
sherpa> show_filter()
Data Set Filter: 1
0.0080-14.9431 Energy (keV)

Data Set Filter: 2
0.0080-7.9935 Energy (keV)

Data Set Filter: 3
0.0080-14.9431 Energy (keV)

Data Set Filter: 4
0.0080-7.9935 Energy (keV)

In order to apply the notice_id filter, ignore_id/ignore may have to be used to clear the previous filter setting. In this example the filter will be applied to data set ids 2 and 4 resulting in all the data below below 8.0 keV to be included in the analysis. show_filter() shows the energy ranges that will be used in the analysis.


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

See Also

get_filter, ignore, ignore2d, ignore2d_id, ignore_bad, ignore_id, notice, notice2d, notice2d_id, show_filter