    Load the statistical errors from a file.

load_staterror(id, filename=None, bkg_id=None, *args, **kwargs)
id - int or str, optional
filename - str
bkg_id - int or str, optional
colkeys - array of str, optional
sep - str, optional
comment - str, optional

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 .

Read in the first column from 'tbl.dat':

>>> load_staterror('tbl.dat')

Use the column labelled 'col3'

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

When using the Crates I/O library, the file name can include CIAO Data Model syntax, such as column selection:

>>> load_staterror('tbl.dat[cols col3]')

Read in the first column from the file 'errors.fits' as the statistical errors for the 'core' data set:

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

The data set labelled 'img' is loaded from the file 'image.fits' and the statistical errors from 'err.fits'. The dimensions of the two images must be the same.

>>> load_image('img', 'image.fits') >>> load_staterror('img', 'err.fits')

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The identifier for the data set to use. If not given then the default identifier is used, as returned by

`get_default_id` .
filename
The name of the file to read in. Supported formats depends on the I/O library in use (Crates or AstroPy) and the type of data set (e.g. 1D or 2D).
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.
colkeys
An array of the column name to read in. The default is

none .
sep
The separator character. The default is ' ' .
comment
The comment character. The default is '#' .

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 the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023