sherpa.ui.load_filter(id, filename=None, ignore=False, ncols=2, *args, **kwargs)

Load the filter array from an ASCII file and add to a data set.

  • id (int or str, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by get_default_id.

  • filename (str) – The name of the ASCII file that contains the filter information.

  • ignore (bool, optional) – If False (the default) then include bins with a non-zero filter value, otherwise exclude these bins.

  • colkeys (array of str, optional) – An array of the column name to read in. The default is None.

  • sep (str, optional) – The separator character. The default is ' '.

  • comment (str, optional) – The comment character. The default is '#'.

See also


Return the filter expression for a data set.


Exclude data from the fit.


Include data in the fit.


Save the filter array to a file.


Set the filter array of a data set.


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 filename parameter. If given two un-named arguments, then they are interpreted as the id and filename parameters, respectively. The remaining parameters are expected to be given as named arguments.

See unpack_data for a description of the supported file format.


Read in the first column of the file and apply it to the default data set:

>>> load_filter('filt.dat')

Select the FILTER column of the file:

>>> load_filter(2, 'filt.dat', colkeys=['FILTER'])