Source code for sherpa.astro.xspec

#
#  Copyright (C) 2010, 2015 - 2024
#  Smithsonian Astrophysical Observatory
#
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

"""Support for XSPEC models.

Sherpa supports versions 12.14.0, 12.13.1, 12.13.0, 12.12.1, and
12.12.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.14.0b'

Initializing XSPEC
------------------

The XSPEC model library is initialized 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. This means that the
values are taken from the user's XSPEC configuration file - either
``~/.xspec/Xspec.init`` or ``$HEADAS/../spectral/manager/Xspec.init``
- for these settings (in particular note that the default value for
the photo-ionization table is 'vern' rather than 'bcmc' which used to
be the case in XSPEC 12.10.0 and earlier).

The default chatter setting - used by models to inform users of
issues - was set to 0 (which hid the messages) until Sherpa 4.14.0,
when it was changed to 10 (to match XSPEC).

Supported models
----------------

The additive [2]_, multiplicative [3]_, and convolution [4]_ models
from the XSPEC model library are supported, except for the `polconst`,
`pollin`, `polpow`, and `smaug` models [5]_, since they need
information obtained from the XFLT keywords in the PHA file.

XSPEC version
-------------

The intention is to keep the model parameters up to date with the
highest-supported version of XSPEC. However, there is no way to
know from the XSPEC API [6]_ whether these parameter values will
work correctly with the installed XSPEC version, such as when using
an older version of XSPEC.

Parameter values
----------------

XSPEC parameters have soft and hard limits but they are different
to the Sherpa meaning:

- the XSPEC hard limit is more-like a Sherpa parameter with the
  same soft and hard limits;

- and it is possible to change the hard limits.

To support these, XSPEC models use the `XSBaseParameter` and
`XSParameter` classes, while the "norm" parameter added to additive
models remains a `sherpa.models.parameter.Parameter` instance.

References
----------

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

.. [2] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/Additive.html

.. [3] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/Multiplicative.html

.. [4] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/Convolution.html

.. [5] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/XSmodelSmaug.html

.. [6] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSappendixLocal.html

"""


import logging
import string
from typing import Any, Optional, Union
import warnings

import numpy as np

from sherpa.astro.utils import get_xspec_position
from sherpa.models import ArithmeticModel, ArithmeticFunctionModel, \
    CompositeModel, Parameter, modelCacher1d, RegriddableModel1D
from sherpa.models.parameter import hugeval
from sherpa.utils import guess_amplitude, param_apply_limits, bool_cast
from sherpa.utils.err import IOErr, ParameterErr
from sherpa.utils.numeric_types import SherpaFloat

# Note that utils also imports _xspec so it will error out if it is
# not available.
#
from .utils import ModelMeta, version_at_least, equal_or_greater_than
from . import _xspec  # type: ignore


info = logging.getLogger(__name__).info
warning = logging.getLogger(__name__).warning

# Python wrappers around the exported functions from _xspec. This
# provides a more-accurate function signature to the user, makes
# the documentation easier to write, and makes it available even
# when the compiled code has not been compiled (e.g. for a Sphinx
# documentation run).
#
[docs] def get_xsabund(element: Optional[str] = None) -> Union[str, float]: """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 : str or float 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. A numeric value is returned when an element name is given. This value is the elemental abundance relative to H. See Also -------- set_xsabund Examples -------- Return the current abundance setting, which in this case is 'angr', the default value for X-Spec: >>> get_xsabund() 'angr' 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' >>> get_xsabund('He') 0.09769999980926514 """ if element is None: return _xspec.get_xsabund() return _xspec.get_xsabund(element)
[docs] def get_xschatter() -> int: """Return the chatter level used by X-Spec. Returns ------- chatter : int The chatter setting used by the X-Spec routines. See Also -------- set_xschatter Examples -------- >>> get_xschatter() 10 """ return _xspec.get_xschatter()
[docs] def get_xscosmo() -> tuple[float, float, float]: """Return the X-Spec cosmology settings. Returns ------- (h0, q0, l0) The Hubble constant, in km/s/Mpc, the deceleration parameter, and the cosmological constant. See Also -------- set_xscosmo Examples -------- >>> get_xscosmo() (70.0, 0.0, 0.7300000190734863) """ return _xspec.get_xscosmo()
[docs] def get_xsversion() -> str: """Return the version of the X-Spec model library in use. Returns ------- version : str The version of the X-Spec model library used by Sherpa [1]_. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/ Examples -------- >>> get_xsversion() '12.11.0m' """ return _xspec.get_xsversion()
[docs] def get_xsxsect() -> str: """Return the cross sections used by X-Spec models. Returns ------- val : str The value of the photoelectric absorption setting: one of 'bcmc', 'obcm', and 'vern'. See Also -------- set_xsxsect Examples -------- >>> get_xsxsect() 'bcmc' """ return _xspec.get_xsxsect()
[docs] def set_xsabund(abundance: str) -> None: """Set the elemental abundances used by X-Spec models. Set the abundance table used in the X-Spec plasma emission and photoelectric absorption models. It is equivalent to the X-Spec ``abund`` command [1]_. Parameters ---------- abundance : str A file name, format described below, or one of the pre-defined names listed in the Notes section below. See Also -------- get_xsabund, get_xsversion, set_xschatter Notes ----- The pre-defined abundance tables are: - 'angr', from [2]_ - 'aspl', from [3]_ - 'feld', from [4]_, except for elements not listed which are given 'grsa' abundances - 'aneb', from [5]_ - 'grsa', from [6]_ - 'wilm', from [7]_, except for elements not listed which are given zero abundance - 'lodd', from [8]_ - 'lpgp', from [9]_ (photospheric) - 'lpgs', from [9]_ (proto-solar) The values for these tables are given at [1]_. Data files should be in ASCII format, containing a single numeric (floating-point) column of the abundance values, relative to Hydrogen. The screen output of this function is controlled by the X-Spec chatter setting (`set_xschatter`). References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSabund.html Note that this may refer to a newer version than the compiled version used by Sherpa; use `get_xsversion` to check. .. [2] Anders E. & Grevesse N. (1989, Geochimica et Cosmochimica Acta 53, 197) https://adsabs.harvard.edu/abs/1989GeCoA..53..197A .. [3] Asplund M., Grevesse N., Sauval A.J. & Scott P. (2009, ARAA, 47, 481) https://adsabs.harvard.edu/abs/2009ARA%26A..47..481A .. [4] Feldman U.(1992, Physica Scripta 46, 202) https://adsabs.harvard.edu/abs/1992PhyS...46..202F .. [5] Anders E. & Ebihara (1982, Geochimica et Cosmochimica Acta 46, 2363) https://adsabs.harvard.edu/abs/1982GeCoA..46.2363A .. [6] Grevesse, N. & Sauval, A.J. (1998, Space Science Reviews 85, 161) https://adsabs.harvard.edu/abs/1998SSRv...85..161G .. [7] Wilms, Allen & McCray (2000, ApJ 542, 914) https://adsabs.harvard.edu/abs/2000ApJ...542..914W .. [8] Lodders, K (2003, ApJ 591, 1220) https://adsabs.harvard.edu/abs/2003ApJ...591.1220L .. [9] Lodders K., Palme H., Gail H.P., Landolt-Börnstein, New Series, vol VI/4B, pp 560–630 (2009) https://ui.adsabs.harvard.edu/abs/2009LanB...4B..712L/abstract Examples -------- >>> set_xsabund('lodd') Solar Abundance Vector set to lodd: Lodders, K. ApJ 591, 1220 (2003) >>> set_xsabund('abund.dat') Solar Abundance Vector set to file: User defined abundance vector / no description specified """ _xspec.set_xsabund(abundance)
[docs] def set_xschatter(level: int) -> None: """Set the chatter level used by X-Spec. Set the chatter setting used by the X-Spec routines for determining what information gets printed to the screen. It is equivalent to the X-Spec ``chatter`` command [1]_. .. versionchanged:: 4.14.0 The default chatter setting has been bumped from 0 to 10 to match XSPEC. Users will see extra screen output the first time some XSPEC models are evaluated. Parameters ---------- level : int The higher the value of ``level``, the more screen output will be created by X-Spec routines. A value of ``0`` hides most information while ``25`` will generate a lot of debug output. The starting value is ``10``. See Also -------- get_xschatter, get_xsversion Notes ----- There is no way to change the X-Spec "log chatter" setting. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSchatter.html Note that this may refer to a newer version than the compiled version used by Sherpa; use `get_xsversion` to check. Examples -------- Set the chatter level to hide most, if not all, output from X-Spec models: >>> set_xschatter(0) """ _xspec.set_xschatter(level)
[docs] def set_xscosmo(h0: float, q0: float, l0: float) -> None: """Set the cosmological parameters used by X-Spec models. Set the cosmological parameters (H_0, q_0, lambda_0) used by X-Spec. It is equivalent to the X-Spec ``cosmo`` command [1]_. The default values are h0=70, q0=0, and l0=0.73 Parameters ---------- h0 : number The Hubble constant in km/s/Mpc. q0 : number The deceleration parameter. l0 : number The cosmological constant. If this is non-zero then the q0 parameter is ignored and the Universe is assumed to be flat. See Also -------- get_xscosmo, get_xsversion References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XScosmo.html Note that this may refer to a newer version than the compiled version used by Sherpa; use `get_xsversion` to check. Examples -------- >>> set_xscosmo(73, 0, 0.73) """ _xspec.set_xscosmo(h0, q0, l0)
[docs] def set_xsxsect(name: str) -> None: """Set the cross sections used by X-Spec models. Set the X-Spec photoelectric absorption cross-sections setting, which changes the cross-sections used by all X-Spec absorption models *except* for `XSwabs`. It is equivalent to the X-Spec ``xsect`` command [1]_. Parameters ---------- name : { 'bcmc', 'obcm', 'vern' } The options are: 'bcmc' from [2]_ with a new He cross-section based on [3]_; 'obcm' which is, the same as 'bcmc', but with the He cross-section from [2]_, or 'vern' [4]_. See Also -------- get_xsversion, get_xsxsect, set_xschatter Notes ----- The screen output of this function is controlled by the X-Spec chatter setting (`set_xschatter`). References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSxsect.html Note that this may refer to a newer version than the compiled version used by Sherpa; use `get_xsversion` to check. .. [2] Balucinska-Church & McCammon (1992; Ap.J.400, 699). https://adsabs.harvard.edu/abs/1992ApJ...400..699B .. [3] Yan, M., Sadeghpour, H. R., Dalgarno, A. 1998, Ap.J. 496, 1044 https://adsabs.harvard.edu/abs/1998ApJ...496.1044Y .. [4] Verner et. al., 1996, Ap.J., 465, 487. https://adsabs.harvard.edu/abs/1996ApJ...465..487V Examples -------- >>> set_xsxsect('vern') Cross Section Table set to vern: Verner, Ferland, Korista, and Yakovlev 1996 """ _xspec.set_xsxsect(name)
# Wrap the XSET function in Python, so that we can keep a record of # the strings the user sent as specific XSPEC model strings (if any) during # the session. Only store if setting was successful. # See: # https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/XSxset.html modelstrings = {} # Store any path changes xspecpaths = {}
[docs] def get_xsxset(name: str) -> str: """Return the X-Spec model setting. Parameters ---------- name : str The name of the setting (converted to upper case before being sent to X-Spec). There is no check that the name is valid. Returns ------- val : str Returns the value set by a previous call to `set_xsxset` or the empty string, if the value has not been previously set. See Also -------- set_xsxset 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. Examples -------- >>> set_xsxset("POW_EMIN", "0.5") >>> get_xsxset("pow_emin") '0.5' """ name = name.upper() return _xspec.get_xsxset(name)
[docs] def set_xsxset(name: str, value: str) -> None: """Set a X-Spec model setting. Set variables used by X-Spec models. It is equivalent to the X-Spec `xset` command [1]_, but only for setting the model database settings. See `set_xsabund`, `set_xscosmo`, and `set_xsxsect` for the other settings. Parameters ---------- name : str The name of the setting. It is converted to upper case before being used. There is no check that the name is valid. value : str The new value of the setting. It must be given as a string. See Also -------- get_xsxset, get_xsversion, set_xsabund, set_xschatter, set_xscosmo, set_xsxsect Notes ----- The available settings are listed at [1]_. Not all the X-Spec model types are supported by Sherpa - for instance X-Spec "mixing models" - so changing some of these settings will make no difference. The X-Spec chatter setting can be increased with `set_xschatter` if it is not clear if a setting is being used. The model settings are stored so that they can be included in the output of `sherpa.astro.ui.save_all`. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSabund.html Note that this may refer to a newer version than the compiled version used by Sherpa; use `get_xsversion` to check. Examples -------- >>> set_xsxset('NEIVERS', '2.0') >>> set_xsxset('NEIAPECROOT', '/data/spectral/modelData/APEC_nei_v11') >>> set_xsxset('POW_EMIN', '0.5') >>> set_xsxset('POW_EMAX', '2.0') """ name = name.upper() _xspec.set_xsxset(name, value) if get_xsxset(name) != "": modelstrings[name] = get_xsxset(name)
[docs] def get_xspath_manager() -> str: """Return the path to the files describing the XSPEC models. Returns ------- path : str The path to the manager directory containing the various model-data files used by XSPEC. See Also -------- get_xspath_model, set_xspath_manager Examples -------- >>> get_xspath_manager() '/usr/local/heasoft-6.22/x86_64-unknown-linux-gnu-libc2.24/../spectral/manager' """ return _xspec.get_xspath_manager()
[docs] def get_xspath_model() -> str: """Return the path to the model data files. Returns ------- path : str The path to the directory containing the files used by the XSPEC models. See Also -------- get_xspath_manager Examples -------- >>> get_xspath_model() '/usr/local/heasoft-6.22/x86_64-unknown-linux-gnu-libc2.24/../spectral/modelData' """ return _xspec.get_xspath_model()
[docs] def set_xspath_manager(path: str) -> None: """Set the path to the files describing the XSPEC models. Parameters ---------- path : str The new path. See Also -------- get_xspath_manager : Return the path to the files describing the XSPEC models. Examples -------- >>> set_xspath_manager('/data/xspec/spectral/manager') """ _xspec.set_xspath_manager(path) spath = get_xspath_manager() if spath != path: raise IOError("Unable to set the XSPEC manager path " f"to '{path}'") xspecpaths['manager'] = path
# Provide XSPEC module state as a dictionary. The "cosmo" state is # a 3-tuple, and "modelstrings" is a dictionary of model strings # applicable to certain models. The abund and xsect settings are # strings. The chatter setting is an integer. Please see the # XSPEC manual concerning the following commands: abund, chatter, # cosmo, xsect, and xset. # https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/Control.html # https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/Setting.html # # The path dictionary contains the manager path, which can be # explicitly set. It could also contain the model path, but there # is no XSPEC routine to change that; instead a user would set the # XSPEC_MDATA_DIR environment variable before starting XSPEC. # Should this path be included? #
[docs] def get_xsstate() -> dict[str, Any]: """Return the state of the XSPEC module. Returns ------- state : dict The current settings for the XSPEC module, including but not limited to: the abundance and cross-section settings, parameters for the cosmological model, any XSET parameters that have been set, and changes to the paths used by the model library. See Also -------- get_xsabund, get_xschatter, get_xscosmo, get_xsxsect, get_xsxset, set_xsstate """ # Do not return the internal dictionary but a copy of it. return {"abund": get_xsabund(), "chatter": get_xschatter(), "cosmo": get_xscosmo(), "xsect": get_xsxsect(), "modelstrings": modelstrings.copy(), "paths": xspecpaths.copy()}
[docs] def set_xsstate(state: dict[str, Any]) -> None: """Restore the state of the XSPEC module. Parameters ---------- state : dict The current settings for the XSPEC module. This is expected to match the return value of ``get_xsstate``, and so uses the keys: 'abund', 'chatter', 'cosmo', 'xsect', 'modelstrings', and 'paths'. See Also -------- get_xsstate, set_xsabund, set_xschatter, set_xscosmo, set_xsxsect, set_xsxset Notes ----- The state of the XSPEC module will only be changed if all the required keys in the dictionary are present. All keys apart from 'paths' are required. """ if type(state) == dict and \ 'abund' in state and \ 'chatter' in state and \ 'cosmo' in state and \ 'xsect' in state and \ 'modelstrings' in state: h0, q0, l0 = state["cosmo"] set_xsabund(state["abund"]) set_xschatter(state["chatter"]) set_xscosmo(h0, q0, l0) set_xsxsect(state["xsect"]) for name in state["modelstrings"].keys(): set_xsxset(name, state["modelstrings"][name]) # This is optional to support re-loading state information # from a version of XSPEC which did not provide the path # information. # try: managerpath = state['paths']['manager'] except KeyError: managerpath = None if managerpath is not None: set_xspath_manager(managerpath)
[docs] def read_xstable_model(modelname, filename, etable=False): """Create a XSPEC table model. XSPEC additive (atable, [1]_), multiplicative (mtable, [2]_), and exponential (etable, [3]_) table models are supported. .. versionchanged:: 4.16.0 Parameters with negative DELTA values are now made frozen, to match XSPEC. Support for models which use the ESCALE keyword has been added. The hard_max and hard_min values of the redshift parameter (for those models that support it) can now be changed. This should be done with care as it could cause memory corruption or a crash. .. versionchanged:: 4.14.0 The etable argument has been added to allow exponential table models to be used. Parameters ---------- modelname : str The identifier for this model component. filename : str The name of the FITS file containing the data, which should match the XSPEC table model definition [4]_. etable : bool, optional Set if this is an etable (as there's no way to determine this from the file itself). Defaults to False. Returns ------- tablemodel : XSTableModel instance Notes ----- There is no support for table models that provide multiple spectra per parameter: that is, those with the NXFLTEXP keyword set. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/XSmodelAtable.html .. [2] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/XSmodelMtable.html .. [3] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/XSmodelMtable.html .. [4] https://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_92_009/ogip_92_009.html Examples -------- Load in the XSPEC table model from the file 'bbrefl_1xsolar.fits' and create a model labelled 'xmdl', which is then returned: >>> mdl = read_xstable_model('xmdl', 'bbrefl_1xsolar.fits') >>> print(mdl) When the file is an etable model the etable parameter must be set: >>> emdl = read_xstable_model('xmdl', 'etable.fits', etable=True) >>> print(emdl) """ # TODO: how to avoid loading this if no backend is available import sherpa.astro.io read_tbl = sherpa.astro.io.backend.get_table_data read_hdr = sherpa.astro.io.backend.get_header_data # Not all keywords are going to be present, so check what are. # blkname = 'PRIMARY' hdr = read_hdr(filename, blockname=blkname, hdrkeys=None) try: hduclas1 = hdr["HDUCLAS1"].upper() except KeyError: raise IOErr("nokeyword", filename, "HDUCLAS1") from None if hduclas1 != 'XSPEC TABLE MODEL': # TODO: change Exception to something more useful raise Exception("Not an XSPEC table model") try: addredshift = bool_cast(hdr["REDSHIFT"]) except KeyError: raise IOErr("nokeyword", filename, "REDSHIFT") from None try: addmodel = bool_cast(hdr["ADDMODEL"]) except KeyError: raise IOErr("nokeyword", filename, "ADDMODEL") from None # ESCALE may not exist in the header, as it is relatively new. # try: addescale = bool_cast(hdr["ESCALE"]) except KeyError: addescale = False # We want to error out if NXFLTEXP is set (and more than 1). If # set to 1 we ignore it. # try: nxfltexp = int(hdr["NXFLTEXP"]) except KeyError: nxfltexp = 1 if nxfltexp > 1: raise IOErr(f"No support for NXFLTEXP={nxfltexp} in {filename}") blkname = 'PARAMETERS' colkeys = ['NAME', 'INITIAL', 'DELTA', 'BOTTOM', 'TOP', 'MINIMUM', 'MAXIMUM'] hdrkeys = ['NINTPARM', 'NADDPARM'] (colnames, cols, name, hdr) = read_tbl(filename, colkeys=colkeys, hdrkeys=hdrkeys, blockname=blkname, fix_type=False) nint = int(hdr["NINTPARM"]) return XSTableModel(filename, modelname, *cols, nint=nint, addmodel=addmodel, addredshift=addredshift, addescale=addescale, etable=etable)
# The model classes are added to __all__ at the end of the file # # Note that not all routines from _xspec are re-exported here. # __all__ : tuple[str, ...] __all__ = ('get_xschatter', 'get_xsabund', 'get_xscosmo', 'get_xsxsect', 'set_xschatter', 'set_xsabund', 'set_xscosmo', 'set_xsxsect', 'get_xsversion', 'set_xsxset', 'get_xsxset', 'set_xsstate', 'get_xsstate')
[docs] class XSBaseParameter(Parameter): """An XSPEC parameter. XSPEC has soft and hard parameter limits, which are the ones sent in as the `min`, `max`, `hard_min`, and `hard_max` parameters. However, Sherpa's soft limits are more-like the XSPEC hard limits, and it is possible in XSPEC to change a model's hard limits. This class therefore: - stores the input `min` and `max` values as the _xspec_soft_min and _xspec_soft_max attributes and the `hard_min` and `hard_max` values as _xspec_hard_min and _xspec_hard_max attributes; - sets the underlying `min` and `max` values to the XSPEC hard limits; - and sets the underlying `hard_min` and `hard_max` values to the XSPEC hard limits. Note that you can not change the hard limits; for that see `XSParameter`. See Also -------- XSParameter Examples -------- >>> p = XSBaseParameter('mod', 'p', 2, min=1, max=9, hard_min=0, hard_max=10) >>> p.min 0.0 >>> p.hard_min 0.0 >>> p.max 10.0 >>> p.hard_max 10.0 >>> p.val = 20 sherpa.utils.err.ParameterErr: parameter mod.p has a maximum of 10 """ def __init__(self, modelname, name, val, min=-hugeval, max=hugeval, hard_min=-hugeval, hard_max=hugeval, units='', frozen=False, alwaysfrozen=False, hidden=False, aliases=None): self._xspec_soft_min = min self._xspec_soft_max = max self._xspec_hard_min = hard_min self._xspec_hard_max = hard_max super().__init__(modelname, name, val, min=hard_min, max=hard_max, hard_min=hard_min, hard_max=hard_max, units=units, frozen=frozen, alwaysfrozen=alwaysfrozen, hidden=hidden, aliases=aliases)
[docs] class XSParameter(XSBaseParameter): """An XSPEC parameter where you exceed the hard limits. This parameter allows a user to change the hard limits (`hard_min` and `hard_max`). XSPEC allows the hard limits to be extended, and this is used in a few models to trigger different behavior (e.g. setting the value negative). The `hard_min_changed` and `hard_max_changed` methods can be used to determine if the limits have been changed. See Also -------- XSBaseParameter Notes ----- Some XSPEC parameter values are documented as changing behavior when the value is outside the XSPEC hard limits from the model.dat file (normally the hard minimum is 0 and setting the parameter negative changes the model in some way). XSPEC allows a user to change the hard limits so we do the same here. Setting the hard limit will also change the corresponding soft limit. Setting a value outside the original hard limits can cause models to fail or even crash the interpreter. These parameters should probably be frozen. Examples -------- >>> p = XSParameter('mod', 'p', 2, min=1, max=9, hard_min=0, hard_max=10) >>> p.frozen False >>> p.min 0.0 >>> p.hard_min 0.0 >>> p.max 10.0 >>> p.hard_max 10.0 >>> p.val = 20 sherpa.utils.err.ParameterErr: parameter mod.p has a maximum of 10 >>> p.max = 30 sherpa.utils.err.ParameterErr: parameter mod.p has a hard maximum of 10 >>> p.hard_max = 30 >>> p.max 30.0 >>> p.hard_max 30.0 >>> p.val = 20 >>> p.frozen False """ def _set_hard_min(self, val): # Ensure we are not selecting a value that doesn't make sense. # val = SherpaFloat(val) if val >= self.max: raise ParameterErr('edge', self.fullname, 'maximum', self.max) # If we have increased the minimum value so that the current # value is now excluded we need to update it. # if self.val < val: self.val = val warning('parameter %s less than new minimum; reset to %s', self.fullname, self.val) # Set both soft and hard limits. We use _min so we don't # trigger any validation of the value (e.g. when the new # minimum is larger than the old minimum). # self._min = val self._hard_min = val hard_min = property(Parameter._get_hard_min, _set_hard_min, doc='The hard minimum of the parameter.\n\n' + 'Unlike normal parameters the `hard_min` value can be changed (and\n' + 'will also change the corresponding `min` value at the same time).\n' + 'This is needed to support the small-number of XSPEC models that\n' + 'use a value outside the default hard range as a way to control the\n' + 'model. Unfortunately some models can crash when using values like\n' + 'this so take care.\n\n' + 'See Also\n' + '--------\n' + 'hard_max\n') def _set_hard_max(self, val): # Ensure we are not selecting a value that doesn't make sense. # val = SherpaFloat(val) if val <= self.min: raise ParameterErr('edge', self.fullname, 'minimum', self.min) # If we have decreased the maximum value so that the current # value is now excluded we need to update it. # if self.val > val: self.val = val warning('parameter %s greater than new maximum; reset to %s', self.fullname, self.val) # Set both soft and hard limits. We use _max so we don't # trigger any validation of the value (e.g. when the new # maximum is smaller than the old maximum). # self._max = val self._hard_max = val hard_max = property(Parameter._get_hard_max, _set_hard_max, doc='The hard maximum of the parameter.\n\n' + 'Unlike normal parameters the `hard_max` value can be changed (and\n' + 'will also change the corresponding `max` value at the same time).\n' + 'This is needed to support the small-number of XSPEC models that\n' + 'use a value outside the default hard range as a way to control the\n' + 'model. Unfortunately some models can crash when using values like\n' + 'this so take care.\n\n' + 'See Also\n' + '--------\n' + 'hard_min\n')
[docs] def set(self, val=None, min=None, max=None, frozen=None, default_val=None, default_min=None, default_max=None, hard_min=None, hard_max=None): """Change a parameter setting. The hard limits can be changed, which will also change the matching soft limit. Note that XSPEC models can cause a crash if sent an un-supported value so use this feature carefully; it is likely that these parameters should also be frozen but this is not enforced. Parameters ---------- val : number or None, optional The new parameter value. min, max : number or None, optional The new parameter range. frozen : bool or None, optional Should the frozen flag be set? default_val : number or None, optional The new default parameter value. default_min, default_max : number or None, optional The new default parameter limits. hard_min, hard_max : number or None, optional Changing the hard limits will also change the matching soft limit (`min` or `max`). """ if hard_min is not None: self.hard_min = hard_min if hard_max is not None: self.hard_max = hard_max super().set(val=val, min=min, max=max, frozen=frozen, default_val=default_val, default_min=default_min, default_max=default_max)
[docs] def hard_min_changed(self): """Has the hard limit (min) been changed from it's default value?""" return self._xspec_hard_min != self.hard_min
[docs] def hard_max_changed(self): """Has the hard limit (max) been changed from it's default value?""" return self._xspec_hard_max != self.hard_max
[docs] class XSModel(RegriddableModel1D, metaclass=ModelMeta): """The base class for XSPEC models. It is expected that sub-classes are used to represent the five different types of XSPEC model (additive, multiplicative, convolution, pile up, mixing, and tables), although not all are currently supported in Sherpa. Notes ----- The XSPEC models are evaluated on a one-dimensional, integrated, contiguous grid. When the `calc` method is called with both low and high bin values, the arrays are converted into a single array matching the XSPEC calling convention - that is elo_0, elo_1, ..., elo_n for n bins (so the last value is the upper edge of the last bin) - adding in any bins to account for a non-contiguous input. This array is used to evaluate the model, and then the return value is created by removing any extra bins that had to be added to account for non-contiguous input values. If used on an unbinned dataset, so only one array is sent to `calc`, then the input values are taken to match the XSPEC calling convention - i.e. a contiguous grid where the last element represents the upper edge of the last bin. This means that for an input grid of ``n`` points, the returned array will contain ``n`` values, but the last element will be zero. """ version_enabled = True def __init__(self, name, pars): # Validate the parameters argument to check that the # names are unique (name insensitive) and members of # the class (i.e. there are attributes with this name). # # This could be done at a higher level of the class structure # but given the support for composite models it can't be # done at the Model layer. It probably makes sense to do this # at the ArithmeticModel layer but this is the place where we # make the most changes and we know these constraints are # correct here so do so here. # # These are development errors so use asserts rather than # raising an error. # seen = set() for par in pars: pname = par.name.lower() # unique names assert pname not in seen, (par.name, name) seen.add(pname) # there's actually an attribute with this name attr = getattr(self, par.name) assert attr.name == par.name, (par.name, name) super().__init__(name, pars)
[docs] @modelCacher1d def calc(self, p, *args, **kwargs): """Calculate the model given the parameters and grid. Notes ----- XSPEC models must always be evaluated with low and high bin edges. Although supported by the XSPEC model interface the ability to evaluate using an XSPEC-style grid (n+1 values for n bins which we pad with a 0), we do not allow this here since it complicates the handling of the regrid method. Keyword arguments are ignored. """ nargs = 1 + len(args) if nargs != 3: emsg = f"calc() requires pars,lo,hi arguments, sent {nargs} arguments" warnings.warn(emsg, FutureWarning) # raise TypeError(emsg) # Ensure output is finite (Keith Arnaud mentioned that XSPEC # does this as a check). This is done at this level (Python) # rather than in the C++ interface since: # - it is easier # - it allows for the user to find out what bins are bad, # by directly calling the _calc function of a model # # If the call raises an error, add the model name and parameter # values (the name is surprisingly tricky to add in the C++ # binding). # try: out = self._calc(p, *args, **kwargs) except ValueError as ve: # Always add the extra information: # - model class # - model name # - parameter list # msg = f"{ve}: {self.type}.{self.name}" for par, val in zip(self.pars, args[0]): msg += f" {par.name}={val}" raise ValueError(msg) from None # This check is being skipped in the 4.8.0 release as it # has had un-intended consequences. It should be re-evaluated # once we have had more experience with the issue. # # if not numpy.isfinite(out).all(): # # TODO: Should this be using a "Sherpa error class"? # # I am not convinced that FloatingPointError is the best # # type. # msg = "model {} has created NaN or +/-Inf value".format( # self.name) # raise FloatingPointError(msg) return out
[docs] class XSTableModel(XSModel): """Interface to XSPEC table models. XSPEC supports loading in user-supplied data files for use as a `table model <https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSappendixLocal.html>`_. This class provides a low-level way to access this functionality. A simpler interface is provided by `read_xstable_model` and `sherpa.astro.ui.load_xstable_model`. .. versionchanged:: 4.16.0 The hard_max and hard_min values of the redshift parameter (for those models that support it) can now be changed. This should be done with care as it could cause memory corruption or a crash. Parameters with negative DELTA values are now made frozen, to match XSPEC. Support for models which use the ESCALE keyword has been added. .. versionchanged:: 4.14.0 The etable argument has been added to allow exponential table models to be used. Parameters ---------- filename : str The name of the FITS file containing the data for the XSPEC table model; the format is described in `Arnaud, Keith A, The File Format for XSPEC Table Models <https://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_92_009/ogip_92_009.html>`_. name : str The name to use for the instance of the table model. parnames : sequence The parameter names. This corresponds to the "NAME" column from the "PARAMETER" block of the input file. Any invalid characters in each name will be replaced by the '_' character. initvals : sequence The initial values for each parameter. This corresponds to the "INITIAL" column from the "PARAMETER" block of the input file. delta : sequence The delta value for each parameter. This corresponds to the "DELTA" column from the "PARAMETER" block of the input file. A negative value marks a parameter as being frozen. mins, maxes, hardmins, hardmaxes : sequence The valid range of each parameter. These correspond to the "BOTTOM", "TOP", "MINIMUM", and "MAXIMUM" columns from the "PARAMETER" block of the input file. nint : int The first ``nint`` parameters are marked as thawed by default, the remaining default to frozen. addmodel : bool Is this an additive model (`True`) or multiplicative model (`False`)? It should be set to the value of the "ADDMODEL" keyword of the primary header of the input file. When False the etable keyword is used to distinguish between mtable and etable models. addredshift : bool If `True` then a redshift parameter is added to the parameters. It should be set to the value of the "REDSHIFT" keyword of the primary header of the input file. addescale : bool If `True` then an Escale parameter is added to the parameters. It should be set to the value of the "ESCALE" keyword of the primary header of the input file. etable : bool When addmodel is False this defines whether the file is a mtable model (`False`, the default) or an etable model (`True`). Notes ----- There is no support for table models that provide multiple spectra per parameter: that is, those with the NXFLTEXP keyword set. """ def __init__(self, filename, name='xstbl', parnames=(), initvals=(), delta=(), mins=(), maxes=(), hardmins=(), hardmaxes=(), nint=0, addmodel=False, addredshift=False, addescale=False, etable=False): # make translation table to turn reserved characters into '_' bad = string.punctuation + string.whitespace tbl = str.maketrans(bad, '_' * len(bad)) pars = [] for ii in range(len(parnames)): isfrozen = True if nint > 0: isfrozen = False # We don't explicitly demand this is a string, so support # byte strings (given that the values are read from the # FITS file this is a possibility). # try: parname = str(parnames[ii], 'utf-8') except TypeError: parname = parnames[ii] # For table models we know you can crash the system if you change # the hard limits, so we use XSBaseParameter rather than # XSParameter. # parname = parname.strip().lower().translate(tbl) par = XSBaseParameter(name, parname, initvals[ii], mins[ii], maxes[ii], hardmins[ii], hardmaxes[ii], frozen=isfrozen) self.__dict__[parname] = par pars.append(par) nint -= 1 # If delta < 0 then the parameter is also frozen. This is # handled separately to the isfrozen check. # if delta[ii] < 0: par.freeze() self.filename = filename self.addmodel = addmodel self.etable = etable # Order should be (z and escale were incorrectly mixed up # in XSPEC 12.13.1 and earlier): # # - Escale # - z # - norm # # (for those models that support the relevant value) # if addescale: # Should this just use Parameter? self.Escale = XSParameter(name, 'Escale', 1, 1e-5, 100, 1e-5, 100, frozen=True) pars.append(self.Escale) if addredshift: # We use XSParameter rather than XSBaseParameter since it # is less likely to cause a crash if the parameter ranges # are set outside the XSPEC defaults of 0 to 5. A user has # been using this feature for a while and it was broken by # switching to XSBaseParameter (see #1814). We use # XSParameter rather than Parameter so we can change the # hard limits if needed. # self.redshift = mkRedshift(name, minval=0, maxval=5, lc=True) pars.append(self.redshift) if addmodel: # Normalization parameters are not true XSPEC parameters and # so we do not need to use XSParameter. # self.norm = mknorm(name) pars.append(self.norm) XSModel.__init__(self, name, pars)
[docs] def fold(self, *args, **kwargs): pass
[docs] @modelCacher1d def calc(self, p, *args, **kwargs): # Note the kwargs is ignored nargs = 1 + len(args) if nargs != 3: emsg = f"calc() requires pars,lo,hi arguments, sent {nargs} arguments" warnings.warn(emsg, FutureWarning) # raise TypeError(emsg) for param, value in zip(self.pars, p): if value < param._hard_min: raise ParameterErr('edge', self.name, 'minimum', param._hard_min) if value > param._hard_max: raise ParameterErr('edge', self.name, 'maximum', param._hard_max) tabtype = 'add' if self.addmodel else 'exp' if self.etable else 'mul' return _xspec.tabint(p, *args, filename=self.filename, tabtype=tabtype)
def mknorm(name: str, **kwargs) -> Parameter: """Create a norm parameter.""" return Parameter(name, 'norm', 1.0, min=0.0, max=1.0e24, hard_min=0.0, hard_max=hugeval, **kwargs) def mkswitch(name: str, default: int = 2, maxval: int = 3) -> XSParameter: """Make a switch parameter. This is for the common case for values between 0 and 3 inclusive. """ return XSParameter(name, 'switch', default, 0, maxval, hard_min=0, hard_max=maxval, alwaysfrozen=True) def mkVelocity(name: str) -> XSParameter: """Make a Velocity parameter.""" return XSParameter(name, 'Velocity', 0., 0., 1e4, hard_min=0.0, hard_max=1e4, units='km/s', frozen=True) def mkRedshift(name: str, default: float = 0, minval: float = -0.999, maxval: float = 10, lc: bool = False) -> XSParameter: """Make a Redshift parameter.""" pname = "redshift" if lc else "Redshift" return XSParameter(name, pname, default, minval, maxval, hard_min=minval, hard_max=maxval, frozen=True) def mkAbundanc(name: str, maxval: float = 5, frozen: bool = True, lc: bool = False) -> XSParameter: """Make an Abundanc parameter.""" pname = "abundanc" if lc else "Abundanc" return XSParameter(name, pname, 1, 0, maxval, hard_min=0, hard_max=maxval, frozen=frozen) def mkabund(name: str, minval: float = 0, maxval: float = 1e6) -> XSParameter: """Make an abund parameter.""" return XSParameter(name, "abund", 1, minval, maxval, hard_min=minval, hard_max=maxval, frozen=True)
[docs] class XSAdditiveModel(XSModel): """The base class for XSPEC additive models. The XSPEC additive models are listed at [1]_. .. versionchanged:: 4.16.1 If the last parameter sent during initialization is not named "norm" then one will now be automatically added. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/Additive.html """ def __init__(self, name, pars): if len(pars) == 0 or pars[-1].name != "norm": if hasattr(self, "norm"): raise ParameterErr("norm is set but not included in pars") # Add in the norm parameter if needed self.norm = mknorm(name) pars = tuple(list(pars) + [self.norm]) XSModel.__init__(self, name, pars)
[docs] def guess(self, dep, *args, **kwargs): if hasattr(self, 'norm'): norm = guess_amplitude(dep, *args) param_apply_limits(norm, self.norm, **kwargs)
[docs] class XSMultiplicativeModel(XSModel): """The base class for XSPEC multiplicative models. The XSPEC multiplicative models are listed at [1]_. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/Multiplivative.html """ pass
[docs] class XSConvolutionKernel(XSModel): """The base class for XSPEC convolution models. The XSPEC convolution models are listed at [1]_. .. versionadded:: 4.12.2 Notes ----- As these models are applied to the result of other models, this model class isn't called directly, but creates a wrapper instance (`XSConvolutionModel`) that is. This wrapping is done by applying the kernel to the model expression using normal function application, that is the following creates a model called ``mdl`` which applies the convolution model (in this case `XScflux`) to the model expression (an absorbed APEC model): >>> cmdl = XScflux() >>> src = XSapec() >>> gal = XSphabs() >>> mdl = cmdl(gal * src) These expressions can then be nested, so for instance you can apply a convolution model to only part of the model expression, as in: >>> mdl = gal * cmdl(src) References ---------- .. [1] https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/manual/Convolution.html Examples -------- Create an instance of the XSPEC cflux convolution model, and set its parameters: >>> from sherpa.astro import xspec >>> cmdl = xspec.XScflux() >>> cmdl.emin = 0.5 >>> cmdl.emax = 7.0 >>> cmdl.lg10flux = -12.1 >>> print(cmdl) xscflux Param Type Value Min Max Units ----- ---- ----- --- --- ----- xscflux.Emin frozen 0.5 0 1e+06 keV xscflux.Emax frozen 10 0 1e+06 keV xscflux.lg10Flux thawed -12 -100 100 cgs The convolution models are not evaluated directly. Instead they are applied to a model expression which you specify as the argument to the convolved model. The following creates two different models: mdl1 applies the convolution to the full model expression (absorbed powerlaw), and mdl applies the convolution to the powerlaw component and then multiplies this by the absorption model. >>> gal = xspec.XSphabs() >>> pl = xspec.XSpowerlaw() >>> mdl1 = cmdl(gal * pl) >>> mdl2 = gal * cmdl(pl) For the XScflux use case it is important to freeze the normalization parameter of the emission model (i.e. additive component) to 1, to ensure the lg10Flux value is calculated correctly. That is: >>> pl.norm = 1 >>> pl.norm.freeze() """ def __repr__(self): return f"<{type(self).__name__} kernel instance '{self.name}'>" def __call__(self, model): return XSConvolutionModel(model, self)
[docs] def calc(self, pars, rhs, *args, **kwargs): """Evaluate the convolved model. Note that this method is not cached by sherpa.models.modelCacher1d (may change in the future). Parameters ---------- pars : sequence of numbers The parameters of the convolved model. The first npars parameters (where npars is the length of the objects pars attribute) are applied to the convolution model, and the remaining are passed to the rhs model. rhs : sherpa.models.model.ArithmeticModel The model that is being convolved. *args The model grid. There should be two arrays (the low and high edges of the bin) to make sure the wrapped model is evaluated correctly. **kwargs At present all additional keyword arguments are dropped. """ nargs = 2 + len(args) if nargs != 4: emsg = f"calc() requires pars,rhs,lo,hi arguments, sent {nargs} arguments" warnings.warn(emsg, FutureWarning) # raise TypeError(emsg) npars = len(self.pars) lpars = pars[:npars] rpars = pars[npars:] # We do not pass kwargs on to either rhs or self._calc; # this is needed because when used with regrid support the # kwargs may include keywords like 'integrate' but this # can then cause problems downstream (that is, they then # get sent to the xspec compiled routine, which doesn't # support them). This may be a problem with the XSPEC # interface (i.e. it should not pass on kwargs to the compiled # code), but for now stop it here. # # DJB is worried that if there is a nested set of grids # then this could be a problem, but has no experience or # tests to back this up. # # fluxes = np.asarray(rhs(rpars, *args, **kwargs)) fluxes = np.asarray(rhs(rpars, *args)) return self._calc(lpars, fluxes, *args)
# It makes sense to derive from XSModel to say "this is XSPEC", # but does the extra machinery it provides cause a problem here? #
[docs] class XSConvolutionModel(CompositeModel, XSModel): """Evaluate a model and pass it to an XSPEC convolution model. Calculate the convolved data - that is evaluate the model and then pass it to the wrapper model which applies the convolution model. .. versionadded:: 4.12.2 Parameters ---------- model : `sherpa.models.model.ArithmeticModel` The model whose results, when evaluated, are passed to the convolution model. wrapper : `sherpa.astro.xspec.XSConvolutionKernel` The XSPEC convolution model. Examples -------- The following evaluates two models (creating the y1 and y2 arrays), where y1 applies the `XScflux` convolution model to the combined absorption times powerlaw model, and y2 applies the convolution model to only the power-law model, and then multiples this by the absorption model. In the following mdl1 and mdl2 are instances of XSConvolutionModel: >>> import numpy as np >>> from sherpa.astro import xspec >>> cmdl = xspec.XScflux() >>> gal = xspec.XSphabs() >>> pl = xspec.XSpowerlaw() >>> pl.norm.freeze() >>> mdl1 = cmdl(gal * pl) >>> mdl2 = gal * cmdl(pl) >>> cmdl.emin = 0.5 >>> cmdl.emax = 7.0 >>> cmdl.lg10flux = -12.1 >>> egrid = np.arange(0.1, 10, 0.01) >>> elo, ehi = egrid[:-1], egrid[1:] >>> y1 = mdl1(elo, ehi) >>> y2 = mdl2(elo, ehi) Display the combined model: >>> print(mdl1) xscflux(phabs * powerlaw) Param Type Value Min Max Units ----- ---- ----- --- --- ----- xscflux.Emin frozen 0.5 0 1e+06 keV xscflux.Emax frozen 10 0 1e+06 keV xscflux.lg10Flux thawed -12 -100 100 cgs phabs.nH thawed 1 0 100000 10^22 atoms / cm^2 powerlaw.PhoIndex thawed 1 -2 9 powerlaw.norm frozen 1 0 1e+24 >>> print(mdl2) phabs * xscflux(powerlaw) Param Type Value Min Max Units ----- ---- ----- --- --- ----- phabs.nH thawed 1 0 100000 10^22 atoms / cm^2 xscflux.Emin frozen 0.5 0 1e+06 keV xscflux.Emax frozen 10 0 1e+06 keV xscflux.lg10Flux thawed -12 -100 100 cgs powerlaw.PhoIndex thawed 1 -2 9 powerlaw.norm frozen 1 0 1e+24 """
[docs] @staticmethod def wrapobj(obj): if isinstance(obj, ArithmeticModel): return obj return ArithmeticFunctionModel(obj)
def __init__(self, model, wrapper): self.model = self.wrapobj(model) self.wrapper = wrapper CompositeModel.__init__(self, f"{self.wrapper.name}({self.model.name})", (self.wrapper, self.model)) # for now this is not cached
[docs] def calc(self, p, *args, **kwargs): """Evaluate the convolved model on a grid. Parameters ---------- p : sequence of numbers The parameters of the model, matching the ``pars`` field. This will start with the convolution model parameters (if any) and then the model. *args The model grid. There should be two arrays (the low and high edges of the bin) to make sure the wrapped model is evaluated correctly. **kwargs Additional keyword arguments. """ nargs = 1 + len(args) if nargs != 3: emsg = f"calc() requires pars,lo,hi arguments, sent {nargs} arguments" warnings.warn(emsg, FutureWarning) # raise TypeError(emsg) return self.wrapper.calc(p, self.model.calc, *args, **kwargs)
# Models from model.dat, in the same order as that file #
[docs] class XSagauss(XSAdditiveModel): """The XSPEC agauss model: gaussian line profile in wavelength space. The model is described at [1]_. Attributes ---------- LineE The line wavelength, in Angstrom. Sigma The line width, in Angstrom. A value of zero means a delta function. norm The flux in the line, in units of photon/cm^2/s. See Also -------- XSgaussian, XSzagauss, XSzgauss References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelAgauss.html """ __function__ = "C_agauss" def __init__(self, name='agauss'): self.LineE = XSParameter(name, 'LineE', 10.0, 0.0, 1.0e6, 0.0, 1.0e6, units='A') self.Sigma = XSParameter(name, 'Sigma', 1.0, 0.0, 1.0e6, 0.0, 1.0e6, units='A') XSAdditiveModel.__init__(self, name, (self.LineE, self.Sigma))
[docs] class XSagnsed(XSAdditiveModel): """The XSPEC agnsed model: AGN SED model The model is described at [1]_. Attributes ---------- mass The black hole mass, in solar units. dist The comoving (proper) distance, in Mpc. logmdot log of mdot, where mdot = Mdot/Mdot_Edd and eta Mdot_Edd c^2 = L_Edd astar The black hole spin (dimensionless) cosi The cosine of the inclination angle i for the warm Comptonising component and the outer disc. kTe_hot The electron temperature for the hot Comptonisation component in keV. If negative then only the hot Comptonisation component is used. kTe_warm The electron temperature for the warm Comptonisation component in keV. If negative then only the warm Comptonisation component is used. Gamma_hot The spectral index of the hot Comptonisation component. If negative, the code will use the value calculated via eq.(2) of KD18 (see [1]_). Gamma_warm The spectral index of the warm Comptonisation component. If negative then only the outer disc component is used. R_hot The outer radius of the hot Comptonisation component in Rg. R_warm The outer radius of the warm Comptonisation component in Rg. logrout The log of the outer radius of the disc in units of Rg. If negative, the code will use the self gravity radius as calculated from Laor & Netzer (1989) (see [1]_). Htmax The upper limit of the scale height for the hot Comptonisation component in Rg. If smaller than R_hot, the hot Comptonisation region is a sphere of radius Htmax by keeping Ldiss_hot determined by R_hot via eq.(2) of KD18 (see [1]_). reprocess If this parameter is 0, reprocessing is not considered. If it is 1, reprocessing is included. redshift The redshift. norm The normalization of the model. See Also -------- XSagnslim, XSqsosed References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelAgnsed.html """ __function__ = "agnsed" def __init__(self, name='agnsed'): self.mass = XSParameter(name, 'mass', 1e7, 1.0, 1e10, 1.0, 1e10, 'solar', frozen=True) self.dist = XSParameter(name, 'dist', 100, 0.01, 1e9, 0.01, 1e9, 'Mpc', frozen=True) self.logmdot = XSParameter(name, 'logmdot', -1, -10, 2, -10, 2) self.astar = XSParameter(name, 'astar', 0.0, -1, 0.998, -1, 0.998, frozen=True) self.cosi = XSParameter(name, 'cosi', 0.5, 0.05, 1.0, 0.05, 1.0, frozen=True) # TODO: allow negative values self.kTe_hot = XSParameter(name, 'kTe_hot', 100.0, 10, 300, 10, 300, 'keV(_pl)', frozen=True) self.kTe_warm = XSParameter(name, 'kTe_warm', 0.2, 0.1, 0.5, 0.1, 0.5, 'keV(_sc)') self.Gamma_hot = XSParameter(name, 'Gamma_hot', 1.7, 1.3, 3, 1.3, 3, '(_calc)') self.Gamma_warm = XSParameter(name, 'Gamma_warm', 2.7, 2, 5, 2, 10, '(_disk)') self.R_hot = XSParameter(name, 'R_hot', 10, 6, 500, 6, 500, 'Rg') self.R_warm = XSParameter(name, 'R_warm', 20, 6, 500, 6, 500, 'Rg') self.logrout = XSParameter(name, 'logrout', -1, -3, 7, -3, 7, '(_selfg)', frozen=True) self.Htmax = XSParameter(name, 'Htmax', 10, 6, 10, 6, 10, 'Rg', frozen=True) self.reprocess = XSParameter(name, 'reprocess', 1, 0, 1, 0, 1, '0off/1on', alwaysfrozen=True) self.redshift = mkRedshift(name, default=0, minval=0, maxval=1, lc=True) pars = (self.mass, self.dist, self.logmdot, self.astar, self.cosi, self.kTe_hot, self.kTe_warm, self.Gamma_hot, self.Gamma_warm, self.R_hot, self.R_warm, self.logrout, self.Htmax, self.reprocess, self.redshift) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSagnslim(XSAdditiveModel): """The XSPEC agnslim model: AGN super-Eddington accretion model The model is described at [1]_. .. versionchanged:: 4.14.0 The default logmdot parameter value has changed from -1 to 1 to match XSPEC. Attributes ---------- mass The black hole mass, in solar units. dist The comoving (proper) distance, in Mpc. logmdot log of mdot, where mdot = Mdot/Mdot_Edd and eta Mdot_Edd c^2 = L_Edd astar The black hole spin (dimensionless) cosi The cosine of the inclination angle i for the warm Comptonising component and the outer disc. kTe_hot The electron temperature for the hot Comptonisation component in keV. If negative then only the hot Comptonisation component is used. kTe_warm The electron temperature for the warm Comptonisation component in keV. If negative then only the warm Comptonisation component is used. Gamma_hot The spectral index of the hot Comptonisation component. Gamma_warm The spectral index of the warm Comptonisation component. If negative then only the outer disc component is used. R_hot The outer radius of the hot Comptonisation component in Rg. R_warm The outer radius of the warm Comptonisation component in Rg. logrout The log of the outer radius of the disc in units of Rg. If negative, the code will use the self gravity radius as calculated from Laor & Netzer (1989) (see [1]_). rin The inner radius of the disc in Rg. If this parameter is -1 (the default), the model will use the radius calculated from KD19. This must be greater than R_hot for mdot greater than 6 and greater than R_isco for mdot less than 6. redshift The redshift. norm The normalization of the model. This must be fixed at 1. See Also -------- XSagnsed, XSqsosed References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelAgnslim.html """ __function__ = "agnslim" def __init__(self, name='agnslim'): self.mass = XSParameter(name, 'mass', 1e7, 1.0, 1e10, 1.0, 1e10, 'solar', frozen=True) self.dist = XSParameter(name, 'dist', 100, 0.01, 1e9, 0.01, 1e9, 'Mpc', frozen=True) self.logmdot = XSParameter(name, 'logmdot', 1, -10, 3, -10, 3) self.astar = XSParameter(name, 'astar', 0.0, 0, 0.998, 0, 0.998, frozen=True) self.cosi = XSParameter(name, 'cosi', 0.5, 0.05, 1.0, 0.05, 1.0, frozen=True) self.kTe_hot = XSParameter(name, 'kTe_hot', 100.0, 10, 300, 10, 300, 'keV(-pl)', frozen=True) self.kTe_warm = XSParameter(name, 'kTe_warm', 0.2, 0.1, 0.5, 0.1, 0.5, 'keV(-sc)') self.Gamma_hot = XSParameter(name, 'Gamma_hot', 2.4, 1.3, 3, 1.3, 3) self.Gamma_warm = XSParameter(name, 'Gamma_warm', 3.0, 2, 5, 2, 10, '(-disk)') self.R_hot = XSParameter(name, 'R_hot', 10, 2, 500, 2, 500, units='Rg') self.R_warm = XSParameter(name, 'R_warm', 20, 2, 500, 2, 500, units='Rg') self.logrout = XSParameter(name, 'logrout', -1, -3, 7, -3, 7, '(-selfg)', frozen=True) self.rin = XSParameter(name, 'rin', -1, -1, 100, -1, 100, frozen=True) # TODO: make alwaysfrozen? self.redshift = mkRedshift(name, minval=0, maxval=5, lc=True) pars = (self.mass, self.dist, self.logmdot, self.astar, self.cosi, self.kTe_hot, self.kTe_warm, self.Gamma_hot, self.Gamma_warm, self.R_hot, self.R_warm, self.logrout, self.rin, self.redshift) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSapec(XSAdditiveModel): """The XSPEC apec model: APEC emission spectrum. The model is described at [1]_. The ``set_xsabund`` and ``get_xsabund`` functions change and return the current settings for the relative abundances of the metals. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keywords "APECROOT", "APECTHERMAL", "APECVELOCITY", and "APEC_TRACE_ABUND". Attributes ---------- kT The temperature of the plasma, in keV. Abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function and the "APEC_TRACE_ABUND" xset keyword. Redshift The redshift of the plasma. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbapec, XSbvapec, XSbvvapec, XSeebremss, XSnlapec, XSsnapec, XSvapec, XSvvapec, XSwdem References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelApec.html """ __function__ = "C_apec" def __init__(self, name='apec'): self.kT = XSParameter(name, 'kT', 1., 0.008, 64.0, 0.008, 64.0, units='keV') self.Abundanc = mkAbundanc(name) self.Redshift = mkRedshift(name) pars = (self.kT, self.Abundanc, self.Redshift) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbapec(XSAdditiveModel): """The XSPEC bapec model: velocity broadened APEC thermal plasma model. The model is described at [1]_. The ``set_xsabund`` and ``get_xsabund`` functions change and return the current settings for the relative abundances of the metals. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keywords "APECROOT" and "APEC_TRACE_ABUND". .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT The temperature of the plasma, in keV. Abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function and the "APEC_TRACE_ABUND" xset keyword. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSapec, XSbtapec, XSbvapec, XSbvvapec, XSvapec, XSvvapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBapec.html """ __function__ = "C_bapec" def __init__(self, name='bapec'): self.kT = XSParameter(name, 'kT', 1., 0.008, 64.0, 0.008, 64, units='keV') self.Abundanc = mkAbundanc(name) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.Abundanc, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbcempow(XSAdditiveModel): """The XSPEC bcempow model: plasma emission, multi-temperature using a power-law emission measure The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- alpha The power-law index of the emissivity function. Tmax The maximum temperature, in keV. nH H density, in cm^-3. abundanc The abundance relative to Solar, as set by ``set_xsabund``. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbvcempow, XScempow References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCempow.html """ __function__ = "C_bcempow" def __init__(self, name='bcempow'): self.alpha = XSParameter(name, 'alpha', 1.0, 0.01, 10, 0.01, 20, frozen=True) self.Tmax = XSParameter(name, 'Tmax', 1.0, 0.02725, 1.e2, 0.02725, 1e2, units='keV') self.nH = XSParameter(name, 'nH', 1.0, 1.e-5, 1.e19, 1e-6, 1e20, units='cm^-3', frozen=True) self.abundanc = mkAbundanc(name, maxval=10, lc=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.alpha, self.Tmax, self.nH, self.abundanc, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbcheb6(XSAdditiveModel): """The XSPEC bcheb6 model: differential emission measure using 6-order Chebyshev polynomial. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- CPcoef1, CPcoef2, CPcoef3, CPcoef4, CPcoef5, CPcoef6 Chebyshev polynomial coefficients. nH H density, in cm^-3. abundanc The abundance relative to Solar, as set by ``set_xsabund``. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbexpcheb6, XSbvcheb6, XScheb6 References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCheb6.html """ __function__ = "C_bcheb6" def __init__(self, name='bcheb6'): self.CPcoef1 = XSParameter(name, 'CPcoef1', 1.0, -1, 1, -1, 1) self.CPcoef2 = XSParameter(name, 'CPcoef2', 0.5, -1, 1, -1, 1) self.CPcoef3 = XSParameter(name, 'CPcoef3', 0.5, -1, 1, -1, 1) self.CPcoef4 = XSParameter(name, 'CPcoef4', 0.5, -1, 1, -1, 1) self.CPcoef5 = XSParameter(name, 'CPcoef5', 0.5, -1, 1, -1, 1) self.CPcoef6 = XSParameter(name, 'CPcoef6', 0.5, -1, 1, -1, 1) self.nH = XSParameter(name, 'nH', 1.0, 1.e-5, 1.e19, 1e-6, 1e20, units='cm^-3', frozen=True) self.abundanc = mkAbundanc(name, maxval=10, lc=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.CPcoef1, self.CPcoef2, self.CPcoef3, self.CPcoef4, self.CPcoef5, self.CPcoef6, self.nH, self.abundanc, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbcie(XSAdditiveModel): """The XSPEC bcie model: Emission spectrum from a plasma in Collisional-ionization equilibrium. The model is described at [1]_. Note that ``set_xsxset`` should be used to change the XSET settings. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- kT The plasma temperature in keV. Abundanc The metal abundances (He fixed at that defined by the ``set_xsabund`` command). The elements included are C, N, O, Ne, Mg, Al, Si, S, Ar, Ca, Fe, and Ni. Relative abundances are set by ``set_xsabund``). The trace element abundaces are controlled by the "APEC_TRACE_ABUND" setting and default to 1.0. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See [1]_ for more details. See Also -------- XScie, XSbvcie, XSbvvcie References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCie.html """ __function__ = "C_bcie" def __init__(self, name='bcie'): self.kT = XSParameter(name, 'kT', 1.0, min=0.008, max=64.0, hard_min=0.008, hard_max=64.0, units='keV') self.Abundanc = mkAbundanc(name) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.kT, self.Abundanc, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbcoolflow(XSAdditiveModel): """The XSPEC bcoolflow model: cooling flow, mekal. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- lowT The low temperature in keV. highT The high temperature in keV. Abundanc Abundance relative to solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The mass accretion rate (solar mass per year). See Also -------- XSbcph, XSbvcoolflow, XScoolflow References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCoolflow.html """ __function__ = "C_bcoolflow" def __init__(self, name='bcoolflow'): self.lowT = XSParameter(name, 'lowT', 0.1, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.highT = XSParameter(name, 'highT', 4.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.Abundanc = mkAbundanc(name, frozen=False) self.Redshift = mkRedshift(name, default=0.1) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.lowT, self.highT, self.Abundanc, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbcph(XSAdditiveModel): """The XSPEC bcph model: Cooling + heating model for cool core clusters. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- peakT The peak temperature in keV. Abund Abundance relative to solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The mass accretion rate (solar mass per year). See Also -------- XScph, XSbcoolflow, XSbvcph References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCph.html """ __function__ = "C_bcph" def __init__(self, name='bcph'): self.peakT = XSParameter(name, 'peakT', 2.2, min=0.1, max=100.0, hard_min=0.1, hard_max=100.0, units='keV') self.Abund = XSParameter(name, 'Abund', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Redshift = mkRedshift(name, minval=0, maxval=50) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.peakT, self.Abund, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbequil(XSAdditiveModel): """The XSPEC bequil model: collisional plasma, ionization equilibrium, The model is described at [1]_. Use the ``set_xsxset`` function to change the "NEIVERS" setting. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- kT The temperature in keV. Abundanc The metal abundances (He fixed at that defined by the ``set_xsabund`` command). The elements included are C, N, O, Ne, Mg, Al, Si, S, Ar, Ca, Fe, and Ni. Relative abundances are set by ``set_xsabund``). Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model. See Also -------- XSbvequil, XSequil References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelEquil.html """ __function__ = "C_bequil" def __init__(self, name='bequil'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.Abundanc, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbexpcheb6(XSAdditiveModel): """The XSPEC bexpcheb6 model: differential emission measure using exponential of a 6-order Chebyshev polynomial. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- CPcoef1, CPcoef2, CPcoef3, CPcoef4, CPcoef5, CPcoef6 Chebyshev polynomial coefficients. nH H density, in cm^-3. abundanc The abundance relative to Solar, as set by ``set_xsabund``. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbcheb6, XSbvexpcheb6, XSexpcheb6 References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelExpcheb6.html """ __function__ = "C_bexpcheb6" def __init__(self, name='bexpcheb6'): self.CPcoef1 = XSParameter(name, 'CPcoef1', 1.0, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef2 = XSParameter(name, 'CPcoef2', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef3 = XSParameter(name, 'CPcoef3', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef4 = XSParameter(name, 'CPcoef4', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef5 = XSParameter(name, 'CPcoef5', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef6 = XSParameter(name, 'CPcoef6', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.abundanc = mkAbundanc(name, maxval=10, lc=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.CPcoef1, self.CPcoef2, self.CPcoef3, self.CPcoef4, self.CPcoef5, self.CPcoef6, self.nH, self.abundanc, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbgadem(XSAdditiveModel): """The XSPEC bgadem model: plasma emission, multi-temperature with gaussian distribution of emission measure. The model is described at [1]_. The ``set_xsabund`` and ``get_xsabund`` functions change and return the current settings for the relative abundances of the metals. See the ``XSapec`` documentation for settings relevant to the APEC model (i.e. when ``switch=2``). .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- Tmean The mean temperature for the gaussian emission measure distribution, in keV. Tsigma The sigma of the temperature distribution for the gaussian emission measure, in keV. nH H density, in cm^-3. abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbvgadem, XSbvvgadem, XSgadem References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelGadem.html """ __function__ = "C_bgaussDem" def __init__(self, name='bgadem'): self.Tmean = XSParameter(name, 'Tmean', 4.0, 0.01, 10, 0.01, 20, units='keV', frozen=True) self.Tsigma = XSParameter(name, 'Tsigma', 0.1, 0.01, 1.e2, 0.01, 1e2, units='keV') self.nH = XSParameter(name, 'nH', 1.0, 1.e-5, 1.e19, 1e-6, 1e20, units='cm^-3', frozen=True) self.abundanc = mkAbundanc(name, maxval=10, lc=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.Tmean, self.Tsigma, self.nH, self.abundanc, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbgnei(XSAdditiveModel): """The XSPEC bgnei model: collisional plasma, non-equilibrium, temperature evolution. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. Abundanc The metal abundances (He fixed at that defined by the ``set_xsabund`` command). The elements included are C, N, O, Ne, Mg, Al, Si, S, Ar, Ca, Fe, and Ni. Relative abundances are set by ``set_xsabund``). Tau The ionization timescale in units of s/cm^3. meankT The ionization timescale averaged plasma temperature in keV. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvgnei, XSbvvgnei, XSgnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelGnei.html """ __function__ = "C_bgnei" def __init__(self, name='bgnei'): self.kT = XSParameter(name, 'kT', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, 0., 1000., 0.0, 10000, frozen=True) self.Tau = XSParameter(name, 'Tau', 1.e11, 1.e8, 5.e13, 1e8, 5e13, units='s/cm^3') self.meankT = XSParameter(name, 'meankT', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV', aliases=["kT_ave"]) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.Abundanc, self.Tau, self.meankT, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbnei(XSAdditiveModel): """The XSPEC bnei model: collisional plasma, non-equilibrium, constant temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. Abundanc The metal abundances (He fixed at that defined by the ``set_xsabund`` command). The elements included are C, N, O, Ne, Mg, Al, Si, S, Ar, Ca, Fe, and Ni. Relative abundances are set by ``set_xsabund``). Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvnei, XSbvvnei, XSnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelNei.html """ __function__ = "C_bnei" def __init__(self, name='bnei'): self.kT = XSParameter(name, 'kT', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, 0., 1000., 0.0, 10000, frozen=True) self.Tau = XSParameter(name, 'Tau', 1.e11, 1.e8, 5.e13, 1e8, 5e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.Abundanc, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbsnapec(XSAdditiveModel): """The XSPEC snapec model: galaxy cluster spectrum using SN yields. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters to control the APEC model. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. N_SNe The number of SNe (in units of 10^9). R The percentage of SNIa. SNIModelIndex SNIa yield model: see [1]_ for more details. SNIIModelIndex SNII yield model: see [1]_ for more details. redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSapec, XSbsnapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelSnapec.html """ __function__ = "C_bsnapec" def __init__(self, name='bsnapec'): self.kT = XSParameter(name, 'kT', 1., 0.008, 64.0, 0.008, 64.0, units='keV') self.N_SNe = XSParameter(name, 'N_SNe', 1., 0.0, 1e20, 0, 1e20, units='10^9') # QUS: if this is a percentage, why is the maximum not 100? self.R = XSParameter(name, 'R', 1., 0.0, 1e20, 0, 1e20) self.SNIModelIndex = XSParameter(name, 'SNIModelIndex', 1., 0.0, 125, 0, 125, alwaysfrozen=True) self.SNIIModelIndex = XSParameter(name, 'SNIIModelIndex', 1., 0.0, 125, 0, 125, alwaysfrozen=True) self.redshift = XSParameter(name, 'redshift', 0., 0.0, 10., 0.0, 10.0, frozen=True) self.Velocity = mkVelocity(name) pars = (self.kT, self.N_SNe, self.R, self.SNIModelIndex, self.SNIIModelIndex, self.redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbtapec(XSAdditiveModel): """The XSPEC btapec model: velocity broadened APEC emission spectrum with separate continuum and line temperatures. The model is described at [1]_. The ``set_xsabund`` and ``get_xsabund`` functions change and return the current settings for the relative abundances of the metals. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keywords "APECROOT" and "APEC_TRACE_ABUND". .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT Continuum temperature, in keV. kTi Line temperature, in keV. Abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function and the "APEC_TRACE_ABUND" xset keyword (which defaults to 1.0). Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbapec, XSbvtapec, XSbvvtapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBtapec.html """ __function__ = "C_btapec" def __init__(self, name='btapec'): self.kT = XSParameter(name, 'kT', 1.0, 0.008, 64.0, 0.008, 64.0, units='keV') self.kTi = XSParameter(name, 'kTi', 1.0, 0.008, 64.0, 0.008, 64.0, units='keV') self.Abundanc = mkAbundanc(name) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.kTi, self.Abundanc, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbbody(XSAdditiveModel): """The XSPEC bbody model: blackbody spectrum. The model is described at [1]_. Attributes ---------- kT The temperature of the object, in keV. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbbodyrad, XSzbbody References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBbody.html """ __function__ = "xsblbd" def __init__(self, name='bbody'): self.kT = XSParameter(name, 'kT', 3.0, 1.e-2, 100., 1e-4, 200, units='keV') XSAdditiveModel.__init__(self, name, (self.kT, ))
[docs] class XSbbodyrad(XSAdditiveModel): """The XSPEC bbodyrad model: blackbody spectrum, area normalized. The model is described at [1]_. Attributes ---------- kT The temperature of the object, in keV. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbbody, XSzbbody References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBbodyrad.html """ __function__ = "xsbbrd" def __init__(self, name='bbodyrad'): self.kT = XSParameter(name, 'kT', 3., 1e-3, 100, 1e-4, 200, units='keV') XSAdditiveModel.__init__(self, name, (self.kT, ))
# DOC-NOTE: the XSPEC documentation has a different parameter order to # the code.
[docs] class XSbexrav(XSAdditiveModel): """The XSPEC bexrav model: reflected e-folded broken power law, neutral medium. The model is described at [1]_. Attributes ---------- Gamma1 The power-law index of the first power-law component. breakE The break energy, in keV. Gamma2 The power-law index of the second power-law component. foldE The e-folding energy (Ec) in keV. If zero there is no cut off. rel_refl The reflection scaling parameter (a value of 1 for an isotropic source above the disk). cosIncl The cosine of the inclination angle. abund The abundance of the elements heavier than He relative to their solar abundance, as set by the ``set_xsabund`` function. Fe_abund The iron abundance relative to the solar abundance, as set by the ``set_xsabund`` function. Redshift The redshift of the source. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbexriv, XSreflect Notes ----- The precision of the numerical integration can be changed by using the ``set_xsxset`` function to set the value of the BEXRAV_PRECISION keyword, which defines the fractional precision. The default is 0.01 (1%). References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBexrav.html """ __function__ = "C_xsbexrav" def __init__(self, name='bexrav'): self.Gamma1 = XSParameter(name, 'Gamma1', 2., -9., 9., -10, 10) self.breakE = XSParameter(name, 'breakE', 10., 0.1, 1000., 0.1, 1000, units='keV') self.Gamma2 = XSParameter(name, 'Gamma2', 2., -9., 9., -10, 10) self.foldE = XSParameter(name, 'foldE', 100., 1., 1.e6, 1.0, 1e6, units='keV') self.rel_refl = XSParameter(name, 'rel_refl', 0., 0., 10., 0.0, 10) self.cosIncl = XSParameter(name, 'cosIncl', 0.45, 0.05, 0.95, 0.05, 0.95, frozen=True) self.abund = mkabund(name) self.Fe_abund = XSParameter(name, 'Fe_abund', 1., 0.0, 1.e6, 0.0, 1e6, frozen=True) self.Redshift = mkRedshift(name) pars = (self.Gamma1, self.breakE, self.Gamma2, self.foldE, self.rel_refl, self.cosIncl, self.abund, self.Fe_abund, self.Redshift) XSAdditiveModel.__init__(self, name, pars)
[docs] def guess(self, dep, *args, **kwargs): XSAdditiveModel.guess(self, dep, *args, **kwargs) pos = get_xspec_position(dep, *args) param_apply_limits(pos, self.breakE, **kwargs)
[docs] class XSbexriv(XSAdditiveModel): """The XSPEC bexriv model: reflected e-folded broken power law, ionized medium. The model is described at [1]_. Attributes ---------- Gamma1 The power-law index of the first power-law component. breakE The break energy, in keV. Gamma2 The power-law index of the second power-law component. foldE The e-folding energy (Ec) in keV. If zero there is no cut off. rel_refl The reflection scaling parameter (a value of 1 for an isotropic source above the disk). Redshift The redshift of the source. abund The abundance of the elements heavier than He relative to their solar abundance, as set by the ``set_xsabund`` function. Fe_abund The iron abundance relative to the solar abundance, as set by the ``set_xsabund`` function. cosIncl The cosine of the inclination angle. T_disk The disk temperature in K. xi The disk ionization parameter: see [1]_ for an explanation. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbexrav, XSireflect Notes ----- The precision of the numerical integration can be changed by using the ``set_xsxset`` function to set the value of the BEXRIV_PRECISION keyword, which defines the fractional precision. The default is 0.01 (1%). References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBexriv.html """ __function__ = "C_xsbexriv" def __init__(self, name='bexriv'): self.Gamma1 = XSParameter(name, 'Gamma1', 2., -9., 9., -10, 10) self.breakE = XSParameter(name, 'breakE', 10., 0.1, 1000., 0.1, 1000, units='keV') self.Gamma2 = XSParameter(name, 'Gamma2', 2., -9., 9., -10, 10) self.foldE = XSParameter(name, 'foldE', 100., 1., 1.e6, 1, 1e6, units='keV') self.rel_refl = XSParameter(name, 'rel_refl', 0., 0., 1.e6, 0.0, 1e6) self.Redshift = mkRedshift(name) self.abund = mkabund(name) self.Fe_abund = XSParameter(name, 'Fe_abund', 1., 0.0, 1.e6, 0.0, 1e6, frozen=True) self.cosIncl = XSParameter(name, 'cosIncl', 0.45, 0.05, 0.95, 0.05, 0.95, frozen=True) self.T_disk = XSParameter(name, 'T_disk', 3.e4, 1.e4, 1.e6, 1e4, 1e6, units='K', frozen=True) self.xi = XSParameter(name, 'xi', 1., 0., 1.e3, 0.0, 5e3, units='erg cm/s') pars = (self.Gamma1, self.breakE, self.Gamma2, self.foldE, self.rel_refl, self.Redshift, self.abund, self.Fe_abund, self.cosIncl, self.T_disk, self.xi) XSAdditiveModel.__init__(self, name, pars)
[docs] def guess(self, dep, *args, **kwargs): XSAdditiveModel.guess(self, dep, *args, **kwargs) pos = get_xspec_position(dep, *args) param_apply_limits(pos, self.breakE, **kwargs)
[docs] class XSbknpower(XSAdditiveModel): """The XSPEC bknpower model: broken power law. The model is described at [1]_. Attributes ---------- PhoIndx1 The power law photon index for energies less than BreakE. BreakE The break energy, in keV. PhoIndx2 The power law photon index for energies greater than BreakE. norm The normalization of the model. See [1]_ for details, as its meaning depends on whether the "POW_EMIN" or "POW_EMAX" keywords have been set with ``set_xsxset``. See Also -------- XSbkn2pow, XScutoffpl, XSpowerlaw, XSzbknpower, XSzcutoffpl, XSzpowerlw References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBknpower.html """ __function__ = "C_brokenPowerLaw" def __init__(self, name='bknpower'): self.PhoIndx1 = XSParameter(name, 'PhoIndx1', 1., -2., 9., -3, 10) self.BreakE = XSParameter(name, 'BreakE', 5., 1.e-2, 1.e6, 0.0, 1e6, units='keV') self.PhoIndx2 = XSParameter(name, 'PhoIndx2', 2., -2., 9., -3, 10) pars = (self.PhoIndx1, self.BreakE, self.PhoIndx2) XSAdditiveModel.__init__(self, name, pars)
[docs] def guess(self, dep, *args, **kwargs): XSAdditiveModel.guess(self, dep, *args, **kwargs) pos = get_xspec_position(dep, *args) param_apply_limits(pos, self.BreakE, **kwargs)
[docs] class XSbkn2pow(XSAdditiveModel): """The XSPEC bkn2pow model: broken power law with two breaks. The model is described at [1]_. Attributes ---------- PhoIndx1 The power law photon index for energies less than BreakE1. BreakE1 The first break energy, in keV. PhoIndx2 The power law photon index for energies greater than BreakE1 but less than BreakE2. BreakE2 The second break energy, in keV. PhoIndx3 The power law photon index for energies greater than BreakE2. norm The normalization of the model. See [1]_ for details, as its meaning depends on whether the "POW_EMIN" or "POW_EMAX" keywords have been set with ``set_xsxset``. See Also -------- XSbknpower, XScutoffpl, XSpowerlaw, XSzcutoffpl, XSzpowerlw References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBkn2pow.html """ __function__ = "C_broken2PowerLaw" def __init__(self, name='bkn2pow'): self.PhoIndx1 = XSParameter(name, 'PhoIndx1', 1., -2., 9., -3, 10) self.BreakE1 = XSParameter(name, 'BreakE1', 5., 1.e-2, 1.e6, 0.0, 1e6, units='keV') self.PhoIndx2 = XSParameter(name, 'PhoIndx2', 2., -2., 9., -3, 10) self.BreakE2 = XSParameter(name, 'BreakE2', 10., 1.e-2, 1.e6, 0.0, 1e6, units='keV') self.PhoIndx3 = XSParameter(name, 'PhoIndx3', 3., -2., 9., -3, 10) pars = (self.PhoIndx1, self.BreakE1, self.PhoIndx2, self.BreakE2, self.PhoIndx3) XSAdditiveModel.__init__(self, name, pars)
[docs] def guess(self, dep, *args, **kwargs): XSAdditiveModel.guess(self, dep, *args, **kwargs) pos = get_xspec_position(dep, *args) param_apply_limits(pos, self.BreakE1, **kwargs) param_apply_limits(pos, self.BreakE2, **kwargs)
[docs] class XSbmc(XSAdditiveModel): """The XSPEC bmc model: Comptonization by relativistic matter. The model is described at [1]_. .. note:: Deprecated in Sherpa 4.10.0 The ``logA`` parameter has been renamed ``log_A`` to match the XSPEC definition. The name ``logA`` can still be used to access the parameter, but this name will be removed in a future release. Attributes ---------- kT The temperature of the thermal photon source in keV. alpha The energy spectral index. log_A The log of the A parameter: see [1]_ for more details. norm The normalization of the model: see [1]_ for an explanation of the units. References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBmc.html """ __function__ = "xsbmc" def __init__(self, name='bmc'): self.kT = XSParameter(name, 'kT', 1., 1.e-2, 100., 1e-4, 200, units='keV') self.alpha = XSParameter(name, 'alpha', 1., 1.e-2, 4.0, 1e-4, 6) self.log_A = XSParameter(name, 'log_A', 0.0, -6.0, 6.0, -8, 8, aliases=["logA"]) pars = (self.kT, self.alpha, self.log_A) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbnpshock(XSAdditiveModel): """The XSPEC bnpshock model: shocked plasma, plane parallel, separate ion, electron temperatures. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT_a The mean shock temperature, in keV. kT_b The electron temperature immediately behind the shock front, in keV. See [1]_ for a discussion of the behavior of kT_a and kT_b. Abundanc The metal abundance, as defined by the ``set_xsabund`` function. Tau_l The lower limit on the ionization timescale in s/cm^3. Tau_u The upper limit on the ionization timescale in s/cm^3. Redshift The redshift of the source. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvnpshock, XSbvvnpshock, XSnpshock References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelNpshock.html """ __function__ = "C_bnpshock" def __init__(self, name='bnpshock'): self.kT_a = XSParameter(name, 'kT_a', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.kT_b = XSParameter(name, 'kT_b', 0.5, 0.0100, 79.9, 0.0100, 79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, 0., 1000., 0.0, 10000, frozen=True) self.Tau_l = XSParameter(name, 'Tau_l', 0.0, 0., 5.e13, 0.0, 5e13, units='s/cm^3', frozen=True) self.Tau_u = XSParameter(name, 'Tau_u', 1.e11, 1.e8, 5.e13, 1e8, 5e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT_a, self.kT_b, self.Abundanc, self.Tau_l, self.Tau_u, self.redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbpshock(XSAdditiveModel): """The XSPEC bpshock model: plane-parallel shocked plasma, constant temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. Abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function. Tau_l The lower limit on the ionization timescale, in s/cm^3. Tau_u The upper limit on the ionization timescale, in s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvpshock, XSbvvpshock, XSpshock References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelPshock.html """ __function__ = "C_bpshock" def __init__(self, name='bpshock'): self.kT = XSParameter(name, 'kT', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, 0., 1000., 0.0, 10000, frozen=True) self.Tau_l = XSParameter(name, 'Tau_l', 0.0, 0., 5.e13, 0.0, 5e13, units='s/cm^3', frozen=True) self.Tau_u = XSParameter(name, 'Tau_u', 1.e11, 1.e8, 5.e13, 1e8, 5e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.Abundanc, self.Tau_l, self.Tau_u, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbremss(XSAdditiveModel): """The XSPEC bremss model: thermal bremsstrahlung. The model is described at [1]_. Attributes ---------- kT The plasma temperature in keV. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSvbremss, XSzbremss References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBremss.html """ __function__ = "xsbrms" def __init__(self, name='bremss'): self.kT = XSParameter(name, 'kT', 7.0, 1.e-4, 100., 1e-4, 200, units='keV') XSAdditiveModel.__init__(self, name, (self.kT, ))
[docs] class XSbrnei(XSAdditiveModel): """The XSPEC brnei model: velocity-broadened non-equilibrium recombining collisional plasma. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT The temperature of the plasma, in keV. kT_init The initial temperature of the plasma, in keV. Abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function. Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity Velocity broadening in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvrnei, XSbvvrnei, XSnei, XSgnei, XSrnei, XSvrnei, XSvvrnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBrnei.html """ __function__ = "C_brnei" def __init__(self, name='brnei'): self.kT = XSParameter(name, 'kT', 0.5, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.kT_init = XSParameter(name, 'kT_init', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, 0., 1000., 0.0, 10000, frozen=True) self.Tau = XSParameter(name, 'Tau', 1.e11, 1.0e8, 5.0e13, 1.0e8, 5.0e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.kT_init, self.Abundanc, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbsedov(XSAdditiveModel): """The XSPEC bsedov model: sedov model, separate ion/electron temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT_a The mean shock temperature, in keV. kT_b The electron temperature immediately behind the shock front, in keV. See [1]_ for a discussion of the behavior of kT_a and kT_b. Abundanc The metal abundance of the plasma, as defined by the ``set_xsabund`` function. Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvsedov, XSbvvsedov, XSsedov References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelSedov.html """ __function__ = "C_bsedov" def __init__(self, name='bsedov'): self.kT_a = XSParameter(name, 'kT_a', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.kT_b = XSParameter(name, 'kT_b', 0.5, 0.0100, 79.9, 0.0100, 79.9, units='keV') self.Abundanc = XSParameter(name, 'Abundanc', 1.0, 0., 1000., 0.0, 10000, frozen=True) self.Tau = XSParameter(name, 'Tau', 1.e11, 1.e8, 5.e13, 1e8, 5e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT_a, self.kT_b, self.Abundanc, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbvapec(XSAdditiveModel): """The XSPEC bvapec model: velocity broadened APEC thermal plasma model. The model is described at [1]_, with ``XSbapec`` describing how it is implemented in Sherpa. .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT The temperature of the plasma, in keV. He, C, N, O, Ne, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance of the element in solar units. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSapec, XSbapec, XSbvvapec, XSvapec, XSvvapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBapec.html """ __function__ = "C_bvapec" def __init__(self, name='bvapec'): self.kT = XSParameter(name, 'kT', 6.5, 0.0808, 68.447, 0.0808, 68.447, units='keV') self.He = XSParameter(name, 'He', 1., 0., 1000., 0.0, 1000, frozen=True) self.C = XSParameter(name, 'C', 1., 0., 1000., 0.0, 1000, frozen=True) self.N = XSParameter(name, 'N', 1., 0., 1000., 0.0, 1000, frozen=True) self.O = XSParameter(name, 'O', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ne = XSParameter(name, 'Ne', 1., 0., 1000., 0.0, 1000, frozen=True) self.Mg = XSParameter(name, 'Mg', 1., 0., 1000., 0.0, 1000, frozen=True) self.Al = XSParameter(name, 'Al', 1., 0., 1000., 0.0, 1000, frozen=True) self.Si = XSParameter(name, 'Si', 1., 0., 1000., 0.0, 1000, frozen=True) self.S = XSParameter(name, 'S', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ar = XSParameter(name, 'Ar', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ca = XSParameter(name, 'Ca', 1., 0., 1000., 0.0, 1000, frozen=True) self.Fe = XSParameter(name, 'Fe', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ni = XSParameter(name, 'Ni', 1., 0., 1000., 0.0, 1000, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvcempow(XSAdditiveModel): """The XSPEC bvcempow model: plasma emission, multi-temperature using a power-law emission measure. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- alpha The power-law index of the emissivity function. Tmax The maximum temperature, in keV. nH H density, in cm^-3. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbcempow, XSvcempow References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCempow.html """ __function__ = "C_bvcempow" def __init__(self, name='bvcempow'): self.alpha = XSParameter(name, 'alpha', 1.0, min=0.01, max=10.0, hard_min=0.01, hard_max=20.0, frozen=True) self.Tmax = XSParameter(name, 'Tmax', 1.0, min=0.02725, max=100.0, hard_min=0.02725, hard_max=100.0, units='keV') self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.alpha, self.Tmax, self.nH, self.He, self.C, self.N, self.O, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvcheb6(XSAdditiveModel): """The XSPEC bvcheb6 model: differential emission measure using 6-order Chebyshev polynomial. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- CPcoef1, CPcoef2, CPcoef3, CPcoef4, CPcoef5, CPcoef6 Chebyshev polynomial coefficients. nH H density, in cm^-3. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbcheb6, XSvcheb6 References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCheb6.html """ __function__ = "C_bvcheb6" def __init__(self, name='bvcheb6'): self.CPcoef1 = XSParameter(name, 'CPcoef1', 1.0, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef2 = XSParameter(name, 'CPcoef2', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef3 = XSParameter(name, 'CPcoef3', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef4 = XSParameter(name, 'CPcoef4', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef5 = XSParameter(name, 'CPcoef5', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef6 = XSParameter(name, 'CPcoef6', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.CPcoef1, self.CPcoef2, self.CPcoef3, self.CPcoef4, self.CPcoef5, self.CPcoef6, self.nH, self.He, self.C, self.N, self.O, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvcie(XSAdditiveModel): """The XSPEC bvcie model: Emission spectrum from a plasma in Collisional-ionization equilibrium. The model is described at [1]_. Note that ``set_xsxset`` should be used to change the XSET settings. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- kT The plasma temperature in keV. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. The trace element abundaces are controlled by the "APEC_TRACE_ABUND" setting and default to 1.0. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See [1]_ for more details. See Also -------- XSbcie, XSbvvcie, XSvcie References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCie.html """ __function__ = "C_bvcie" def __init__(self, name='bvcie'): self.kT = XSParameter(name, 'kT', 6.5, min=0.0808, max=68.447, hard_min=0.0808, hard_max=68.447, units='keV') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.kT, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvcoolflow(XSAdditiveModel): """The XSPEC bvcoolflow model: cooling flow, mekal. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- lowT The low temperature in keV. highT The high temperature in keV. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The mass accretion rate (solar mass per year). See Also -------- XSbcoolflow, XSbcph, XSvcoolflow References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCoolflow.html """ __function__ = "C_bvcoolflow" def __init__(self, name='bvcoolflow'): self.lowT = XSParameter(name, 'lowT', 0.1, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.highT = XSParameter(name, 'highT', 4.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Redshift = mkRedshift(name, default=0.1, minval=0) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.lowT, self.highT, self.He, self.C, self.N, self.O, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvcph(XSAdditiveModel): """The XSPEC bvcph model: Cooling + heating model for cool core clusters. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- peakT The peak temperature in keV. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The mass accretion rate (solar mass per year). See Also -------- XSbcph, XSvcph References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCph.html """ __function__ = "C_bvcph" def __init__(self, name='bvcph'): self.peakT = XSParameter(name, 'peakT', 2.2, min=0.1, max=100.0, hard_min=0.1, hard_max=100.0, units='keV') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Redshift = XSParameter(name, 'Redshift', 0.0, min=0.0, max=50.0, hard_min=0.0, hard_max=50.0, frozen=True) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.peakT, self.He, self.C, self.N, self.O, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvequil(XSAdditiveModel): """The XSPEC bvequil model: collisional plasma, ionization equilibrium, The model is described at [1]_. Use the ``set_xsxset`` function to change the "NEIVERS" setting. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- kT The temperature in keV. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model. See Also -------- XSbequil, XSvequil References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelEquil.html """ __function__ = "C_bvequil" def __init__(self, name='bvequil'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvexpcheb6(XSAdditiveModel): """The XSPEC bvexpcheb6 model: differential emission measure using exponential of a 6-order Chebyshev polynomial. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- CPcoef1, CPcoef2, CPcoef3, CPcoef4, CPcoef5, CPcoef6 Chebyshev polynomial coefficients. nH H density, in cm^-3. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbcheb6, XSbexpcheb6, XSvexpcheb6 References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelExpcheb6.html """ __function__ = "C_bvexpcheb6" def __init__(self, name='bvexpcheb6'): self.CPcoef1 = XSParameter(name, 'CPcoef1', 1.0, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef2 = XSParameter(name, 'CPcoef2', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef3 = XSParameter(name, 'CPcoef3', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef4 = XSParameter(name, 'CPcoef4', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef5 = XSParameter(name, 'CPcoef5', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.CPcoef6 = XSParameter(name, 'CPcoef6', 0.5, min=-1.0, max=1.0, hard_min=-1.0, hard_max=1.0) self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.CPcoef1, self.CPcoef2, self.CPcoef3, self.CPcoef4, self.CPcoef5, self.CPcoef6, self.nH, self.He, self.C, self.N, self.O, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvgadem(XSAdditiveModel): """The XSPEC bvgadem model: plasma emission, multi-temperature with gaussian distribution of emission measure. The model is described at [1]_. The ``set_xsabund`` and ``get_xsabund`` functions change and return the current settings for the relative abundances of the metals. See the ``XSapec`` documentation for settings relevant to the APEC model (i.e. when ``switch=2``). .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- Tmean The mean temperature for the gaussian emission measure distribution, in keV. Tsigma The sigma of the temperature distribution for the gaussian emission measure, in keV. nH H density, in cm^-3. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbgadem, XSbvvgadem, XSvgadem References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelGadem.html """ __function__ = "C_bvgaussDem" def __init__(self, name='bvgadem'): self.Tmean = XSParameter(name, 'Tmean', 4.0, min=0.01, max=10.0, hard_min=0.01, hard_max=20.0, frozen=True, units='keV') self.Tsigma = XSParameter(name, 'Tsigma', 0.1, min=0.01, max=100.0, hard_min=0.01, hard_max=100.0, units='keV') self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.He = XSParameter(name, 'He', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=10.0, hard_min=0.0, hard_max=10.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.Tmean, self.Tsigma, self.nH, self.He, self.C, self.N, self.O, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvgnei(XSAdditiveModel): """The XSPEC bvgnei model: collisional plasma, non-equilibrium, temperature evolution. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Tau The ionization timescale in units of s/cm^3. meankT The ionization timescale averaged plasma temperature in keV. redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbgnei, XSbvvgnei, XSvgnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelGnei.html """ __function__ = "C_bvgnei" def __init__(self, name='bvgnei'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1.0, hard_min=0.0, hard_max=1.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Tau = XSParameter(name, 'Tau', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.meankT = XSParameter(name, 'meankT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Tau, self.meankT, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvnei(XSAdditiveModel): """The XSPEC bvnei model: collisional plasma, non-equilibrium, constant temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Tau The ionization timescale in units of s/cm^3. redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbnei, XSbvvnnei, XSvnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelNei.html """ __function__ = "C_bvnei" def __init__(self, name='bvnei'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1.0, hard_min=0.0, hard_max=1.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Tau = XSParameter(name, 'Tau', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvnpshock(XSAdditiveModel): """The XSPEC bvnpshock model: shocked plasma, plane parallel, separate ion, electron temperatures. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT_a The mean shock temperature, in keV. kT_b The electron temperature immediately behind the shock front, in keV. See [1]_ for a discussion of the behavior of kT_a and kT_b. H H abundance (set to 0 for no free-free continuum, otherwise 1). He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Tau_l The lower limit on the ionization timescale in s/cm^3. Tau_u The upper limit on the ionization timescale in s/cm^3. redshift The redshift of the source. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbnpshock, XSbvvnpshock, XSvnpshock References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelNpshock.html """ __function__ = "C_bvnpshock" def __init__(self, name='bvnpshock'): self.kT_a = XSParameter(name, 'kT_a', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.kT_b = XSParameter(name, 'kT_b', 0.5, min=0.01, max=79.9, hard_min=0.01, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1.0, hard_min=0.0, hard_max=1.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Tau_l = XSParameter(name, 'Tau_l', 0.0, min=0.0, max=50000000000000.0, hard_min=0.0, hard_max=50000000000000.0, frozen=True, units='s/cm^3') self.Tau_u = XSParameter(name, 'Tau_u', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT_a, self.kT_b, self.H, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Tau_l, self.Tau_u, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvpshock(XSAdditiveModel): """The XSPEC bvpshock model: plane-parallel shocked plasma, constant temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. H H abundance (set to 0 for no free-free continuum, otherwise 1). He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Tau_l The lower limit on the ionization timescale, in s/cm^3. Tau_u The upper limit on the ionization timescale, in s/cm^3. redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbpshock, XSbvvpshock, XSvpshock References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelPshock.html """ __function__ = "C_bvpshock" def __init__(self, name='bvpshock'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1.0, hard_min=0.0, hard_max=1.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Tau_l = XSParameter(name, 'Tau_l', 0.0, min=0.0, max=50000000000000.0, hard_min=0.0, hard_max=50000000000000.0, frozen=True, units='s/cm^3') self.Tau_u = XSParameter(name, 'Tau_u', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Tau_l, self.Tau_u, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbvrnei(XSAdditiveModel): """The XSPEC bvrnei model: velocity-broadened non-equilibrium recombining collisional plasma. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT The temperature of the plasma, in keV. kT_init The initial temperature of the plasma, in keV. H, He, C, N, O, Ne, Mg, Si, S, Ar, Ca, Fe, Ni The abundance of the element in solar units. Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbrnei, XSbvvrnei, XSnei, XSgnei, XSrnei, XSvrnei, XSvvrnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBrnei.html """ __function__ = "C_bvrnei" def __init__(self, name='bvrnei'): self.kT = XSParameter(name, 'kT', 0.5, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.kT_init = XSParameter(name, 'kT_init', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.H = XSParameter(name, 'H', 1., 0., 1., 0.0, 1.0, frozen=True) self.He = XSParameter(name, 'He', 1., 0., 1000., 0.0, 10000., frozen=True) self.C = XSParameter(name, 'C', 1., 0., 1000., 0.0, 10000., frozen=True) self.N = XSParameter(name, 'N', 1., 0., 1000., 0.0, 10000., frozen=True) self.O = XSParameter(name, 'O', 1., 0., 1000., 0.0, 10000., frozen=True) self.Ne = XSParameter(name, 'Ne', 1., 0., 1000., 0.0, 10000., frozen=True) self.Mg = XSParameter(name, 'Mg', 1., 0., 1000., 0.0, 10000., frozen=True) self.Si = XSParameter(name, 'Si', 1., 0., 1000., 0.0, 10000., frozen=True) self.S = XSParameter(name, 'S', 1., 0., 1000., 0.0, 10000., frozen=True) self.Ar = XSParameter(name, 'Ar', 1., 0., 1000., 0.0, 10000., frozen=True) self.Ca = XSParameter(name, 'Ca', 1., 0., 1000., 0.0, 10000., frozen=True) self.Fe = XSParameter(name, 'Fe', 1., 0., 1000., 0.0, 10000., frozen=True) self.Ni = XSParameter(name, 'Ni', 1., 0., 1000., 0.0, 10000., frozen=True) self.Tau = XSParameter(name, 'Tau', 1.e11, 1.0e8, 5.0e13, 1.0e8, 5.0e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.kT_init, self.H, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvsedov(XSAdditiveModel): """The XSPEC bvsedov model: sedov model, separate ion/electron temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT_a The mean shock temperature, in keV. kT_b The electron temperature immediately behind the shock front, in keV. See [1]_ for a discussion of the behavior of kT_a and kT_b. H H abundance (set to 0 for no free-free continuum, otherwise 1). He, C, N, O, Ne, Na, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance relative to Solar. Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbsedov, XSbvvsedov, XSvsedov References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelSedov.html """ __function__ = "C_bvsedov" def __init__(self, name='bvsedov'): self.kT_a = XSParameter(name, 'kT_a', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.kT_b = XSParameter(name, 'kT_b', 0.5, min=0.01, max=79.9, hard_min=0.01, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1.0, hard_min=0.0, hard_max=1.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=10000.0, frozen=True) self.Tau = XSParameter(name, 'Tau', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT_a, self.kT_b, self.H, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbvtapec(XSAdditiveModel): """The XSPEC bvtapec model: velocity broadened APEC emission spectrum with separate continuum and line temperatures. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keywords "APECROOT" and "APEC_TRACE_ABUND". .. versionchanged:: 4.16.1 The Redshift and Velocity parameters are now frozen by default to match XSPEC. .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT Continuum temperature, in keV. kTi Line temperature, in keV. He, C, N, O, Ne, Mg, Al, Si, S, Ar, Ca, Fe, Ni The abundance of the element in solar units. The trace element abundances are determined by the APEC_TRACE_ABUND xset keyword (the default is 1.0). Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbapec, XSbtapec, XSbvvtapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBtapec.html """ __function__ = "C_bvtapec" def __init__(self, name='bvtapec'): self.kT = XSParameter(name, 'kT', 6.5, 0.0808, 68.447, 0.0808, 68.447, units='keV') self.kTi = XSParameter(name, 'kTi', 6.5, 0.0808, 68.447, 0.0808, 68.447, units='keV') self.He = XSParameter(name, 'He', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.C = XSParameter(name, 'C', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.N = XSParameter(name, 'N', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.O = XSParameter(name, 'O', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.S = XSParameter(name, 'S', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, 0., 1000., 0.0, 1000, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.kTi, self.He, self.C, self.N, self.O, self.Ne, self.Mg, self.Al, self.Si, self.S, self.Ar, self.Ca, self.Fe, self.Ni, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbvvapec(XSAdditiveModel): """The XSPEC bvvapec model: velocity broadened APEC thermal plasma model. The model is described at [1]_, with ``XSbapec`` describing how it is implemented in Sherpa. .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT The temperature of the plasma, in keV. 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 The abundance of the element in solar units. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSapec, XSbapec, XSbvapec, XSvapec, XSvvapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBapec.html """ __function__ = "C_bvvapec" def __init__(self, name='bvvapec'): self.kT = XSParameter(name, 'kT', 6.5, 0.0808, 68.447, 0.0808, 68.447, units='keV') self.H = XSParameter(name, 'H', 1., 0., 1000., 0.0, 1000, frozen=True) self.He = XSParameter(name, 'He', 1., 0., 1000., 0.0, 1000, frozen=True) self.Li = XSParameter(name, 'Li', 1., 0., 1000., 0.0, 1000, frozen=True) self.Be = XSParameter(name, 'Be', 1., 0., 1000., 0.0, 1000, frozen=True) self.B = XSParameter(name, 'B', 1., 0., 1000., 0.0, 1000, frozen=True) self.C = XSParameter(name, 'C', 1., 0., 1000., 0.0, 1000, frozen=True) self.N = XSParameter(name, 'N', 1., 0., 1000., 0.0, 1000, frozen=True) self.O = XSParameter(name, 'O', 1., 0., 1000., 0.0, 1000, frozen=True) self.F = XSParameter(name, 'F', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ne = XSParameter(name, 'Ne', 1., 0., 1000., 0.0, 1000, frozen=True) self.Na = XSParameter(name, 'Na', 1., 0., 1000., 0.0, 1000, frozen=True) self.Mg = XSParameter(name, 'Mg', 1., 0., 1000., 0.0, 1000, frozen=True) self.Al = XSParameter(name, 'Al', 1., 0., 1000., 0.0, 1000, frozen=True) self.Si = XSParameter(name, 'Si', 1., 0., 1000., 0.0, 1000, frozen=True) self.P = XSParameter(name, 'P', 1., 0., 1000., 0.0, 1000, frozen=True) self.S = XSParameter(name, 'S', 1., 0., 1000., 0.0, 1000, frozen=True) self.Cl = XSParameter(name, 'Cl', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ar = XSParameter(name, 'Ar', 1., 0., 1000., 0.0, 1000, frozen=True) self.K = XSParameter(name, 'K', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ca = XSParameter(name, 'Ca', 1., 0., 1000., 0.0, 1000, frozen=True) self.Sc = XSParameter(name, 'Sc', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ti = XSParameter(name, 'Ti', 1., 0., 1000., 0.0, 1000, frozen=True) self.V = XSParameter(name, 'V', 1., 0., 1000., 0.0, 1000, frozen=True) self.Cr = XSParameter(name, 'Cr', 1., 0., 1000., 0.0, 1000, frozen=True) self.Mn = XSParameter(name, 'Mn', 1., 0., 1000., 0.0, 1000, frozen=True) self.Fe = XSParameter(name, 'Fe', 1., 0., 1000., 0.0, 1000, frozen=True) self.Co = XSParameter(name, 'Co', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ni = XSParameter(name, 'Ni', 1., 0., 1000., 0.0, 1000, frozen=True) self.Cu = XSParameter(name, 'Cu', 1., 0., 1000., 0.0, 1000, frozen=True) self.Zn = XSParameter(name, 'Zn', 1., 0., 1000., 0.0, 1000, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvcie(XSAdditiveModel): """The XSPEC bvvcie model: Emission spectrum from a plasma in Collisional-ionization equilibrium. The model is described at [1]_. Note that ``set_xsxset`` should be used to change the XSET settings. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Parameters ---------- kT The plasma temperature in keV. H, He, Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S The abundance of the element in solar units. Cl, Ar, K, Ca, Sc, Ti, V, Cr, Mn, Fe, Co, Ni, Cu, Zn The abundance of the element in solar units. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See [1]_ for more details. See Also -------- XSbcie, XSbvcie, XSvvcie References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelCie.html """ __function__ = "C_bvvcie" def __init__(self, name='bvvcie'): self.kT = XSParameter(name, 'kT', 6.5, min=0.0808, max=68.447, hard_min=0.0808, hard_max=68.447, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.kT, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvgadem(XSAdditiveModel): """The XSPEC bvvgadem model: plasma emission, multi-temperature with gaussian distribution of emission measure. The model is described at [1]_. The ``set_xsabund`` and ``get_xsabund`` functions change and return the current settings for the relative abundances of the metals. See the ``XSapec`` documentation for settings relevant to the APEC model (i.e. when ``switch=2``). .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- Tmean The mean temperature for the gaussian emission measure distribution, in keV. Tsigma The sigma of the temperature distribution for the gaussian emission measure, in keV. nH H density, in cm^-3. 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 The abundance of the element in solar units. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model. See Also -------- XSbgadem, XSbvgadem, XSvvgadem References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelGadem.html """ __function__ = "C_bvvgaussDem" def __init__(self, name='bvvgadem'): self.Tmean = XSParameter(name, 'Tmean', 4.0, min=0.01, max=10.0, hard_min=0.01, hard_max=20.0, frozen=True, units='keV') self.Tsigma = XSParameter(name, 'Tsigma', 0.1, min=0.01, max=100.0, hard_min=0.01, hard_max=100.0, units='keV') self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) self.switch = mkswitch(name) pars = (self.Tmean, self.Tsigma, self.nH, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Redshift, self.Velocity, self.switch) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvgnei(XSAdditiveModel): """The XSPEC bvvgnei model: collisional plasma, non-equilibrium, temperature evolution. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. 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 The abundance of the element in solar units. Tau The ionization timescale in units of s/cm^3. meankT The ionization timescale averaged plasma temperature in keV. redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbgnei, XSbvgnei, XSvvgnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelGnei.html """ __function__ = "C_bvvgnei" def __init__(self, name='bvvgnei'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Tau = XSParameter(name, 'Tau', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.meankT = XSParameter(name, 'meankT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Tau, self.meankT, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvnei(XSAdditiveModel): """The XSPEC bvvnei model: collisional plasma, non-equilibrium, constant temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. 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 The abundance of the element in solar units. Tau The ionization timescale in units of s/cm^3. redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s). norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbnei, XSbvnnei, XSvvnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelNei.html """ __function__ = "C_bvvnei" def __init__(self, name='bvvnei'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Tau = XSParameter(name, 'Tau', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvnpshock(XSAdditiveModel): """The XSPEC bvvnpshock model: shocked plasma, plane parallel, separate ion, electron temperatures. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT_a The mean shock temperature, in keV. kT_b The electron temperature immediately behind the shock front, in keV. See [1]_ for a discussion of the behavior of kT_a and kT_b. H H abundance (set to 0 for no free-free continuum, otherwise 1). 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 The abundance of the element in solar units. Tau_l The lower limit on the ionization timescale in s/cm^3. Tau_u The upper limit on the ionization timescale in s/cm^3. redshift The redshift of the source. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbnpshock, XSbvnpshock, XSvvnpshock References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelNpshock.html """ __function__ = "C_bvvnpshock" def __init__(self, name='bvvnpshock'): self.kT_a = XSParameter(name, 'kT_a', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.kT_b = XSParameter(name, 'kT_b', 0.5, min=0.01, max=79.9, hard_min=0.01, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Tau_l = XSParameter(name, 'Tau_l', 0.0, min=0.0, max=50000000000000.0, hard_min=0.0, hard_max=50000000000000.0, frozen=True, units='s/cm^3') self.Tau_u = XSParameter(name, 'Tau_u', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT_a, self.kT_b, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Tau_l, self.Tau_u, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvpshock(XSAdditiveModel): """The XSPEC bvvpshock model: plane-parallel shocked plasma, constant temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT The temperature of the plasma, in keV. H H abundance (set to 0 for no free-free continuum, otherwise 1). 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 The abundance of the element in solar units. Tau_l The lower limit on the ionization timescale, in s/cm^3. Tau_u The upper limit on the ionization timescale, in s/cm^3. redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbpshock, XSbvpshock, XSvvpshock References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelPshock.html """ __function__ = "C_bvvpshock" def __init__(self, name='bvvpshock'): self.kT = XSParameter(name, 'kT', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Tau_l = XSParameter(name, 'Tau_l', 0.0, min=0.0, max=50000000000000.0, hard_min=0.0, hard_max=50000000000000.0, frozen=True, units='s/cm^3') self.Tau_u = XSParameter(name, 'Tau_u', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Tau_l, self.Tau_u, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbvvrnei(XSAdditiveModel): """The XSPEC bvvrnei model: velocity-broadened non-equilibrium recombining collisional plasma. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT The temperature of the plasma, in keV. kT_init The initial temperature of the plasma, in keV. 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 The abundance of the element in solar units. Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbrnei, XSbvrnei, XSnei, XSgnei, XSrnei, XSvrnei, XSvvrnei References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBrnei.html """ __function__ = "C_bvvrnei" def __init__(self, name='bvvrnei'): self.kT = XSParameter(name, 'kT', 0.5, 0.0808, 79.9, 0.0808, 79.9, units='keV') self.kT_init = XSParameter(name, 'kT_init', 1.0, 0.0808, 79.9, 0.0808, 79.9, units='keV') maxval = 1000.0 self.H = XSParameter(name, 'H', 1., 0., 1000., 0.0, maxval, frozen=True) self.He = XSParameter(name, 'He', 1., 0., 1000., 0.0, maxval, frozen=True) self.Li = XSParameter(name, 'Li', 1., 0., 1000., 0.0, maxval, frozen=True) self.Be = XSParameter(name, 'Be', 1., 0., 1000., 0.0, maxval, frozen=True) self.B = XSParameter(name, 'B', 1., 0., 1000., 0.0, maxval, frozen=True) self.C = XSParameter(name, 'C', 1., 0., 1000., 0.0, maxval, frozen=True) self.N = XSParameter(name, 'N', 1., 0., 1000., 0.0, maxval, frozen=True) self.O = XSParameter(name, 'O', 1., 0., 1000., 0.0, maxval, frozen=True) self.F = XSParameter(name, 'F', 1., 0., 1000., 0.0, maxval, frozen=True) self.Ne = XSParameter(name, 'Ne', 1., 0., 1000., 0.0, maxval, frozen=True) self.Na = XSParameter(name, 'Na', 1., 0., 1000., 0.0, maxval, frozen=True) self.Mg = XSParameter(name, 'Mg', 1., 0., 1000., 0.0, maxval, frozen=True) self.Al = XSParameter(name, 'Al', 1., 0., 1000., 0.0, maxval, frozen=True) self.Si = XSParameter(name, 'Si', 1., 0., 1000., 0.0, maxval, frozen=True) self.P = XSParameter(name, 'P', 1., 0., 1000., 0.0, maxval, frozen=True) self.S = XSParameter(name, 'S', 1., 0., 1000., 0.0, maxval, frozen=True) self.Cl = XSParameter(name, 'Cl', 1., 0., 1000., 0.0, maxval, frozen=True) self.Ar = XSParameter(name, 'Ar', 1., 0., 1000., 0.0, maxval, frozen=True) self.K = XSParameter(name, 'K', 1., 0., 1000., 0.0, maxval, frozen=True) self.Ca = XSParameter(name, 'Ca', 1., 0., 1000., 0.0, maxval, frozen=True) self.Sc = XSParameter(name, 'Sc', 1., 0., 1000., 0.0, maxval, frozen=True) self.Ti = XSParameter(name, 'Ti', 1., 0., 1000., 0.0, maxval, frozen=True) self.V = XSParameter(name, 'V', 1., 0., 1000., 0.0, maxval, frozen=True) self.Cr = XSParameter(name, 'Cr', 1., 0., 1000., 0.0, maxval, frozen=True) self.Mn = XSParameter(name, 'Mn', 1., 0., 1000., 0.0, maxval, frozen=True) self.Fe = XSParameter(name, 'Fe', 1., 0., 1000., 0.0, maxval, frozen=True) self.Co = XSParameter(name, 'Co', 1., 0., 1000., 0.0, maxval, frozen=True) self.Ni = XSParameter(name, 'Ni', 1., 0., 1000., 0.0, maxval, frozen=True) self.Cu = XSParameter(name, 'Cu', 1., 0., 1000., 0.0, maxval, frozen=True) self.Zn = XSParameter(name, 'Zn', 1., 0., 1000., 0.0, maxval, frozen=True) self.Tau = XSParameter(name, 'Tau', 1.e11, 1.0e8, 5.0e13, 1.0e8, 5.0e13, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.kT_init, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvsedov(XSAdditiveModel): """The XSPEC bvvsedov model: sedov model, separate ion/electron temperature. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET parameters, in particular the keyword "NEIVERS". .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- kT_a The mean shock temperature, in keV. kT_b The electron temperature immediately behind the shock front, in keV. See [1]_ for a discussion of the behavior of kT_a and kT_b. H H abundance (set to 0 for no free-free continuum, otherwise 1). 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 The abundance of the element in solar units. Tau The ionization timescale in units of s/cm^3. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbsedov, XSbvsedov, XSvvsedov References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelSedov.html """ __function__ = "C_bvvsedov" def __init__(self, name='bvvsedov'): self.kT_a = XSParameter(name, 'kT_a', 1.0, min=0.0808, max=79.9, hard_min=0.0808, hard_max=79.9, units='keV') self.kT_b = XSParameter(name, 'kT_b', 0.5, min=0.01, max=79.9, hard_min=0.01, hard_max=79.9, units='keV') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V = XSParameter(name, 'V', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cr = XSParameter(name, 'Cr', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mn = XSParameter(name, 'Mn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Fe = XSParameter(name, 'Fe', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Co = XSParameter(name, 'Co', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ni = XSParameter(name, 'Ni', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cu = XSParameter(name, 'Cu', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Zn = XSParameter(name, 'Zn', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Tau = XSParameter(name, 'Tau', 100000000000.0, min=100000000.0, max=50000000000000.0, hard_min=100000000.0, hard_max=50000000000000.0, units='s/cm^3') self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT_a, self.kT_b, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Tau, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] class XSbvvtapec(XSAdditiveModel): """The XSPEC bvvtapec model: velocity broadened APEC emission spectrum with separate continuum and line temperatures. The model is described at [1]_. The ``set_xsxset`` and ``get_xsxset`` functions are used to set and query the XSPEC XSET "APECROOT" parameter. .. versionchanged:: 4.16.1 The Redshift and Velocity parameters are now frozen by default to match XSPEC. .. versionchanged:: 4.16.0 The maximum for the Velocity parameter has been changed from 10^6 to 10^4 km/s. Attributes ---------- kT Continuum temperature, in keV. kTi Line temperature, in keV. 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 The abundance of the element in solar units. Redshift The redshift of the plasma. Velocity The gaussian sigma of the velocity broadening, in km/s. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbapec, XSbtapec References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelBtapec.html """ __function__ = "C_bvvtapec" def __init__(self, name='bvvtapec'): self.kT = XSParameter(name, 'kT', 6.5, 0.0808, 68.447, 0.0808, 68.447, units='keV') self.kTi = XSParameter(name, 'kTi', 6.5, 0.0808, 68.447, 0.0808, 68.447, units='keV') self.H = XSParameter(name, 'H', 1., 0., 1000., 0.0, 1000, frozen=True) self.He = XSParameter(name, 'He', 1., 0., 1000., 0.0, 1000, frozen=True) self.Li = XSParameter(name, 'Li', 1., 0., 1000., 0.0, 1000, frozen=True) self.Be = XSParameter(name, 'Be', 1., 0., 1000., 0.0, 1000, frozen=True) self.B = XSParameter(name, 'B', 1., 0., 1000., 0.0, 1000, frozen=True) self.C = XSParameter(name, 'C', 1., 0., 1000., 0.0, 1000, frozen=True) self.N = XSParameter(name, 'N', 1., 0., 1000., 0.0, 1000, frozen=True) self.O = XSParameter(name, 'O', 1., 0., 1000., 0.0, 1000, frozen=True) self.F = XSParameter(name, 'F', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ne = XSParameter(name, 'Ne', 1., 0., 1000., 0.0, 1000, frozen=True) self.Na = XSParameter(name, 'Na', 1., 0., 1000., 0.0, 1000, frozen=True) self.Mg = XSParameter(name, 'Mg', 1., 0., 1000., 0.0, 1000, frozen=True) self.Al = XSParameter(name, 'Al', 1., 0., 1000., 0.0, 1000, frozen=True) self.Si = XSParameter(name, 'Si', 1., 0., 1000., 0.0, 1000, frozen=True) self.P = XSParameter(name, 'P', 1., 0., 1000., 0.0, 1000, frozen=True) self.S = XSParameter(name, 'S', 1., 0., 1000., 0.0, 1000, frozen=True) self.Cl = XSParameter(name, 'Cl', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ar = XSParameter(name, 'Ar', 1., 0., 1000., 0.0, 1000, frozen=True) self.K = XSParameter(name, 'K', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ca = XSParameter(name, 'Ca', 1., 0., 1000., 0.0, 1000, frozen=True) self.Sc = XSParameter(name, 'Sc', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ti = XSParameter(name, 'Ti', 1., 0., 1000., 0.0, 1000, frozen=True) self.V = XSParameter(name, 'V', 1., 0., 1000., 0.0, 1000, frozen=True) self.Cr = XSParameter(name, 'Cr', 1., 0., 1000., 0.0, 1000, frozen=True) self.Mn = XSParameter(name, 'Mn', 1., 0., 1000., 0.0, 1000, frozen=True) self.Fe = XSParameter(name, 'Fe', 1., 0., 1000., 0.0, 1000, frozen=True) self.Co = XSParameter(name, 'Co', 1., 0., 1000., 0.0, 1000, frozen=True) self.Ni = XSParameter(name, 'Ni', 1., 0., 1000., 0.0, 1000, frozen=True) self.Cu = XSParameter(name, 'Cu', 1., 0., 1000., 0.0, 1000, frozen=True) self.Zn = XSParameter(name, 'Zn', 1., 0., 1000., 0.0, 1000, frozen=True) self.Redshift = mkRedshift(name) self.Velocity = mkVelocity(name) pars = (self.kT, self.kTi, self.H, self.He, self.Li, self.Be, self.B, self.C, self.N, self.O, self.F, self.Ne, self.Na, self.Mg, self.Al, self.Si, self.P, self.S, self.Cl, self.Ar, self.K, self.Ca, self.Sc, self.Ti, self.V, self.Cr, self.Mn, self.Fe, self.Co, self.Ni, self.Cu, self.Zn, self.Redshift, self.Velocity) XSAdditiveModel.__init__(self, name, pars)
[docs] @version_at_least("12.14.0") class XSbvvwdem(XSAdditiveModel): """The XSPEC bvvwdem model: plasma emission, multi-temperature with power-law distribution of emission measure. The model is described at [1]_. .. versionadded:: 4.16.1 This model requires XSPEC 12.14.0 or later. Attributes ---------- Tmax The maximum temperature for power-law emission measure distribution. beta The ratio of minimum to maxmum temperature. inv_slope The inverse of the slope (labelled p in the XSPEC documentation). nH Fixed at 1 for most applications. 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 The abundance of the element in solar units. Redshift The redshift of the plasma. Velocity The gaussian sigma for the velocity broadening (in km/s) which is only used when switch > 1. switch If 0, the mekal code is run to evaluate the model; if 1 then interpolation of the mekal data is used; if 2 then interpolation of APEC data is used; if 3 then SPEX data. See [1]_ for more details. This parameter can not be thawed. norm The normalization of the model: see [1]_ for an explanation of the units. See Also -------- XSbvwdem, XSbwdem, XSvvwdem References ---------- .. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelWdem.html """ __function__ = "C_bvvwDem" def __init__(self, name='bvvwdem'): self.Tmax = XSParameter(name, 'Tmax', 1.0, min=0.01, max=10.0, hard_min=0.01, hard_max=20.0, units='keV') self.beta = XSParameter(name, 'beta', 0.1, min=0.01, max=1.0, hard_min=0.01, hard_max=1.0) self.inv_slope = XSParameter(name, 'inv_slope', 0.25, min=-1.0, max=10.0, hard_min=-1.0, hard_max=10.0) self.nH = XSParameter(name, 'nH', 1.0, min=1e-05, max=1e+19, hard_min=1e-06, hard_max=1e+20, frozen=True, units='cm^-3') self.H = XSParameter(name, 'H', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.He = XSParameter(name, 'He', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Li = XSParameter(name, 'Li', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Be = XSParameter(name, 'Be', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.B = XSParameter(name, 'B', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.C = XSParameter(name, 'C', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.N = XSParameter(name, 'N', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.O = XSParameter(name, 'O', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.F = XSParameter(name, 'F', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ne = XSParameter(name, 'Ne', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Na = XSParameter(name, 'Na', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Mg = XSParameter(name, 'Mg', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Al = XSParameter(name, 'Al', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Si = XSParameter(name, 'Si', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.P = XSParameter(name, 'P', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.S = XSParameter(name, 'S', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Cl = XSParameter(name, 'Cl', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ar = XSParameter(name, 'Ar', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.K = XSParameter(name, 'K', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ca = XSParameter(name, 'Ca', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Sc = XSParameter(name, 'Sc', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.Ti = XSParameter(name, 'Ti', 1.0, min=0.0, max=1000.0, hard_min=0.0, hard_max=1000.0, frozen=True) self.V =</