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.
- ids - a list of ids of the data sets to filter; default=None
- bkg_id - background data set ID, to apply a separate filter to associated background data (when left blank, the background will be filtered automatically according to the specified source filter; see 'id' description above)
- lo: lower bound of the filter; default=None
- hi: upper bound of the filter; default=None
- expr: a filter expression to notice an intersection of filters, e.g. "0.1:5, 6:7". Range filtering allows for an open-ended range of values, so that ":2" includes the data up to, or ":2" beginning at the given value (2 here), respectively.
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
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.
The command is called without any limits defined, so all data points in datasets 1 and 2 are included.
sherpa> notice_id("src", 1.0, 6.0)
Include only data in the 1.0-6.0 keV range in the dataset labeled "src".
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.
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.
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.