Last modified: December 2020

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_filter.html
Jump to: · Example · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.13 Sherpa v1

set_filter

Context: filtering

Synopsis

Set the filter array of a data set.

Syntax

set_filter(id, val=None, bkg_id=None, ignore=False)

id - int or str, optional
val - array
bkg_id - int or str, optional
ignore - bool, optional

Example

Ignore those bins with a value less 20.

>>> d = get_dep()
>>> set_filter(d >= 20)

PARAMETERS

The parameters for this function are:

Parameter Definition
id The data set to use. If not given then the default identifier is used, as returned by `get_default_id` .
val The array of filter values ( 0 or 1 ). The size should match the array returned by `get_dep` .
bkg_id Set to identify which background component to set. The default value ( none ) means that this is for the source component of the data set.
ignore If False (the default) then include bins with a non-zero filter value, otherwise exclude these bins.

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `val` parameter. If given two un-named arguments, then they are interpreted as the `id` and `val` parameters, respectively.


Bugs

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

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
copy_data, dataspace1d, dataspace2d, datastack, delete_data, fake, get_axes, get_bkg_chisqr_plot, get_bkg_delchi_plot, get_bkg_fit_plot, get_bkg_model_plot, get_bkg_plot, get_bkg_ratio_plot, get_bkg_resid_plot, get_bkg_source_plot, get_counts, get_data, get_data_contour, get_data_contour_prefs, get_data_image, get_data_plot, get_data_plot_prefs, get_dep, get_dims, get_error, get_quality, get_specresp, get_staterror, get_syserror, group, group_adapt, group_adapt_snr, group_bins, group_counts, group_snr, group_width, load_ascii, load_data, load_grouping, load_quality, set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror, ungroup, unpack_ascii, unpack_data
filtering
get_filter, load_filter
info
get_default_id, list_data_ids, list_response_ids
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
clean, get_par, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
plotting
plot_data, set_xlinear, set_xlog, set_ylinear, set_ylog
saving
save_error, save_filter, save_grouping, save_quality, save_staterror, save_syserror
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
calc_data_sum, calc_data_sum2d, calc_ftest, calc_kcorr, calc_mlr, calc_model_sum2d, calc_source_sum2d, get_rate, set_analysis, set_default_id
visualization
contour, contour_data, contour_ratio, histogram1d, histogram2d, image_data, image_setregion, rebin