get_xsabund
- sherpa.astro.xspec.get_xsabund(element: str | None = None) str | float [source] [edit on github]
Return the X-Spec abundance setting or elemental abundance.
- Parameters:
element (str, 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.
- Returns:
val – When
element
isNone
, the abundance table name is returned (seeset_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.- Return type:
See also
Examples
Return the current abundance setting, which in this case is ‘angr’, the default value for X-Spec:
>>> get_xsabund() 'angr'
Return the abundance of Helium:
>>> get_xsabund('He') 0.09769999980926514
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'