Last modified: December 2025

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/get_xsxset.html
AHELP for CIAO 4.18 Sherpa

get_xsxset

Context: modeling

Synopsis

Return the X-Spec model setting or settings.

Syntax

get_xsxset(name: str | None = None)

Returns: str | dict[str, str]

Description


Examples

Example 1

>>> set_xsxset("POW_EMIN", "0.5")
>>> get_xsxset("pow_emin")
'0.5'

Example 2

>>> get_xsxset()
{'POW_EMIN': '0.5'}

PARAMETERS

The parameter for this function is:

Parameter Type information Definition
name str or None, optional The name of the setting (converted to upper case before being sent to X-Spec). There is no check that the name is valid.

Return value

The return value from this function is:

val -- When name is set, returns the value set by a previous call to `set_xsxset` . When name is not set a dictionary of all the settings is returned.

Notes

Due to the way X-Spec model settings work, `get_xsxset` will only return a value if it has previously been set with a call to `set_xsxset` . There is no way to retrieve the default value of a setting.

Changes in CIAO

Changed in CIAO 4.18

This routine can now be called with no argument, which means that a dictionary containing all the settings is returned. Asking for an unset keyword now raises a KeyError rather than returning the empty string.

XSPEC version

CIAO 4.18 comes with support for version 12.14.0k of the XSPEC models. This can be checked with the following:

% python -c 'from sherpa.astro import xspec;
print(xspec.get_xsversion())'
12.14.0k

Bugs

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

See Also

modeling
set_xsxset