The sherpa.astro.xspec module

Support for XSPEC models.

Sherpa supports versions 12.10.1, 12.10.0, 12.9.1, and 12.9.0 of XSPEC [1], and can be built against the model library or the full application. There is no guarantee of support for older or newer versions of XSPEC.

To be able to use most routines from this module, the HEADAS environment variable must be set. The get_xsversion function can be used to return the XSPEC version - including patch level - the module is using:

>>> from sherpa.astro import xspec
>>> xspec.get_xsversion()
'12.10.1b'

Initializing XSPEC

The XSPEC model library is initalized so that the cosmology parameters are set to H_0=70, q_0=0.0, and lambda_0=0.73 (they can be changed with set_xscosmo).

The other settings - for example for the abundance and cross-section tables - follow the standard rules for XSPEC. For XSPEC versions prior to 12.10.1, this means that the abundance table uses the angr setting and the cross sections the bcmc setting (see set_xsabund and set_xsxsect for full details). As of XSPEC 12.10.1, the values are now taken from the user’s XSPEC configuration file - either ~/.xspec/Xspec.init or $HEADAS/../spectral/manager/Xspec.init - for these settings. The default value for the photo-ionization table in this case is now vern rather than bcmc.

References

[1]https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/index.html

This document describes the base classes for XSPEC models, and the utility routines - such as querying and retrieving the abundance table information. The models provided by XSPEC are described in The sherpa.astro.xspec module.

Classes

XSModel(name[, pars]) The base class for XSPEC models.
XSAdditiveModel(name[, pars]) The base class for XSPEC additive models.
XSMultiplicativeModel(name[, pars]) The base class for XSPEC multiplicative models.
XSTableModel(filename[, name, parnames, …]) Interface to XSPEC table models.

Functions

get_xsabund([element]) Return the X-Spec abundance setting or elemental abundance.
get_xschatter() Return the chatter level used by X-Spec.
get_xscosmo() Return the X-Spec cosmology settings.
get_xspath_manager() Return the path to the files describing the XSPEC models.
get_xspath_model() Return the path to the model data files.
get_xsstate() Return the state of the XSPEC module.
get_xsversion() Return the version of the X-Spec model library in use.
get_xsxsect() Return the cross sections used by X-Spec models.
get_xsxset(name) Return the X-Spec model setting.
read_xstable_model(modelname, filename) Create a XSPEC table model.
set_xsabund(abundance) Set the elemental abundances used by X-Spec models.
set_xschatter(level) Set the chatter level used by X-Spec.
set_xscosmo(h0, q0, l0) Set the cosmological parameters used by X-Spec models.
set_xspath_manager(path) Set the path to the files describing the XSPEC models.
set_xsstate(state) Restore the state of the XSPEC module.
set_xsxsect(name) Set the cross sections used by X-Spec models.
set_xsxset(name, value) Set a X-Spec model setting.

Class Inheritance Diagram

Inheritance diagram of XSModel, XSAdditiveModel, XSMultiplicativeModel, XSTableModel