You can interact with this notebook online: Launch notebook

How to Access Physical Quantities

In order to compute the synthetic spectrum, TARDIS must either be told or must calculate many physical properties of the model. To understand and test the code it can be important to look at these values. One easy way to do this is to run TARDIS in an interactive mode and then inspect the model properties.

Running an interactive Python session

[1]:
# Download the atomic data
from tardis.io.atom_data import download_atom_data
download_atom_data('kurucz_cd23_chianti_H_He')

# Download the example configuration file
!curl -O https://raw.githubusercontent.com/tardis-sn/tardis/master/docs/tardis_example.yml
Atomic Data kurucz_cd23_chianti_H_He already exists in /home/runner/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5. Will not download - override with force_download=True.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   980  100   980    0     0  11239      0 --:--:-- --:--:-- --:--:-- 11264
[2]:
from tardis import run_tardis

simulation = run_tardis('tardis_example.yml')
[tardis.io.model.parse_atom_data][INFO   ]

        Reading Atomic Data from kurucz_cd23_chianti_H_He.h5 (parse_atom_data.py:40)
[tardis.io.atom_data.util][INFO   ]

        Atom Data kurucz_cd23_chianti_H_He.h5 not found in local path.
        Exists in TARDIS Data repo /home/runner/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5 (util.py:34)
[tardis.io.atom_data.base][INFO   ]
        Reading Atom Data with: UUID = 6f7b09e887a311e7a06b246e96350010 MD5  = 864f1753714343c41f99cb065710cace  (base.py:258)
[tardis.io.atom_data.base][INFO   ]
        Non provided Atomic Data: synpp_refs, photoionization_data, yg_data, two_photon_data, linelist_atoms, linelist_molecules (base.py:262)
[tardis.io.model.parse_density_configuration][WARNING]
        Number of density points larger than number of shells. Assuming inner point irrelevant (parse_density_configuration.py:114)
[tardis.model.matter.decay][INFO   ]
        Decaying abundances for 1123200.0 seconds (decay.py:101)
[tardis.simulation.base][INFO   ]

        Starting iteration 1 of 20 (base.py:444)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:

unsafe cast from uint64 to int64. Precision may be lost.

 (warnings.py:112)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 7.942e+42 erg / s
        Luminosity absorbed  = 2.659e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 9.93e+03 K 1.01e+04 K 0.4 0.507
5 9.85e+03 K 1.02e+04 K 0.211 0.197
10 9.78e+03 K 1.02e+04 K 0.143 0.117
15 9.71e+03 K 9.88e+03 K 0.105 0.0868
[tardis.simulation.base][INFO   ]

        Current t_inner = 9933.952 K
        Expected t_inner for next iteration = 10703.327 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 2 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.071e+43 erg / s
        Luminosity absorbed  = 3.577e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.01e+04 K 1.08e+04 K 0.507 0.524
5 1.02e+04 K 1.1e+04 K 0.197 0.202
10 1.02e+04 K 1.08e+04 K 0.117 0.124
15 9.88e+03 K 1.05e+04 K 0.0868 0.0926
[tardis.simulation.base][INFO   ]

        Current t_inner = 10703.327 K
        Expected t_inner for next iteration = 10673.709 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 3 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.074e+43 erg / s
        Luminosity absorbed  = 3.397e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 1/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.08e+04 K 1.1e+04 K 0.524 0.484
5 1.1e+04 K 1.12e+04 K 0.202 0.19
10 1.08e+04 K 1.1e+04 K 0.124 0.118
15 1.05e+04 K 1.06e+04 K 0.0926 0.0894
[tardis.simulation.base][INFO   ]

        Current t_inner = 10673.709 K
        Expected t_inner for next iteration = 10637.548 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 4 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.058e+43 erg / s
        Luminosity absorbed  = 3.365e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 2/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.484 0.471
5 1.12e+04 K 1.13e+04 K 0.19 0.181
10 1.1e+04 K 1.1e+04 K 0.118 0.113
15 1.06e+04 K 1.07e+04 K 0.0894 0.0851
[tardis.simulation.base][INFO   ]

        Current t_inner = 10637.548 K
        Expected t_inner for next iteration = 10641.159 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 5 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.057e+43 erg / s
        Luminosity absorbed  = 3.391e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 3/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.471 0.48
5 1.13e+04 K 1.13e+04 K 0.181 0.179
10 1.1e+04 K 1.1e+04 K 0.113 0.115
15 1.07e+04 K 1.07e+04 K 0.0851 0.0838
[tardis.simulation.base][INFO   ]

        Current t_inner = 10641.159 K
        Expected t_inner for next iteration = 10647.218 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 6 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.060e+43 erg / s
        Luminosity absorbed  = 3.394e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 4/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.48 0.466
5 1.13e+04 K 1.13e+04 K 0.179 0.182
10 1.1e+04 K 1.1e+04 K 0.115 0.115
15 1.07e+04 K 1.07e+04 K 0.0838 0.0853
[tardis.simulation.base][INFO   ]

        Current t_inner = 10647.218 K
        Expected t_inner for next iteration = 10645.645 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 7 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.060e+43 erg / s
        Luminosity absorbed  = 3.389e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 5/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.1e+04 K 0.466 0.469
5 1.13e+04 K 1.14e+04 K 0.182 0.173
10 1.1e+04 K 1.1e+04 K 0.115 0.113
15 1.07e+04 K 1.06e+04 K 0.0853 0.0865
[tardis.simulation.base][INFO   ]

        Current t_inner = 10645.645 K
        Expected t_inner for next iteration = 10644.007 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 8 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.062e+43 erg / s
        Luminosity absorbed  = 3.356e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 6/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.469 0.47
5 1.14e+04 K 1.13e+04 K 0.173 0.178
10 1.1e+04 K 1.11e+04 K 0.113 0.112
15 1.06e+04 K 1.07e+04 K 0.0865 0.0836
[tardis.simulation.base][INFO   ]

        Current t_inner = 10644.007 K
        Expected t_inner for next iteration = 10636.775 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 9 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.053e+43 erg / s
        Luminosity absorbed  = 3.409e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 7/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.1e+04 K 0.47 0.471
5 1.13e+04 K 1.14e+04 K 0.178 0.172
10 1.11e+04 K 1.12e+04 K 0.112 0.109
15 1.07e+04 K 1.07e+04 K 0.0836 0.0836
[tardis.simulation.base][INFO   ]

        Current t_inner = 10636.775 K
        Expected t_inner for next iteration = 10653.396 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 10 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.071e+43 erg / s
        Luminosity absorbed  = 3.320e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 8/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.471 0.477
5 1.14e+04 K 1.14e+04 K 0.172 0.178
10 1.12e+04 K 1.11e+04 K 0.109 0.114
15 1.07e+04 K 1.06e+04 K 0.0836 0.0872
[tardis.simulation.base][INFO   ]

        Current t_inner = 10653.396 K
        Expected t_inner for next iteration = 10624.877 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 11 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.050e+43 erg / s
        Luminosity absorbed  = 3.378e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 9/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.477 0.473
5 1.14e+04 K 1.12e+04 K 0.178 0.182
10 1.11e+04 K 1.1e+04 K 0.114 0.115
15 1.06e+04 K 1.06e+04 K 0.0872 0.0858
[tardis.simulation.base][INFO   ]

        Current t_inner = 10624.877 K
        Expected t_inner for next iteration = 10649.271 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 12 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.057e+43 erg / s
        Luminosity absorbed  = 3.427e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 10/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.473 0.465
5 1.12e+04 K 1.13e+04 K 0.182 0.18
10 1.1e+04 K 1.11e+04 K 0.115 0.111
15 1.06e+04 K 1.07e+04 K 0.0858 0.083
[tardis.simulation.base][INFO   ]

        Current t_inner = 10649.271 K
        Expected t_inner for next iteration = 10653.802 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 13 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.062e+43 erg / s
        Luminosity absorbed  = 3.405e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 11/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.465 0.466
5 1.13e+04 K 1.13e+04 K 0.18 0.178
10 1.11e+04 K 1.11e+04 K 0.111 0.113
15 1.07e+04 K 1.07e+04 K 0.083 0.086
[tardis.simulation.base][INFO   ]

        Current t_inner = 10653.802 K
        Expected t_inner for next iteration = 10646.746 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 14 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.061e+43 erg / s
        Luminosity absorbed  = 3.377e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 12/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.466 0.468
5 1.13e+04 K 1.13e+04 K 0.178 0.181
10 1.11e+04 K 1.1e+04 K 0.113 0.114
15 1.07e+04 K 1.06e+04 K 0.086 0.0867
[tardis.simulation.base][INFO   ]

        Current t_inner = 10646.746 K
        Expected t_inner for next iteration = 10641.333 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 15 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.055e+43 erg / s
        Luminosity absorbed  = 3.411e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 13/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.1e+04 K 0.468 0.484
5 1.13e+04 K 1.13e+04 K 0.181 0.18
10 1.1e+04 K 1.1e+04 K 0.114 0.113
15 1.06e+04 K 1.07e+04 K 0.0867 0.0852
[tardis.simulation.base][INFO   ]

        Current t_inner = 10641.333 K
        Expected t_inner for next iteration = 10652.281 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 16 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.058e+43 erg / s
        Luminosity absorbed  = 3.437e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 14/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.484 0.472
5 1.13e+04 K 1.14e+04 K 0.18 0.173
10 1.1e+04 K 1.11e+04 K 0.113 0.112
15 1.07e+04 K 1.07e+04 K 0.0852 0.0832
[tardis.simulation.base][INFO   ]

        Current t_inner = 10652.281 K
        Expected t_inner for next iteration = 10654.516 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 17 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.066e+43 erg / s
        Luminosity absorbed  = 3.375e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 15/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.472 0.465
5 1.14e+04 K 1.14e+04 K 0.173 0.171
10 1.11e+04 K 1.12e+04 K 0.112 0.108
15 1.07e+04 K 1.08e+04 K 0.0832 0.0813
[tardis.simulation.base][INFO   ]

        Current t_inner = 10654.516 K
        Expected t_inner for next iteration = 10637.793 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 18 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.059e+43 erg / s
        Luminosity absorbed  = 3.354e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 16/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.465 0.463
5 1.14e+04 K 1.14e+04 K 0.171 0.174
10 1.12e+04 K 1.11e+04 K 0.108 0.11
15 1.08e+04 K 1.07e+04 K 0.0813 0.0844
[tardis.simulation.base][INFO   ]

        Current t_inner = 10637.793 K
        Expected t_inner for next iteration = 10638.424 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Starting iteration 19 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.054e+43 erg / s
        Luminosity absorbed  = 3.403e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)
[tardis.simulation.base][INFO   ]
        Iteration converged 17/4 consecutive times. (base.py:260)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:630)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.463 0.465
5 1.14e+04 K 1.14e+04 K 0.174 0.173
10 1.11e+04 K 1.11e+04 K 0.11 0.109
15 1.07e+04 K 1.07e+04 K 0.0844 0.0839
[tardis.simulation.base][INFO   ]

        Current t_inner = 10638.424 K
        Expected t_inner for next iteration = 10651.315 K
 (base.py:657)
[tardis.simulation.base][INFO   ]

        Simulation finished in 19 iterations
        Simulation took 54.33 s
 (base.py:547)
[tardis.simulation.base][INFO   ]

        Starting iteration 20 of 20 (base.py:444)
[tardis.simulation.base][INFO   ]

        Luminosity emitted   = 1.061e+43 erg / s
        Luminosity absorbed  = 3.400e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:662)

If all goes well, the simulation should run as usual. Afterwards, the information from the simulation will all exist in Simulation and can be examined. Some examples for useful/interesting quantities are given below (but much more information is available: contact us via tardis-sn-users if you need further help).

Examples of finding physical quantities

For example, two of our important quantities are the parameters of the radiation field model, \(T_{\rm rad}\) and \(W\). These exist as numpy.ndarray

Thus simulation.plasma.t_rad will give you a list of the \(T_{\rm rad}\)-values for the model zones in cgs units.

[3]:
simulation.plasma.t_rad
[3]:
array([11083.75381981, 11175.17337624, 11285.09854706, 11393.28834129,
       11352.33979496, 11384.0956993 , 11341.7615293 , 11306.58183034,
       11268.11378879, 11182.10539352, 11121.16673711, 11049.36023508,
       10964.57965949, 10892.02307211, 10797.59510825, 10695.83972976,
       10591.48932813, 10536.99738202, 10457.03044189, 10355.97908746])

Similarly, the \(W\)-values can be accessed using simulation.plasma.w

[4]:
simulation.plasma.w
[4]:
array([0.46468129, 0.3591698 , 0.28443783, 0.23005691, 0.20028674,
       0.17344723, 0.15518146, 0.14017739, 0.12739803, 0.11767872,
       0.10941915, 0.10293185, 0.09739948, 0.09193148, 0.08766982,
       0.08391338, 0.08120465, 0.0777153 , 0.07477147, 0.07244056])

Several important quantities that were setup when the model was defined by the configuration file are located in the model section of the simulation. For example, the inner and outer velocity boundaries of the zones in the model is given by simulation.simulation_state.v_inner.cgs and simulation.simulation_state.v_outer.cgs respectively. These exist as Astropy Quantities.

[5]:
simulation.simulation_state.v_inner.cgs
[5]:
$[1.1 \times 10^{9},~1.145 \times 10^{9},~1.19 \times 10^{9},~1.235 \times 10^{9},~1.28 \times 10^{9},~1.325 \times 10^{9},~1.37 \times 10^{9},~1.415 \times 10^{9},~1.46 \times 10^{9},~1.505 \times 10^{9},~1.55 \times 10^{9},~1.595 \times 10^{9},~1.64 \times 10^{9},~1.685 \times 10^{9},~1.73 \times 10^{9},~1.775 \times 10^{9},~1.82 \times 10^{9},~1.865 \times 10^{9},~1.91 \times 10^{9},~1.955 \times 10^{9}] \; \mathrm{\frac{cm}{s}}$
[6]:
simulation.simulation_state.v_outer.cgs
[6]:
$[1.145 \times 10^{9},~1.19 \times 10^{9},~1.235 \times 10^{9},~1.28 \times 10^{9},~1.325 \times 10^{9},~1.37 \times 10^{9},~1.415 \times 10^{9},~1.46 \times 10^{9},~1.505 \times 10^{9},~1.55 \times 10^{9},~1.595 \times 10^{9},~1.64 \times 10^{9},~1.685 \times 10^{9},~1.73 \times 10^{9},~1.775 \times 10^{9},~1.82 \times 10^{9},~1.865 \times 10^{9},~1.91 \times 10^{9},~1.955 \times 10^{9},~2 \times 10^{9}] \; \mathrm{\frac{cm}{s}}$

The average density in the zones is given by simulation.simulation_state.density.cgs. These also exist as Astropy Quantities.

[7]:
simulation.simulation_state.density.cgs
[7]:
$[7.5428036 \times 10^{-14},~5.728475 \times 10^{-14},~4.3960742 \times 10^{-14},~3.4062874 \times 10^{-14},~2.6631346 \times 10^{-14},~2.0995965 \times 10^{-14},~1.6682872 \times 10^{-14},~1.3353105 \times 10^{-14},~1.0761538 \times 10^{-14},~8.7290848 \times 10^{-15},~7.1236516 \times 10^{-15},~5.8469209 \times 10^{-15},~4.8250928 \times 10^{-15},~4.0023242 \times 10^{-15},~3.3360386 \times 10^{-15},~2.7935404 \times 10^{-15},~2.3495504 \times 10^{-15},~1.9843968 \times 10^{-15},~1.6826769 \times 10^{-15},~1.4322598 \times 10^{-15}] \; \mathrm{\frac{g}{cm^{3}}}$

Many other interesting quantities are stored in the plasma. For example the calculated ion populations and level populations is given by simulation.plasma.ion_number_density and simulation.plasma.level_number_density respectively.

[8]:
simulation.plasma.ion_number_density
[8]:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
atomic_number ion_number
8 0 9.618250e+02 4.883208e+02 2.471877e+02 1.281896e+02 8.290945e+01 4.940860e+01 3.307022e+01 2.225018e+01 1.525008e+01 1.131546e+01 8.216577e+00 6.134728e+00 4.723839e+00 3.615889e+00 2.891204e+00 2.364787e+00 1.964571e+00 1.526333e+00 1.245542e+00 1.061526e+00
1 5.391933e+08 4.093563e+08 3.139290e+08 2.429510e+08 1.898863e+08 1.495245e+08 1.187614e+08 9.500901e+07 7.653416e+07 6.210579e+07 5.068445e+07 4.161077e+07 3.435509e+07 2.850529e+07 2.377398e+07 1.992024e+07 1.676361e+07 1.415952e+07 1.201017e+07 1.022696e+07
2 2.339444e+05 3.185573e+05 4.587065e+05 6.516432e+05 5.693514e+05 6.293258e+05 5.471807e+05 4.865114e+05 4.276199e+05 3.207860e+05 2.607702e+05 2.038344e+05 1.518532e+05 1.175703e+05 8.389724e+04 5.793675e+04 3.933804e+04 3.201798e+04 2.359261e+04 1.593601e+04
3 3.001097e-08 8.688761e-08 2.872066e-07 9.093345e-07 8.256251e-07 1.355698e-06 1.196394e-06 1.109781e-06 9.927554e-07 5.882156e-07 4.254249e-07 2.767184e-07 1.583099e-07 9.943145e-08 5.045581e-08 2.344165e-08 1.038717e-08 7.280261e-09 3.943081e-09 1.704297e-09
4 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
20 16 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
17 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
18 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
19 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
20 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00

94 rows × 20 columns

[9]:
simulation.plasma.level_number_density
[9]:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
atomic_number ion_number level_number
8 0 0 502.967553 255.032653 128.899774 66.745662 43.193887 25.729333 17.231353 11.599221 7.954269 5.909093 4.294459 3.209574 2.474345 1.895917 1.517939 1.243320 1.034403 0.804268 0.657042 0.560759
1 295.643912 149.933179 75.794958 39.254949 25.401675 15.131880 10.133310 6.820773 4.677084 3.473988 2.524454 1.886464 1.454093 1.114016 0.891757 0.730278 0.607441 0.472244 0.385733 0.329138
2 97.672883 49.537548 25.044623 12.971934 8.393809 5.000347 3.348455 2.253798 1.545410 1.147803 0.834037 0.623220 0.480347 0.367983 0.294543 0.241187 0.200599 0.155945 0.127368 0.108670
3 64.118040 33.063901 17.047192 8.998432 5.781320 3.463136 2.302022 1.539923 1.048761 0.767060 0.551262 0.406540 0.308445 0.233084 0.183226 0.147089 0.119827 0.092135 0.074032 0.061852
4 1.251682 0.657861 0.346893 0.187126 0.119247 0.071886 0.047382 0.031472 0.021268 0.015284 0.010846 0.007879 0.005871 0.004368 0.003363 0.002639 0.002099 0.001594 0.001257 0.001025
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
20 16 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
17 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
18 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
19 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
20 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000

4435 rows × 20 columns

These are stored as Pandas DataFrames. An index can be supplied to obtain the population in a particular zone. E.g., for the ion populations of the innermost zone (index = 0), we will use simulation.plasma.ion_number_density[0]

[10]:
simulation.plasma.ion_number_density[0]
[10]:
atomic_number  ion_number
8              0             9.618250e+02
               1             5.391933e+08
               2             2.339444e+05
               3             3.001097e-08
               4             0.000000e+00
                                 ...
20             16            0.000000e+00
               17            0.000000e+00
               18            0.000000e+00
               19            0.000000e+00
               20            0.000000e+00
Name: 0, Length: 94, dtype: float64

Ion populations for a particular ionization stage of a particular element can be accessed by specifying an appropriate tuple (𝑍,𝐶), which identifies the element (via atomic number 𝑍 ) and the charge (via the ion charge 𝐶 ). Thus, simulation.plasma.ion_number_density.loc[14,1] will identify the ion popuations for Si II (𝑍=14,𝐶=1) in all the zones.

[11]:
simulation.plasma.ion_number_density.loc[14,1]
[11]:
0     69145.041540
1     34289.555950
2     16865.134735
3      8489.251809
4      5535.535887
5      3259.561779
6      2199.500884
7      1488.901573
8      1027.723547
9       779.365085
10      574.224412
11      436.644376
12      343.950792
13      268.409620
14      220.373575
15      185.564595
16      158.880487
17      125.314799
18      104.666492
19       91.930484
Name: (14, 1), dtype: float64

The above examples can be combined to obtain e.g. the Si II population in the innermost zone can be obtained by simulation.plasma.ion_number_density[0].loc[14,1]

[12]:
simulation.plasma.ion_number_density[0].loc[14,1]
[12]:
np.float64(69145.04154047828)

The level populations are stored (and can be accessed) in a similar way - a third label can be used to pick out a particular atomic level. E.g., to pull out the population of the ground state (index 0) of Si II we can use simulation.plasma.level_number_density.loc[14,1,0]

[13]:
simulation.plasma.level_number_density.loc[14,1,0]
[13]:
0     23406.762343
1     11599.937419
2      5700.752037
3      2867.201731
4      1870.179111
5      1100.977353
6       743.159937
7       503.197803
8       347.434906
9       263.640905
10      194.332449
11      147.847724
12      116.531275
13       90.983557
14       74.748828
15       62.984865
16       53.964684
17       42.578935
18       35.581351
19       31.271650
Name: (14, 1, 0), dtype: float64

Notes

  • If you prefer to work in SI units, all the Astropy Quantities may instead by accessed with “xxx.si”.

  • Information that is not stored as Astropy Quantities (e.g. the ion and level populations used in the example above) are usually stored in cgs units (i.e. cm−3 for the populations).