set_filter
- sherpa.ui.set_filter(id, val=None, ignore=False) None
Set the filter array of a data set.
- Parameters:
id (int or str, optional) – The data set to use. If not given then the default identifier is used, as returned by
get_default_id.val (array) – The array of filter values (
0or1). The size should match the array returned byget_dep.ignore (bool, optional) – If
False(the default) then include bins with a non-zero filter value, otherwise exclude these bins.
See also
get_depReturn the dependent axis of a data set.
get_filterReturn the filter expression for a data set.
ignoreExclude data from the fit.
load_filterLoad the filter array from a file and add to a data set.
noticeInclude data in the fit.
save_filterSave the filter array to a file.
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
valparameter. If given two un-named arguments, then they are interpreted as theidandvalparameters, respectively.Examples
Ignore those bins with a value less 20.
>>> d = get_dep() >>> set_filter(d >= 20)