    Create a PHA data structure for a background data set.

unpack_bkg(arg, use_errors=False)
use_errors - bool, optional

Any instrument information referenced in the header of the PHA file - e.g. with the ANCRFILE and RESPFILE, keywords - will also be loaded. Unlike `unpack_pha` , background files will not be loaded.

>>> pha1 = unpack_arf("src1.pi") >>> pha2 = unpack_bkg("field.pi") >>> set_data(1, pha1) >>> set_bkg(1, pha2)

Read in a PHA file using Crates:

>>> cr = pycrates.read_file("bg.fits") >>> pha = unpack_pha(cr)

Read in a PHA file using AstroPy:

>>> hdus = astropy.io.fits.open("bg.fits") >>> pha = unpack_pha(hdus)

PARAMETERS

The parameters for this function are:

Parameter
Definition
arg
Identify the PHA file: a file name, or a data structure representing the data to use, as used by the I/O backend in use by Sherpa: a tablecrate for crates, as used by CIAO, or a list of AstroPy HDU objects.
use_errors
If True then the statistical errors are taken from the input data, rather than calculated by Sherpa from the count values. The default is False .

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023