Apply an include filter to all 1D datasets
notice( [lo,hi] ) notice( expr )
The notice command specifies the portion of 1D data to be included in the analysis. The filter is applied to all available dataset IDs; to operate on specific IDs, use the notice_id command ("ahelp notice_id").
- 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" excludes 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 all 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
When the command is called without any arguments, all data points in all sets are included.
sherpa> notice(1.0, 6.0) sherpa> show_filter() Data Set Filter: 1 1.0001-5.9933 Energy (keV)
Apply a filter to notice the range 1.0-6.0 keV in all datasets. show_filter() displays the noticed energy range.
sherpa> group_counts(30) sherpa> notice(1.0, 6.0) sherpa> show_filter() Data Set Filter: 1 1.0001-6.4240 Energy (keV)
Note that for grouped data, the edge group with the channels corresponding to the energies within the filter is included. This results in a broader energy range. Use show_filter() to see the effect of grouping on noticed energy range.
sherpa> set_analysis("channel") sherpa> notice(10, None) or the equivalent expression: sherpa> notice("10:")
For PHA type data with supplied RMF/ARF, the default analysis is set to energy and set_analysis() needs to be used in order to define the filter in channel-space. The lower-limit of the filter is set to 10 channels, but the upper-limit is undefined. Note that the two notice() expressions are equivalent here and result in the same range of data to be included in the analysis.
sherpa> notice("0.1:5, 6:7")
Notice the data between 0.1 and 5 keV and between 6 and 7 keV.
sherpa> ignore() sherpa> notice(None, 8.0) or the equivalent expression: sherpa> notice(":8.0")
In order to notice the energy filter, ignore() has to be set before applying the new filters. Note that if the filter is applied for the first time in the session, then ignore() is not necessary. The lower-limit of the filter is undefined and the upper-limit is set to 8.0 keV. Also note that the two expressions are equivalent and result in the same filter.
sherpa> notice() sherpa> notice(1., 10.0) sherpa> show_filter() Data Set Filter: 1 1.0001-9.9937 Energy (keV) sherpa> notice(3, 7. ) sherpa> show_filter() Data Set Filter: 1 1.0001-9.9937 Energy (keV) sherpa> ignore() sherpa> notice(3,7) sherpa> show_filter() Data Set Filter: 1 3.0003-7.0007 Energy (keV)
Multiple uses of notice() will result in the broadest energy range, set initially by the valid filter. In this case the final notice does not affect the filtered energy range. In order for the last notice to take an effect, ignore() needs to be issued beforehand.
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.