Module functions to get the filter arrays associated with source and background datasets.
Array_Type get_filter([Integer_Type])
Array_Type get_bfilter([Integer_Type])
Error Return Value: NULL
Arguments:
(1) data set number (default 1)
The function get_filter() returns an array of type
Short_Type that is the same size as the input data set (i.e.,
the unfiltered data set). The array features two values: 0 for bins
outside the currently defined filter, and 1 for bins within the filter.
This function may be used in combination with set_filter to
define new methods of data filtering that go beyond those
currently coded in Sherpa; e.g., filtering based on
data amplitude. (The function get_bfilter() returns
the filter associated with the background data set.)
Source and background data filters
may be displayed, e.g., via the
Sherpa plotting commands
LPLOT FILTER
and
LPLOT BFILTER.
sherpa> data example.dat # 100 bins, mean amplitude 60
sherpa> foo = get_data()
sherpa> bar = get_filter()
sherpa> bar[where(foo>60)] = 0 # filter out all bins with data > 60
sherpa> () = set_filter(1,bar)
sherpa> write data
Write X-Axis: Bin Y-Axis: Flux (Counts)
1 59
2 46
3 49
5 60
6 60
8 58
sherpa> data foo.pha
sherpa> ignore bad
sherpa> notice energy 4:9
sherpa> bar = get_filter_expr()
sherpa> printarr(bar)
ignore source 1 bad
notice source 1 energy 4 : 9
- chandra
-
guide
- sherpa
-
get_analysis,
get_arf_axes,
get_axes,
get_coord,
get_data,
get_energy_axes,
get_errors,
get_filter_expr,
get_fit,
get_fluxed_spectrum,
get_ftest,
get_metadata,
get_photon_axes,
get_photon_energy_axes,
get_photon_wave_axes,
get_qvalue,
get_raw_axes,
get_record,
get_source,
get_statistic,
get_stats,
get_syserrors,
get_wave_axes,
get_weights,
record,
save,
write
|