This notebook is available at https://github.com/tardis-sn/tardis/tree/master/docs/io/visualization/generating_widgets.ipynb
Generating TARDIS Widgets¶
A demonstration of how to generate TARDIS widgets that allows you to explore simulation data within Jupyter Notebook with ease!
This notebook is a quickstart tutorial, but more details on each widget (and its features) is given in the Using TARDIS Widgets section of the documentation.
First create a simulation model that we can use to generate widgets (more details about running simulation in Quickstart section):
[1]:
from tardis import run_tardis
sim = run_tardis('tardis_example.yml')
[tardis.plasma.standard_plasmas][INFO ] Reading Atomic Data from kurucz_cd23_chianti_H_He.h5 (standard_plasmas.py:87)
[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/jals/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5 (util.py:35)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/IPython/core/interactiveshell.py:3417: PerformanceWarning: indexing past lexsort depth may impact performance.
exec(code_obj, self.user_global_ns, self.user_ns)
(warnings.py:110)
[tardis.io.atom_data.base][INFO ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (base.py:172)
[tardis.io.atom_data.base][INFO ] Non provided atomic data: synpp_refs, photoionization_data (base.py:178)
[tardis.simulation.base][INFO ] Starting iteration 1/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 7.94275e+42 erg / s Luminosity absorbed = 2.65805e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 9926.501965 10134.733717 0.400392 0.508204
5 9852.611678 10222.890845 0.211205 0.197026
10 9779.813302 10144.463169 0.142695 0.117179
15 9708.082813 9873.477846 0.104556 0.086941
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 9933.952 K -- next t_inner 11472.055 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 2/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.40815e+43 erg / s Luminosity absorbed = 4.77001e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10134.733717 11468.021903 0.508204 0.548671
5 10222.890845 11499.835340 0.197026 0.221374
10 10144.463169 11306.370330 0.117179 0.136291
15 9873.477846 10953.828130 0.086941 0.102617
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11472.055 K -- next t_inner 9949.978 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 3/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.12624e+42 erg / s Luminosity absorbed = 2.54722e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11468.021903 10497.008397 0.548671 0.442299
5 11499.835340 10799.075913 0.221374 0.164288
10 11306.370330 10623.433274 0.136291 0.101820
15 10953.828130 10226.187071 0.102617 0.077629
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 9949.978 K -- next t_inner 11360.097 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 4/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.36297e+43 erg / s Luminosity absorbed = 4.49721e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10497.008397 11615.344313 0.442299 0.497714
5 10799.075913 11729.411389 0.164288 0.199205
10 10623.433274 11517.190317 0.101820 0.123849
15 10226.187071 11103.373456 0.077629 0.093930
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11360.097 K -- next t_inner 10014.843 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 5/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.27895e+42 erg / s Luminosity absorbed = 2.66933e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11615.344313 10549.514128 0.497714 0.443441
5 11729.411389 10919.073481 0.199205 0.162199
10 11517.190317 10697.303300 0.123849 0.101289
15 11103.373456 10379.863073 0.093930 0.075372
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10014.843 K -- next t_inner 11328.210 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 6/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.34741e+43 erg / s Luminosity absorbed = 4.44727e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10549.514128 11567.208184 0.443441 0.504178
5 10919.073481 11653.124121 0.162199 0.203042
10 10697.303300 11425.955010 0.101289 0.125249
15 10379.863073 11082.155938 0.075372 0.094028
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11328.210 K -- next t_inner 10044.200 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 7/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.39001e+42 erg / s Luminosity absorbed = 2.69230e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11567.208184 10569.747403 0.504178 0.442290
5 11653.124121 11099.194259 0.203042 0.153253
10 11425.955010 10809.397890 0.125249 0.097256
15 11082.155938 10454.841299 0.094028 0.073809
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10044.200 K -- next t_inner 11285.966 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 8/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.33305e+43 erg / s Luminosity absorbed = 4.33011e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10569.747403 11547.678162 0.442290 0.500345
5 11099.194259 11669.739508 0.153253 0.198338
10 10809.397890 11493.569590 0.097256 0.121915
15 10454.841299 11083.769586 0.073809 0.092834
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11285.966 K -- next t_inner 10060.511 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 9/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.44283e+42 erg / s Luminosity absorbed = 2.70894e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11547.678162 10635.099217 0.500345 0.439520
5 11669.739508 11035.731464 0.198338 0.158320
10 11493.569590 10717.471486 0.121915 0.101642
15 11083.769586 10404.049299 0.092834 0.075794
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10060.511 K -- next t_inner 11268.877 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 10/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.32925e+43 erg / s Luminosity absorbed = 4.25943e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10635.099217 11500.557678 0.439520 0.506895
5 11035.731464 11715.267406 0.158320 0.196690
10 10717.471486 11451.270656 0.101642 0.123243
15 10404.049299 11094.423438 0.075794 0.092243
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11268.877 K -- next t_inner 10059.624 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 11/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.49497e+42 erg / s Luminosity absorbed = 2.65616e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11500.557678 10570.856509 0.506895 0.445926
5 11715.267406 10957.336276 0.196690 0.162837
10 11451.270656 10916.410391 0.123243 0.096229
15 11094.423438 10441.053929 0.092243 0.075026
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10059.624 K -- next t_inner 11233.248 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 12/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.30417e+43 erg / s Luminosity absorbed = 4.28820e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10570.856509 11533.554419 0.445926 0.494814
5 10957.336276 11764.967895 0.162837 0.189464
10 10916.410391 11444.191999 0.096229 0.121150
15 10441.053929 11084.736033 0.075026 0.090825
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11233.248 K -- next t_inner 10123.784 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 13/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.69244e+42 erg / s Luminosity absorbed = 2.74548e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11533.554419 10680.784661 0.494814 0.439281
5 11764.967895 10887.379428 0.189464 0.170137
10 11444.191999 10825.792025 0.121150 0.100780
15 11084.736033 10402.120228 0.090825 0.077634
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10123.784 K -- next t_inner 11175.750 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 14/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.28354e+43 erg / s Luminosity absorbed = 4.15095e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10680.784661 11437.188130 0.439281 0.496749
5 10887.379428 11571.106856 0.170137 0.196714
10 10825.792025 11378.137918 0.100780 0.120954
15 10402.120228 10957.211814 0.077634 0.092896
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11175.750 K -- next t_inner 10152.603 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 15/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.75331e+42 erg / s Luminosity absorbed = 2.81319e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11437.188130 10637.774893 0.496749 0.452668
5 11571.106856 11002.647927 0.196714 0.166197
10 11378.137918 10832.042108 0.120954 0.101284
15 10957.211814 10350.602742 0.092896 0.079468
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10152.603 K -- next t_inner 11168.529 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 16/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.27820e+43 erg / s Luminosity absorbed = 4.15606e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10637.774893 11420.979987 0.452668 0.499488
5 11002.647927 11711.923994 0.166197 0.186857
10 10832.042108 11421.346118 0.101284 0.119700
15 10350.602742 11076.434180 0.079468 0.089402
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11168.529 K -- next t_inner 10167.208 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 17/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.81647e+42 erg / s Luminosity absorbed = 2.81681e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11420.979987 10691.849845 0.499488 0.447482
5 11711.923994 11042.045712 0.186857 0.164090
10 11421.346118 10980.886609 0.119700 0.097369
15 11076.434180 10456.662007 0.089402 0.077097
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10167.208 K -- next t_inner 11144.459 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 18/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 1.26680e+43 erg / s Luminosity absorbed = 4.12238e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 10691.849845 11404.686443 0.447482 0.497739
5 11042.045712 11664.227712 0.164090 0.189070
10 10980.886609 11444.220669 0.097369 0.117732
15 10456.662007 11052.698087 0.077097 0.089141
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 11144.459 K -- next t_inner 10190.841 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 19/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[tardis.simulation.base][INFO ] Luminosity emitted = 8.87081e+42 erg / s Luminosity absorbed = 2.87116e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Plasma stratification:
t_rad next_t_rad w next_w
Shell
0 11404.686443 10732.832306 0.497739 0.444436
5 11664.227712 11084.302807 0.189070 0.162591
10 11444.220669 10899.736539 0.117732 0.099122
15 11052.698087 10465.941519 0.089141 0.077378
(base.py:436)
[tardis.simulation.base][INFO ] t_inner 10190.841 K -- next t_inner 11136.097 K (base.py:439)
[tardis.simulation.base][INFO ] Starting iteration 20/20 (base.py:326)
[py.warnings ][WARNING] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars
(si.m, si.Hz, lambda x: _si.c.value / x),
(warnings.py:110)
Running post-merge numba montecarlo (with C close lines)!
[py.warnings ][WARNING] /home/jals/wrkspc/TARDIS/tardis/tardis/montecarlo/montecarlo_numba/base.py:84: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
np.array(virt_packet_nus)
(warnings.py:110)
[py.warnings ][WARNING] /home/jals/wrkspc/TARDIS/tardis/tardis/montecarlo/montecarlo_numba/base.py:87: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
np.array(virt_packet_energies)
(warnings.py:110)
[py.warnings ][WARNING] /home/jals/wrkspc/TARDIS/tardis/tardis/montecarlo/montecarlo_numba/base.py:90: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
np.array(virt_packet_last_interaction_in_nu)
(warnings.py:110)
[py.warnings ][WARNING] /home/jals/wrkspc/TARDIS/tardis/tardis/montecarlo/montecarlo_numba/base.py:93: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
np.array(virt_packet_last_interaction_type)
(warnings.py:110)
[py.warnings ][WARNING] /home/jals/wrkspc/TARDIS/tardis/tardis/montecarlo/montecarlo_numba/base.py:96: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
np.array(virt_packet_last_line_interaction_in_id)
(warnings.py:110)
[py.warnings ][WARNING] /home/jals/wrkspc/TARDIS/tardis/tardis/montecarlo/montecarlo_numba/base.py:99: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
np.array(virt_packet_last_line_interaction_out_id)
(warnings.py:110)
[tardis.simulation.base][INFO ] Luminosity emitted = 1.26319e+43 erg / s Luminosity absorbed = 4.10706e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (base.py:450)
[tardis.simulation.base][INFO ] Simulation finished in 20 iterations and took 53.57 s (base.py:384)
Now, import functions & class to create widgets from visualization
subpackage:
[2]:
from tardis.visualization import (
shell_info_from_simulation,
shell_info_from_hdf,
LineInfoWidget,
)
Shell Info Widget¶
This widget allows you to explore chemical abundances of each shell - all the way from elements to ions to levels - by just clicking on the rows you want to explore!
There are two ways in which you can generate the widget:
Using a Simulation object¶
We will use the simulation object we created in the beginning, sim
to generate shell info widget. Then simply display it to start using.
[3]:
shell_info_widget = shell_info_from_simulation(sim)
shell_info_widget.display()
You can interact with the widget produced in output above (which won’t be visible if you’re viewing this notebook in our docs as an html page) like this:
Using a saved simulation (HDF file)¶
Alternatively, if you have a TARDIS simulation model saved on your disk as an HDF file, you can also use it to generate the shell info widget.
[4]:
shell_info_widget = shell_info_from_hdf('demo.hdf')
shell_info_widget.display()
Line Info Widget¶
This widget lets you explore the atomic lines responsible for producing features in the simulated spectrum.
You can select any wavelength range in the spectrum interactively to display a table giving the fraction of packets that experienced their last interaction with each species. Using toggle buttons, you can specify whether to filter the selected range by the emitted or absorbed wavelengths of packets. Clicking on a row in the species table, shows packet counts for each last line interaction of the selected species, which can be grouped in several ways.
To generate line info widget, we will again use the simulation object sim
and then display the widget:
[5]:
line_info_widget = LineInfoWidget.from_simulation(sim)
line_info_widget.display()
You can interact with this widget (which again won’t be visible if you’re viewing this notebook in our docs as an html page) like this:
Important: The virtual packet logging capability must be active in order to produce virtual packets’ spectrum in Line Info Widget
. Thus, make sure to set virtual_packet_logging: True
in your configuration file. It should be added under virtual
property of spectrum
property, as described in configuration schema.
[ ]: