Synopsis
Return the X-Spec abundance setting or elemental abundance.
Syntax
get_xsabund(element: str | None = None) Returns: str | float
Examples
Example 1
Return the current abundance setting, which in this case is 'angr', the default value for X-Spec:
>>> get_xsabund() 'angr'
Example 2
Return the abundance of Helium:
>>> get_xsabund('He')
0.09769999980926514Example 3
The `set_xsabund` function has been used to read in the abundances from a file, so the routine now returns the string 'file':
>>> set_xsabund('abund.dat')
>>> get_xsabund()
'file'Example 4
Use the Lodders 2003 abundances but replace the Oxygen abundance value with 0. In this case the abundance table is labelled as 'file':
>>> set_xsabund("lodd")
>>> get_xsabund()
'lodd'
>>> tbl = get_xsabundances()
>>> tbl['O'] = 0
>>> set_xsabundances(tbl)
>>> get_xsabund()
'file'PARAMETERS
The parameter for this function is:
| Parameter | Type information | Definition |
|---|---|---|
| element | str or None, optional | When not given, the abundance table name is returned. If a string, then it must be an element name from: 'H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn'. Case is important. |
Return value
The return value from this function is:
val -- When `element` is `None` , the abundance table name is returned (see `set_xsabund` ); the string 'file' is used when the abundances were read from a file or vector. A numeric value is returned when an element name is given. This value is the elemental abundance relative to H.
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
- info
- show_xsabund
- modeling
- get_xsabundances, set_xsabund, set_xsabundances