You can interact with this notebook online: Launch notebook

Accessing 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.

Runing in interactive Python session

[1]:
# Download the atomic data
from tardis.io.atom_data.util 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
/usr/share/miniconda3/envs/tardis/lib/python3.11/site-packages/setuptools_scm/git.py:162: UserWarning: "/home/runner/work/tardis/tardis" is shallow and may cause errors
  warnings.warn(f'"{wd.path}" is shallow and may cause errors')
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   980  100   980    0     0   5465      0 --:--:-- --:--:-- --:--:--  5505
[2]:
from tardis import run_tardis

simulation = run_tardis('tardis_example.yml')
[tardis.simulation.base][INFO   ]

        Reading Atomic Data from kurucz_cd23_chianti_H_He.h5 (base.py:681)
[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:36)
[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 (base.py:262)
[tardis.model.parse_input][WARNING]
        Number of density points larger than number of shells. Assuming inner point irrelevant (parse_input.py:143)
[tardis.model.matter.decay][INFO   ]
        Decaying abundances for 1123200.0 seconds (decay.py:101)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

        Starting iteration 1 of 20 (base.py:398)
[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:580)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
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.01e+04 K 0.143 0.117
15 9.71e+03 K 9.87e+03 K 0.105 0.0869
[tardis.simulation.base][INFO   ]

        Current t_inner = 9933.952 K
        Expected t_inner for next iteration = 10703.212 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.01e+04 K 1.08e+04 K 0.507 0.525
5 1.02e+04 K 1.1e+04 K 0.197 0.203
10 1.01e+04 K 1.08e+04 K 0.117 0.125
15 9.87e+03 K 1.05e+04 K 0.0869 0.0933
[tardis.simulation.base][INFO   ]

        Current t_inner = 10703.212 K
        Expected t_inner for next iteration = 10673.712 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.08e+04 K 1.1e+04 K 0.525 0.483
5 1.1e+04 K 1.12e+04 K 0.203 0.189
10 1.08e+04 K 1.1e+04 K 0.125 0.118
15 1.05e+04 K 1.06e+04 K 0.0933 0.0895
[tardis.simulation.base][INFO   ]

        Current t_inner = 10673.712 K
        Expected t_inner for next iteration = 10635.953 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.483 0.469
5 1.12e+04 K 1.12e+04 K 0.189 0.182
10 1.1e+04 K 1.1e+04 K 0.118 0.113
15 1.06e+04 K 1.07e+04 K 0.0895 0.0861
[tardis.simulation.base][INFO   ]

        Current t_inner = 10635.953 K
        Expected t_inner for next iteration = 10638.407 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.055e+43 erg / s
        Luminosity absorbed  = 3.399e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 1/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.469 0.479
5 1.12e+04 K 1.13e+04 K 0.182 0.178
10 1.1e+04 K 1.1e+04 K 0.113 0.113
15 1.07e+04 K 1.07e+04 K 0.0861 0.0839
[tardis.simulation.base][INFO   ]

        Current t_inner = 10638.407 K
        Expected t_inner for next iteration = 10650.202 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.061e+43 erg / s
        Luminosity absorbed  = 3.398e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 2/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.479 0.47
5 1.13e+04 K 1.12e+04 K 0.178 0.185
10 1.1e+04 K 1.11e+04 K 0.113 0.112
15 1.07e+04 K 1.07e+04 K 0.0839 0.0856
[tardis.simulation.base][INFO   ]

        Current t_inner = 10650.202 K
        Expected t_inner for next iteration = 10645.955 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.061e+43 erg / s
        Luminosity absorbed  = 3.382e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 3/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.47 0.47
5 1.12e+04 K 1.13e+04 K 0.185 0.178
10 1.11e+04 K 1.11e+04 K 0.112 0.112
15 1.07e+04 K 1.07e+04 K 0.0856 0.086
[tardis.simulation.base][INFO   ]

        Current t_inner = 10645.955 K
        Expected t_inner for next iteration = 10642.050 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.47 0.472
5 1.13e+04 K 1.14e+04 K 0.178 0.175
10 1.11e+04 K 1.11e+04 K 0.112 0.111
15 1.07e+04 K 1.07e+04 K 0.086 0.084
[tardis.simulation.base][INFO   ]

        Current t_inner = 10642.050 K
        Expected t_inner for next iteration = 10636.106 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.052e+43 erg / s
        Luminosity absorbed  = 3.411e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 5/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.472 0.469
5 1.14e+04 K 1.15e+04 K 0.175 0.17
10 1.11e+04 K 1.11e+04 K 0.111 0.109
15 1.07e+04 K 1.08e+04 K 0.084 0.0822
[tardis.simulation.base][INFO   ]

        Current t_inner = 10636.106 K
        Expected t_inner for next iteration = 10654.313 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.1e+04 K 0.469 0.475
5 1.15e+04 K 1.14e+04 K 0.17 0.177
10 1.11e+04 K 1.11e+04 K 0.109 0.112
15 1.08e+04 K 1.06e+04 K 0.0822 0.0878
[tardis.simulation.base][INFO   ]

        Current t_inner = 10654.313 K
        Expected t_inner for next iteration = 10628.190 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.053e+43 erg / s
        Luminosity absorbed  = 3.363e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 1/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.1e+04 K 0.475 0.472
5 1.14e+04 K 1.12e+04 K 0.177 0.184
10 1.11e+04 K 1.1e+04 K 0.112 0.114
15 1.06e+04 K 1.06e+04 K 0.0878 0.0859
[tardis.simulation.base][INFO   ]

        Current t_inner = 10628.190 K
        Expected t_inner for next iteration = 10644.054 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.472 0.467
5 1.12e+04 K 1.13e+04 K 0.184 0.176
10 1.1e+04 K 1.11e+04 K 0.114 0.11
15 1.06e+04 K 1.08e+04 K 0.0859 0.0821
[tardis.simulation.base][INFO   ]

        Current t_inner = 10644.054 K
        Expected t_inner for next iteration = 10653.543 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.062e+43 erg / s
        Luminosity absorbed  = 3.406e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 1/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.467 0.466
5 1.13e+04 K 1.13e+04 K 0.176 0.18
10 1.11e+04 K 1.11e+04 K 0.11 0.111
15 1.08e+04 K 1.08e+04 K 0.0821 0.0841
[tardis.simulation.base][INFO   ]

        Current t_inner = 10653.543 K
        Expected t_inner for next iteration = 10647.277 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.063e+43 erg / s
        Luminosity absorbed  = 3.369e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 2/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.466 0.469
5 1.13e+04 K 1.13e+04 K 0.18 0.182
10 1.11e+04 K 1.1e+04 K 0.111 0.113
15 1.08e+04 K 1.07e+04 K 0.0841 0.0854
[tardis.simulation.base][INFO   ]

        Current t_inner = 10647.277 K
        Expected t_inner for next iteration = 10638.875 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.053e+43 erg / s
        Luminosity absorbed  = 3.417e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 3/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.1e+04 K 0.469 0.484
5 1.13e+04 K 1.13e+04 K 0.182 0.181
10 1.1e+04 K 1.1e+04 K 0.113 0.113
15 1.07e+04 K 1.07e+04 K 0.0854 0.0858
[tardis.simulation.base][INFO   ]

        Current t_inner = 10638.875 K
        Expected t_inner for next iteration = 10655.125 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
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.13e+04 K 0.181 0.177
10 1.1e+04 K 1.1e+04 K 0.113 0.113
15 1.07e+04 K 1.06e+04 K 0.0858 0.0858
[tardis.simulation.base][INFO   ]

        Current t_inner = 10655.125 K
        Expected t_inner for next iteration = 10655.561 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.1e+04 K 1.11e+04 K 0.472 0.468
5 1.13e+04 K 1.14e+04 K 0.177 0.175
10 1.1e+04 K 1.11e+04 K 0.113 0.11
15 1.06e+04 K 1.08e+04 K 0.0858 0.0816
[tardis.simulation.base][INFO   ]

        Current t_inner = 10655.561 K
        Expected t_inner for next iteration = 10636.536 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.057e+43 erg / s
        Luminosity absorbed  = 3.365e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 1/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.468 0.464
5 1.14e+04 K 1.13e+04 K 0.175 0.177
10 1.11e+04 K 1.1e+04 K 0.11 0.113
15 1.08e+04 K 1.07e+04 K 0.0816 0.0848
[tardis.simulation.base][INFO   ]

        Current t_inner = 10636.536 K
        Expected t_inner for next iteration = 10641.692 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

        Luminosity emitted   = 1.056e+43 erg / s
        Luminosity absorbed  = 3.405e+42 erg / s
        Luminosity requested = 1.059e+43 erg / s
 (base.py:580)
[tardis.simulation.base][INFO   ]
        Iteration converged 2/4 consecutive times. (base.py:268)
[tardis.simulation.base][INFO   ]

        Plasma stratification: (base.py:548)
Shell No. t_rad next_t_rad w next_w
0 1.11e+04 K 1.11e+04 K 0.464 0.466
5 1.13e+04 K 1.13e+04 K 0.177 0.177
10 1.1e+04 K 1.11e+04 K 0.113 0.111
15 1.07e+04 K 1.07e+04 K 0.0848 0.0853
[tardis.simulation.base][INFO   ]

        Current t_inner = 10641.692 K
        Expected t_inner for next iteration = 10650.463 K
 (base.py:575)
[py.warnings         ][WARNING]
        /home/runner/work/tardis/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide
  (g_lower * n_upper) / (g_upper * n_lower)
 (warnings.py:109)
[tardis.simulation.base][INFO   ]

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

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

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

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([11069.33089377, 11165.15751924, 11272.62783772, 11372.4522524 ,
       11332.02806881, 11329.6435672 , 11294.51865104, 11261.56893248,
       11241.47812926, 11148.97525325, 11071.52917648, 11004.68560208,
       10946.39979159, 10861.42744062, 10784.4789371 , 10655.55794227,
       10586.11909387, 10567.9967492 , 10435.71120389, 10305.7063164 ])

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

[4]:
simulation.plasma.w
[4]:
array([0.46583111, 0.35821399, 0.28478501, 0.23131748, 0.20190424,
       0.17672918, 0.15768939, 0.14187896, 0.1281619 , 0.11908551,
       0.11148042, 0.10454478, 0.09806677, 0.09312254, 0.08822151,
       0.08534236, 0.08173657, 0.07726564, 0.07559528, 0.07395579])

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.817541e+02 4.952192e+02 2.514676e+02 1.318559e+02 8.523577e+01 5.320207e+01 3.527606e+01 2.366975e+01 1.582107e+01 1.185305e+01 8.815497e+00 6.540669e+00 4.850194e+00 3.782471e+00 2.948439e+00 2.514696e+00 1.980990e+00 1.454287e+00 1.288493e+00 1.151839e+00
1 5.392046e+08 4.093669e+08 3.139475e+08 2.429934e+08 1.899227e+08 1.496264e+08 1.188395e+08 9.507571e+07 7.657002e+07 6.213943e+07 5.072480e+07 4.163973e+07 3.436439e+07 2.851733e+07 2.377784e+07 1.992820e+07 1.676439e+07 1.415556e+07 1.201203e+07 1.022981e+07
2 2.226602e+05 3.079859e+05 4.402008e+05 6.091628e+05 5.329124e+05 5.275052e+05 4.690734e+05 4.198082e+05 3.917586e+05 2.871442e+05 2.204204e+05 1.748728e+05 1.425520e+05 1.055346e+05 8.003898e+04 4.996889e+04 3.855664e+04 3.597715e+04 2.173746e+04 1.307832e+04
3 2.645841e-08 7.972540e-08 2.585740e-07 7.655780e-07 6.973306e-07 8.635538e-07 8.070076e-07 7.611136e-07 7.934242e-07 4.430639e-07 2.767649e-07 1.870047e-07 1.346884e-07 7.544950e-08 4.473829e-08 1.606762e-08 9.868697e-09 9.803360e-09 3.199626e-09 1.029618e-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 513.492299 258.671585 131.154368 68.674580 44.418418 27.725805 18.392821 12.346995 8.255151 6.192690 4.610677 3.424086 2.541173 1.984107 1.548271 1.322879 1.043126 0.765974 0.679901 0.608892
1 301.822270 152.069720 77.118971 40.387920 26.120864 16.304473 10.815431 7.259908 4.853770 3.640496 2.710091 2.012378 1.493315 1.165766 0.909554 0.776946 0.612557 0.449788 0.399136 0.357352
2 99.712889 50.243057 25.481864 13.346116 8.631325 5.387607 3.573725 2.398818 1.603757 1.202786 0.895333 0.664793 0.493296 0.385068 0.300418 0.256590 0.202288 0.148533 0.131791 0.117980
3 65.284281 33.474270 17.306588 9.224554 5.923827 3.696062 2.436586 1.626021 1.083219 0.799011 0.586431 0.430088 0.315682 0.242490 0.186407 0.155243 0.120705 0.088307 0.076267 0.066442
4 1.270591 0.664649 0.351282 0.191034 0.121690 0.075890 0.049677 0.032930 0.021848 0.015812 0.011419 0.008257 0.005985 0.004514 0.003411 0.002760 0.002112 0.001539 0.001289 0.001088
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
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.817541e+02
               1             5.392046e+08
               2             2.226602e+05
               3             2.645841e-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     70833.163502
1     34861.243842
2     17211.393526
3      8779.777647
4      5721.865657
5      3563.344668
6      2378.033763
7      1604.932782
8      1074.816738
9       824.622359
10      625.499897
11      471.990280
12      355.146037
13      283.454849
14      225.652192
15      199.786180
16      160.473228
17      118.252827
18      108.994959
19      101.321273
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]:
70833.16350200342

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     23980.690090
1     11794.195085
2      5818.333741
3      2965.794314
4      1933.426172
5      1204.080564
6       803.766453
7       542.594090
8       363.426957
9       279.017554
10      211.760752
11      159.866349
12      120.339508
13       96.103679
14       76.546076
15       67.830067
16       54.507573
17       40.171395
18       37.057825
19       34.476854
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).