load_staterror

sherpa.ui.load_staterror(id, filename=None, ncols=2, *args, **kwargs)

Load the statistical errors from an ASCII file.

Read in a column or image from a file and use the values as the statistical errors for a data set. This over rides the errors calculated by any statistic, such as chi2gehrels or chi2datavar.

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 to read in.
  • ncols (int, optional) – The number of columns to read in (the first ncols columns in the file).
  • 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_staterror()
Return the statistical error on the dependent axis of a data set.
load_syserror()
Load the systematic errors from a file.
set_staterror()
Set the statistical errors on the dependent axis of a data set.
set_stat()
Set the statistical method.

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 from ‘tbl.dat’:

>>> load_staterror('tbl.dat')

Use the column labelled ‘col3’

>>> load_staterror('tbl.dat', colkeys=['col3'])

Read in the first column from the file ‘errors.dat’ as the statistical errors for the ‘core’ data set:

>>> load_staterror('core', 'errors.dat')