- sherpa.astro.ui.load_quality(id, filename=None, bkg_id=None, *args, **kwargs)¶
Load the quality array from a file and add to a PHA data set.
This function sets the quality column but does not automatically ignore any columns marked as “bad”. Use the
ignore_badfunction to apply the new quality information.
filename (str) – The name of the file that contains the quality information. This file can be a FITS table or an ASCII file. Selection of the relevant column depends on the I/O library in use (Crates or AstroPy).
colkeys (array of str, optional) – An array of the column name to read in. The default is
sep (str, optional) – The separator character. The default is
comment (str, optional) – The comment character. The default is
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
filenameparameter. If given two un-named arguments, then they are interpreted as the
filenameparameters, respectively. The remaining parameters are expected to be given as named arguments.
There is no check made to see if the quality array contains valid data.
When using Crates as the I/O library, select the quality column from the file ‘src.pi’, and use it to set the values in the default data set:
>>> load_quality('src.pi[cols quality]')
colkeysoption to define the column in the input file:
>>> load_quality('src.pi', colkeys=['quality'])
Load the first column in ‘grp.dat’ and use it to populate the quality array of the data set called ‘core’.
>>> load_quality('core', 'grp.dat')