Spectral Models API

Photon emission and absoprtion models.

class pyxsim.spectral_models.AbsorptionModel(nH, energy, cross_section)[source]
absorb_photons(eobs, prng=None)[source]

Determine which photons will be absorbed by foreground galactic absorption.

Parameters
  • eobs (array_like) – The energies of the photons in keV.

  • prng (integer, RandomState object or random, optional) – A pseudo-random number generator. Typically will only be specified if you have a reason to generate the same set of random numbers, such as for a test. Default is the numpy.random module.

get_absorb(e)[source]

Get the absorption spectrum.

class pyxsim.spectral_models.TBabsModel(nH)[source]

Initialize a Tuebingen-Boulder (Wilms, J., Allen, A., & McCray, R. 2000, ApJ, 542, 914) ISM absorption model.

Parameters

nH (float) – The foreground column density in units of 10^22 cm^{-2}.

Examples

>>> tbabs_model = TBabsModel(0.1)
get_absorb(e)[source]

Get the absorption spectrum.

class pyxsim.spectral_models.TableApecModel(emin, emax, nchan, var_elem=None, model_root=None, model_vers=None, thermal_broad=True, nolines=False, abund_table='angr', nei=False)[source]

Initialize a thermal gas emission model from the AtomDB APEC tables available at http://www.atomdb.org. This code borrows heavily from Python routines used to read the APEC tables developed by Adam Foster at the CfA (afoster@cfa.harvard.edu).

Parameters
  • emin (float) – The minimum energy for the spectral model.

  • emax (float) – The maximum energy for the spectral model.

  • nchan (integer) – The number of channels in the spectral model. If one is thermally broadening lines, it is recommended that this value result in an energy resolution per channel of roughly 1 eV.

  • var_elem (list of strings, optional) – The names of elements to allow to vary freely from the single abundance parameter. Default: None

  • model_root (string, optional) – The directory root where the model files are stored. If not provided, the default SOXS-provided files are used.

  • model_vers (string, optional) – The version identifier string for the APEC files, e.g. “3.0.3”. Default: 3.0.8

  • thermal_broad (boolean, optional) – Whether or not the spectral lines should be thermally broadened. Default: True

  • nolines (boolean, optional) – Turn off lines entirely for generating spectra. Default: False

  • abund_table (string or array_like, optional) – The abundance table to be used for solar abundances. Either a string corresponding to a built-in table or an array of 30 floats corresponding to the abundances of each element relative to the abundance of H. Default is “angr”. Built-in options are: “angr” : from Anders E. & Grevesse N. (1989, Geochimica et Cosmochimica Acta 53, 197) “aspl” : from Asplund M., Grevesse N., Sauval A.J. & Scott P. (2009, ARAA, 47, 481) “wilm” : from Wilms, Allen & McCray (2000, ApJ 542, 914 except for elements not listed which are given zero abundance) “lodd” : from Lodders, K (2003, ApJ 591, 1220)

  • nei (boolean, optional) – If True, use the non-equilibrium ionization tables. These are not supplied with pyXSIM/SOXS but must be downloaded separately, in which case the apec_root parameter must also be set to their location. Default: False

Examples

>>> apec_model = TableApecModel(0.05, 50.0, 1000, apec_vers="3.0.3",
...                             thermal_broad=False)
return_spectrum(temperature, metallicity, redshift, norm, velocity=0.0, elem_abund=None)[source]

Given the properties of a thermal plasma, return a spectrum.

Parameters
  • temperature (float) – The temperature of the plasma in keV.

  • metallicity (float) – The metallicity of the plasma in solar units.

  • redshift (float) – The redshift of the plasma.

  • norm (float) – The normalization of the model, in the standard Xspec units of 1.0e-14*EM/(4*pi*(1+z)**2*D_A**2).

  • velocity (float, optional) – Velocity broadening parameter in km/s. Default: 0.0

  • elem_abund (dict of element name, float pairs) – A dictionary of elemental abundances to vary freely of the abund parameter. Default: None

class pyxsim.spectral_models.WabsModel(nH)[source]

Initialize a Wisconsin (Morrison and McCammon; ApJ 270, 119) absorption model.

Parameters

nH (float) – The foreground column density in units of 10^22 cm^{-2}.

Examples

>>> wabs_model = WabsModel(0.1)
get_absorb(e)[source]

Get the absorption spectrum.