6.1.3.3. Ascdump commands

The SPEX ascdump command is designed to return internal model parameters in SPEX through terminal output or an ASCII file. With pyspex we can return these numbers in a python object, making them directly available in your script. The outputs below have currently been implemented. Each command returns a specific object with the parameters. A link to the object structure is provided with every command (see return type).

6.1.3.3.1. Basic plasma parameters

Session.ascdump_plas(isect, icomp)[source]

Basic plasma properties like temperature, electron density etc.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump plasma object

Return type

pyspex.ascdump.Plas

Example:

>>> s.com('cie')
>>> asc = s.ascdump_plas(1, 1)
 number of layer lines :        4156           0
>>> print(asc.cs)
507.26305074069296      # Sound speed in km/s

6.1.3.3.2. Abundances

Session.ascdump_abun(isect, icomp)[source]

Elemental abundances and average charge per element.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump abundance object

Return type

pyspex.ascdump.Abun

Example:

>>> s.com('cie')
>>> asc = s.ascdump_abun(1,1)
 number of layer lines :        4156           0
>>> print(asc.name)
['H' 'He' 'C' 'N' 'O' 'Ne' 'Na' 'Mg' 'Al' 'Si' 'S' 'Ar' 'Ca' 'Fe' 'Ni']

Note

For some versions of numpy, returning a character array leads to a ValueError.

6.1.3.3.3. Ion concentrations

Session.ascdump_icon(isect, icomp)[source]

Ion concentrations, both with respect to Hydrogen and the relevant elemental abundance.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump ion concentrations object

Return type

pyspex.ascdump.Icon

Example:

>>> s.com('cie')
>>> asc = s.ascdump_icon(1,1)
 number of layer lines :        4156           0
>>> print(asc.conrel[0])
1.70394098831e-08

Note

For some versions of numpy, returning a character array leads to a ValueError.

6.1.3.3.4. Rates per ion

Session.ascdump_rate(isect, icomp)[source]

Total ionization, recombination and charge-transfer rates specified per ion.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump rate object

Return type

pyspex.ascdump.Rate

Example:

>>> s.com('cie')
>>> asc = s.ascdump_rate(1,1)
 number of layer lines :        4156           0
>>> print(asc.irate[0])
2.12289918977e-08

6.1.3.3.5. Rates per process

Session.ascdump_rion(isect, icomp)[source]

Ionization rates per atomic subshell, specified according to the different contributing processes.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump rion object

Return type

pyspex.ascdump.Rion

Example:

>>> s.com('cie')
>>> asc = s.ascdump_rion(1,1)
 number of layer lines :        4156           0
>>> print(asc.elion[0])
2.12289912301e-08

6.1.3.3.6. Level populations

Session.ascdump_pop(isect, icomp)[source]

The occupation numbers as well as upwards/downwards loss and gain rates to all quantum levels included.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump pop object

Return type

pyspex.ascdump.Pop

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_pop(1,1)
 number of layer lines :     3511799           0
>>> print(asc.nlev)
111262

6.1.3.3.7. Electron collision excitation and de-excitation rates

Session.ascdump_elex(isect, icomp)[source]

The electron collision excitation and de-excitation rates.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump Elex object

Return type

pyspex.ascdump.Elex

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_elex(1,1)
 number of layer lines :     3511799           0
>>> print(asc.exrate)
[8.35325837e-09 1.08863779e-09 1.68747116e-08 ... 4.41492557e-10
 2.50513539e-10 6.16963868e-12]

6.1.3.3.8. Proton collision excitation and de-excitation rates

Session.ascdump_prex(isect, icomp)[source]

The proton collision excitation and de-excitation rates.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump Prex object

Return type

pyspex.ascdump.Prex

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_prex(1,1)
 number of layer lines :     3511799           0
>>> print(asc.exrate)
[1.01738931e-10 4.81612313e-12 2.07581551e-10 1.92587482e-11
 ...
 7.49964952e-17 7.82087768e-17 1.67573062e-16 2.56251319e-17]

6.1.3.3.9. Radiative transition rates

Session.ascdump_rad(isect, icomp)[source]

The radiative transition rates from each level.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump Rad object

Return type

pyspex.ascdump.Rad

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_rad(1,1)
 number of layer lines :     3511799           0

6.1.3.3.10. Two-photon emission

Session.ascdump_two(isect, icomp)[source]

The two-photon emission transition rates from each level.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump Two object

Return type

pyspex.ascdump.Two

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_two(1,1)
 number of layer lines :     3511799           0
>>> print(asc.prob)
[8.22910023e+00 5.09000015e+01 5.26599976e+02 1.94000000e+03
 ...
 4.76030003e+09 9.88000051e+09 5.82309990e+09]

6.1.3.3.11. Recombination timescale

Session.ascdump_time(isect, icomp)[source]

Recombination time scale per ion according to the Bottorf et al. (2000) definition, and relative ion concentrations. Note that the recombination time scale depends upon the hydrogen density, so do not forget to set the relevant density in the model.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump Two object

Return type

pyspex.ascdump.Time

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_time(1,1)
>>> print(asc.texp)
[39107415.99632238 -2295115632800309.5 -196243868063781.56
 ...
 -155719028701.42026]

6.1.3.3.12. Recombination and inner-shell ionisation

Session.ascdump_rec(isect, icomp)[source]

Outputs for each atomic level the populating contributions from radiative, dielectronic and charge exchange recombination, as well as inner-shell ionisation.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump Rec object

Return type

pyspex.ascdump.Rec

Example:

>>> s.com('cie')
>>> s.var_calc(True)
>>> asc = s.ascdump_rec(1,1)
>>> print(asc.arr)
[1.88556293e-08 3.16058547e-10 2.52684149e-09 ... 0.00000000e+00
 0.00000000e+00 0.00000000e+00]

6.1.3.3.13. Energy and wavelength grid

Session.ascdump_grid(isect, icomp)[source]

The energy and wavelength grid used in the last evaluation of the spectrum.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump grid object

Return type

pyspex.ascdump.Grid

Example:

>>> s.com('cie')
>>> asc = s.ascdump_grid(1,1)
 number of layer lines :        4156           0
>>> print(asc.emean[0])
0.00100070331246

6.1.3.3.14. Continuum and line spectra

Session.ascdump_clin(isect, icomp)[source]

The continuum, line and total spectrum for each energy bin for the last plasma layer of the model.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump clin object

Return type

pyspex.ascdump.Clin

Example:

>>> s.com('cie')
>>> asc = s.ascdump_clin(1,1)
 number of layer lines :        4156           0
>>> dir(asc)
['__doc__', '__init__', '__module__', 'emean', 'flux', 'fluxcon', 'fluxlin', 'get', 'ibin', 'nbin']

And the total for all the plasma layers:

Session.ascdump_tcl(isect, icomp)[source]

The continuum, line and total spectrum for each energy bin added for all plasma layers of the model.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump tcl object

Return type

pyspex.ascdump.Tcl

Example:

>>> s.com('cie')
>>> asc = s.ascdump_tcl(1,1)
 number of layer lines :        4156           0
>>> dir(asc)
['__doc__', '__init__', '__module__', 'emean', 'flux', 'fluxcon', 'fluxlin', 'get', 'ibin', 'nbin']

6.1.3.3.15. Line emission

Session.ascdump_line(isect, icomp, sort='ener', erange=0.1, 10.0, fluxlim=1e+35)[source]

The line energy and wavelength, as well as the total line emission (photons/s) for each line contributing to the spectrum, for the last plasma layer of the model. Also given is the natural line width and the Doppler broadening (including thermal and turbulent broadening), expressed as a FWHM in keV.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

  • sort (str) – Column to sort.

  • erange (Tuple) – Energy range for output.

  • fluxlim (float) – Minimum line emissivity to show (in photons/s).

Returns

Ascdump Line object

Return type

pyspex.ascdump.Line

Example:

>>> s.com('cie')
>>> asc = s.ascdump_line(1,1)
>>> asc = s.ascdump_line(1,1)
 number of layer lines :     3511799           0
--------------------------------------------------------------------
The following selection criteria were used to generate this output:
Energy range between   0.100000     and    10.0000     keV.
Minimum flux level:   1.000000E+35
See the ascdump set command to change the criteria.
>>> print(asc.flux)
[3.40979220e+35 1.99786227e+35 1.76156817e+37 ... 1.33953384e+35
 1.85409623e+35 1.08065805e+35]

6.1.3.3.16. Ion contribution to the continuum

Session.ascdump_con(isect, icomp)[source]

List of the ions that contribute to the free-free, free-bound and two-photon continuum emission, followed by the free-free, free-bound, two-photon and total continuum spectrum for the last plasma layer of the model.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump con object

Return type

pyspex.ascdump.Con

Example:

>>> s.com('cie')
>>> asc = s.ascdump_con(1,1)

The total contribution for all plasma layers:

Session.ascdump_tcon(isect, icomp)[source]

List of the ions that contribute to the free-free, free-bound and two-photon continuum emission, followed by the free-free, free-bound, two-photon and total continuum spectrum added for all plasma layers of the model.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump con object

Return type

pyspex.ascdump.Tcon

Example:

>>> s.com('cie')
>>> asc = s.ascdump_tcon(1,1)

6.1.3.3.17. History of ionisation and temperature in NEI

Session.ascdump_nei(isect, icomp)[source]

The history of ionisation parameter and temperature in NEI calculations.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump nei object

Return type

pyspex.ascdump.Nei

Example:

>>> s.com('nei')
>>> asc = s.ascdump_nei(1,1)
 number of layer lines :        4269           0
>>> dir(asc)
['__doc__', '__init__', '__module__', 'get', 'kt', 'nbin', 'u']

6.1.3.3.18. Plasma heating rates (photo-ionized)

Session.ascdump_heat(isect, icomp)[source]

Plasma heating rates (only for photoionized plasmas).

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump heat object

Return type

pyspex.ascdump.Heat

Example:

>>> s.com('po')
 You have defined    1 component.
>>> s.com('pion')
 You have defined    2 components.
 ** Pion model: take care about proper COM REL use: check manual!
>>> s.com_rel(1, 1, numpy.array([2]))
>>> asc = s.ascdump_heat(1,2)
>>> dir(asc)
['__doc__', '__init__', '__module__', 'cool', 'cooladi', 'coolcom', 'cooldr', 'coolexc', 'coolffe', 'coolion', 'coolrec', 'get', 'heat', 'heataug', 'heatcio', 'heatcom', 'heatdex', 'heatext', 'heatffa', 'heatphi']

6.1.3.3.19. Energy balance

Session.ascdump_ebal(isect, icomp)[source]

Obtain the cooling and heating balance from the model for each model iteration (photoionization models only).

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump ebal object

Return type

pyspex.ascdump.Ebal

Example:

>>> s.com('po')
 You have defined    1 component.
>>> s.com('pion')
 You have defined    2 components.
 ** Pion model: take care about proper COM REL use: check manual!
>>> s.com_rel(1, 1, numpy.array([2]))
>>> asc = s.ascdump_ebal(1,2)
>>> print(asc.cooladi)
[5.51856103e-44 9.20874021e-44 1.53654277e-43 2.56369787e-43
 ...
 2.17232976e-42 2.17207890e-42]

6.1.3.3.20. Ionic column densities in absorption

Session.ascdump_col(isect, icomp)[source]

The ionic column densities for the hot, pion, slab, xabs and warm models.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump col object

Return type

pyspex.ascdump.Col

Example:

>>> asc = s.ascdump_col(1,2)
>>> dir(asc)
['__doc__', '__init__', '__module__', 'atom', 'column', 'get', 'ion', 'logcol', 'name', 'nline', 'roman']

6.1.3.3.21. Transmission of absorption lines and edges

For both lines and edges:

Session.ascdump_tran(isect, icomp, sortn='ener')[source]

In two subsequent objects, the transmission and equivalent width of absorption lines (asc.line) and absorption edges (asc.edge) are listed for the hot, pion, slab, xabs and warm models. Optionally, the lines can be sorted according to one of the output parameters. See the sortn option for details.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

  • sortn (str) – Sort the data based on column: energy (ener), wavelength (wav), ion (ion), line power (powe), natural line width (wid).

Returns

Ascdump tran object

Return type

pyspex.ascdump.Tran

For lines only:

Session.ascdump_tranline(isect, icomp, sortn='ener')[source]

The transmission and equivalent width of absorption lines for the hot, pion, slab, xabs, and warm models. Optionally, the lines can be sorted according to one of the output parameters. See the sortn option for details.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

  • sortn (str) – Sort the data based on column: energy (ener), wavelength (wav), ion (ion), line power (powe), natural line width (wid).

Returns

Ascdump tran object

Return type

pyspex.ascdump.Tranline

For edges only:

Session.ascdump_tranedge(isect, icomp)[source]

The transmission and equivalent width of absorption edges for the hot, pion, slab, xabs, and warm models.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump tran object

Return type

pyspex.ascdump.Tranedge

Example:

>>> s.com('po')
>>> s.com('pion')
>>> s.com_rel(1,1,numpy.array([2]))
>>> asc = s.ascdump_tranedge(1,2)
>>> print(asc.ew)
[7.63924345e-06 2.29914061e-04 7.08947133e-04 1.54622412e-05
 ...
 4.60384717e-06 7.68042719e-06]

6.1.3.3.22. Properties of the warm model

Session.ascdump_warm(isect, icomp)[source]

The column densities, effective ionization parameters and temperatures of the warm model.

Parameters
  • isect (int) – Sector number.

  • icomp (int) – Component number.

Returns

Ascdump warm object

Return type

pyspex.ascdump.Warm

Example:

>>> asc = s.ascdump_warm(1,2)
>>> dir(asc)
['__doc__', '__init__', '__module__', 'atom', 'col', 'dndlnxi', 'get', 'ion', 'name', 'nline', 'nxil', 'roman', 't', 'xi', 'xilgrid']