load_filter

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.

Parameters:
  • 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

get_filter()
Return the filter expression for a data set.
ignore()
Exclude data from the fit.
notice()
Include data in the fit.
save_filter()
Save the filter array to a file.
set_filter()
Set the filter array of a data set.

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 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.

Examples

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'])