{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Generating TARDIS Widgets\n",
"A demonstration of how to generate TARDIS widgets that allows you to **explore simulation data within Jupyter Notebook with ease**!\n",
"\n",
"This notebook is a quickstart tutorial, but more details on each widget (and its features) is given in the [Using TARDIS Widgets](https://tardis-sn.github.io/tardis/using/visualization/using_widgets.html) section of the documentation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First create a simulation model that we can use to generate widgets (more details about running simulation in [Quickstart](https://tardis-sn.github.io/tardis/quickstart/quickstart.html) section):"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-18T16:10:42.838867Z",
"start_time": "2021-02-18T16:09:22.826173Z"
},
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:87)\n",
"[\u001b[1mtardis.io.atom_data.util\u001b[0m][\u001b[1;37mINFO\u001b[0m ] 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 (\u001b[1mutil.py\u001b[0m:35)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/IPython/core/interactiveshell.py:3417: PerformanceWarning: indexing past lexsort depth may impact performance.\n",
" exec(code_obj, self.user_global_ns, self.user_ns)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"[\u001b[1mtardis.io.atom_data.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1mbase.py\u001b[0m:172)\n",
"[\u001b[1mtardis.io.atom_data.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, photoionization_data (\u001b[1mbase.py\u001b[0m:178)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 1/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 7.94275e+42 erg / s Luminosity absorbed = 2.65805e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 9926.501965 10134.733717 0.400392 0.508204\n",
"\t5 9852.611678 10222.890845 0.211205 0.197026\n",
"\t10 9779.813302 10144.463169 0.142695 0.117179\n",
"\t15 9708.082813 9873.477846 0.104556 0.086941\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 9933.952 K -- next t_inner 11472.055 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 2/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.40815e+43 erg / s Luminosity absorbed = 4.77001e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10134.733717 11468.021903 0.508204 0.548671\n",
"\t5 10222.890845 11499.835340 0.197026 0.221374\n",
"\t10 10144.463169 11306.370330 0.117179 0.136291\n",
"\t15 9873.477846 10953.828130 0.086941 0.102617\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11472.055 K -- next t_inner 9949.978 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 3/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.12624e+42 erg / s Luminosity absorbed = 2.54722e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11468.021903 10497.008397 0.548671 0.442299\n",
"\t5 11499.835340 10799.075913 0.221374 0.164288\n",
"\t10 11306.370330 10623.433274 0.136291 0.101820\n",
"\t15 10953.828130 10226.187071 0.102617 0.077629\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 9949.978 K -- next t_inner 11360.097 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 4/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.36297e+43 erg / s Luminosity absorbed = 4.49721e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10497.008397 11615.344313 0.442299 0.497714\n",
"\t5 10799.075913 11729.411389 0.164288 0.199205\n",
"\t10 10623.433274 11517.190317 0.101820 0.123849\n",
"\t15 10226.187071 11103.373456 0.077629 0.093930\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11360.097 K -- next t_inner 10014.843 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 5/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.27895e+42 erg / s Luminosity absorbed = 2.66933e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11615.344313 10549.514128 0.497714 0.443441\n",
"\t5 11729.411389 10919.073481 0.199205 0.162199\n",
"\t10 11517.190317 10697.303300 0.123849 0.101289\n",
"\t15 11103.373456 10379.863073 0.093930 0.075372\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10014.843 K -- next t_inner 11328.210 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 6/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.34741e+43 erg / s Luminosity absorbed = 4.44727e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10549.514128 11567.208184 0.443441 0.504178\n",
"\t5 10919.073481 11653.124121 0.162199 0.203042\n",
"\t10 10697.303300 11425.955010 0.101289 0.125249\n",
"\t15 10379.863073 11082.155938 0.075372 0.094028\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11328.210 K -- next t_inner 10044.200 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 7/20 (\u001b[1mbase.py\u001b[0m:326)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.39001e+42 erg / s Luminosity absorbed = 2.69230e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11567.208184 10569.747403 0.504178 0.442290\n",
"\t5 11653.124121 11099.194259 0.203042 0.153253\n",
"\t10 11425.955010 10809.397890 0.125249 0.097256\n",
"\t15 11082.155938 10454.841299 0.094028 0.073809\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10044.200 K -- next t_inner 11285.966 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 8/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.33305e+43 erg / s Luminosity absorbed = 4.33011e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10569.747403 11547.678162 0.442290 0.500345\n",
"\t5 11099.194259 11669.739508 0.153253 0.198338\n",
"\t10 10809.397890 11493.569590 0.097256 0.121915\n",
"\t15 10454.841299 11083.769586 0.073809 0.092834\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11285.966 K -- next t_inner 10060.511 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 9/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.44283e+42 erg / s Luminosity absorbed = 2.70894e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11547.678162 10635.099217 0.500345 0.439520\n",
"\t5 11669.739508 11035.731464 0.198338 0.158320\n",
"\t10 11493.569590 10717.471486 0.121915 0.101642\n",
"\t15 11083.769586 10404.049299 0.092834 0.075794\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10060.511 K -- next t_inner 11268.877 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 10/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.32925e+43 erg / s Luminosity absorbed = 4.25943e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10635.099217 11500.557678 0.439520 0.506895\n",
"\t5 11035.731464 11715.267406 0.158320 0.196690\n",
"\t10 10717.471486 11451.270656 0.101642 0.123243\n",
"\t15 10404.049299 11094.423438 0.075794 0.092243\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11268.877 K -- next t_inner 10059.624 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 11/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.49497e+42 erg / s Luminosity absorbed = 2.65616e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11500.557678 10570.856509 0.506895 0.445926\n",
"\t5 11715.267406 10957.336276 0.196690 0.162837\n",
"\t10 11451.270656 10916.410391 0.123243 0.096229\n",
"\t15 11094.423438 10441.053929 0.092243 0.075026\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10059.624 K -- next t_inner 11233.248 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 12/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.30417e+43 erg / s Luminosity absorbed = 4.28820e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10570.856509 11533.554419 0.445926 0.494814\n",
"\t5 10957.336276 11764.967895 0.162837 0.189464\n",
"\t10 10916.410391 11444.191999 0.096229 0.121150\n",
"\t15 10441.053929 11084.736033 0.075026 0.090825\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11233.248 K -- next t_inner 10123.784 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 13/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.69244e+42 erg / s Luminosity absorbed = 2.74548e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11533.554419 10680.784661 0.494814 0.439281\n",
"\t5 11764.967895 10887.379428 0.189464 0.170137\n",
"\t10 11444.191999 10825.792025 0.121150 0.100780\n",
"\t15 11084.736033 10402.120228 0.090825 0.077634\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10123.784 K -- next t_inner 11175.750 K (\u001b[1mbase.py\u001b[0m:439)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 14/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.28354e+43 erg / s Luminosity absorbed = 4.15095e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10680.784661 11437.188130 0.439281 0.496749\n",
"\t5 10887.379428 11571.106856 0.170137 0.196714\n",
"\t10 10825.792025 11378.137918 0.100780 0.120954\n",
"\t15 10402.120228 10957.211814 0.077634 0.092896\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11175.750 K -- next t_inner 10152.603 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 15/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.75331e+42 erg / s Luminosity absorbed = 2.81319e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11437.188130 10637.774893 0.496749 0.452668\n",
"\t5 11571.106856 11002.647927 0.196714 0.166197\n",
"\t10 11378.137918 10832.042108 0.120954 0.101284\n",
"\t15 10957.211814 10350.602742 0.092896 0.079468\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10152.603 K -- next t_inner 11168.529 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 16/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.27820e+43 erg / s Luminosity absorbed = 4.15606e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10637.774893 11420.979987 0.452668 0.499488\n",
"\t5 11002.647927 11711.923994 0.166197 0.186857\n",
"\t10 10832.042108 11421.346118 0.101284 0.119700\n",
"\t15 10350.602742 11076.434180 0.079468 0.089402\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11168.529 K -- next t_inner 10167.208 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 17/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.81647e+42 erg / s Luminosity absorbed = 2.81681e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11420.979987 10691.849845 0.499488 0.447482\n",
"\t5 11711.923994 11042.045712 0.186857 0.164090\n",
"\t10 11421.346118 10980.886609 0.119700 0.097369\n",
"\t15 11076.434180 10456.662007 0.089402 0.077097\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10167.208 K -- next t_inner 11144.459 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 18/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.26680e+43 erg / s Luminosity absorbed = 4.12238e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 10691.849845 11404.686443 0.447482 0.497739\n",
"\t5 11042.045712 11664.227712 0.164090 0.189070\n",
"\t10 10980.886609 11444.220669 0.097369 0.117732\n",
"\t15 10456.662007 11052.698087 0.077097 0.089141\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11144.459 K -- next t_inner 10190.841 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 19/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 8.87081e+42 erg / s Luminosity absorbed = 2.87116e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Plasma stratification:\n",
"\t t_rad next_t_rad w next_w\n",
"\tShell \n",
"\t0 11404.686443 10732.832306 0.497739 0.444436\n",
"\t5 11664.227712 11084.302807 0.189070 0.162591\n",
"\t10 11444.220669 10899.736539 0.117732 0.099122\n",
"\t15 11052.698087 10465.941519 0.089141 0.077378\n",
"\n",
" (\u001b[1mbase.py\u001b[0m:436)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10190.841 K -- next t_inner 11136.097 K (\u001b[1mbase.py\u001b[0m:439)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 20/20 (\u001b[1mbase.py\u001b[0m:326)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/jals/miniconda3/envs/tardis/lib/python3.7/site-packages/astropy/units/equivalencies.py:124: RuntimeWarning: divide by zero encountered in double_scalars\n",
" (si.m, si.Hz, lambda x: _si.c.value / x),\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"Running post-merge numba montecarlo (with C close lines)!\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /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\n",
" np.array(virt_packet_nus)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /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\n",
" np.array(virt_packet_energies)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /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\n",
" np.array(virt_packet_last_interaction_in_nu)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /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\n",
" np.array(virt_packet_last_interaction_type)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /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\n",
" np.array(virt_packet_last_line_interaction_in_id)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /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\n",
" np.array(virt_packet_last_line_interaction_out_id)\n",
" (\u001b[1mwarnings.py\u001b[0m:110)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.26319e+43 erg / s Luminosity absorbed = 4.10706e+42 erg / s Luminosity requested = 1.05928e+43 erg / s (\u001b[1mbase.py\u001b[0m:450)\n",
"[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 53.57 s (\u001b[1mbase.py\u001b[0m:384)\n"
]
}
],
"source": [
"from tardis import run_tardis\n",
"sim = run_tardis('tardis_example.yml')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, import functions & class to create widgets from `visualization` subpackage:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-18T17:29:30.986893Z",
"start_time": "2021-02-18T17:29:30.978764Z"
}
},
"outputs": [],
"source": [
"from tardis.visualization import (\n",
" shell_info_from_simulation,\n",
" shell_info_from_hdf,\n",
" LineInfoWidget,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Shell Info Widget\n",
"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!\n",
"\n",
"There are two ways in which you can generate the widget:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Using a Simulation object\n",
"We will use the simulation object we created in the beginning, `sim` to generate shell info widget. Then simply display it to start using."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-18T16:11:15.097803Z",
"start_time": "2021-02-18T16:11:14.753761Z"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9761279b548a48f69a0b7f0bf0cc823f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HTML(value='Frac. Ab. denotes Fractional Abundances (i.e all values sum to 1)
…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"shell_info_widget = shell_info_from_simulation(sim)\n",
"shell_info_widget.display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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:\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Using a saved simulation (HDF file)\n",
"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."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-18T17:24:41.195180Z",
"start_time": "2021-02-18T17:24:39.006861Z"
},
"scrolled": true
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6844ae7639c841f5927e44f3500cd6af",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HTML(value='Frac. Ab. denotes Fractional Abundances (i.e all values sum to 1)
…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"shell_info_widget = shell_info_from_hdf('demo.hdf')\n",
"shell_info_widget.display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Line Info Widget\n",
"This widget lets you explore the atomic lines responsible for producing features in the simulated spectrum.\n",
"\n",
"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."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To generate line info widget, we will again use the simulation object `sim` and then display the widget:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"ExecuteTime": {
"end_time": "2021-02-18T17:24:55.634945Z",
"start_time": "2021-02-18T17:24:49.354718Z"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e024dcf3edaa4b62968dfc1e8a2c9a0a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(FigureWidget({\n",
" 'data': [{'name': 'Real packets',\n",
" 'type': 'scatter',\n",
" …"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"line_info_widget = LineInfoWidget.from_simulation(sim)\n",
"line_info_widget.display()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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:\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"