From 427c196548f82ada3dd264d5ba95a9baba587769 Mon Sep 17 00:00:00 2001 From: Sarthak Srivastava Date: Mon, 11 Mar 2024 23:08:37 -0400 Subject: [PATCH] Change dtype of interaction_type to categorical in rpacket_tracker_df --- docs/io/output/rpacket_tracking.ipynb | 2997 ++++++++++++++++- docs/tardis_example.yml | 2 + .../montecarlo/montecarlo_numba/r_packet.py | 17 +- 3 files changed, 2919 insertions(+), 97 deletions(-) diff --git a/docs/io/output/rpacket_tracking.ipynb b/docs/io/output/rpacket_tracking.ipynb index b2a1127f00f..4770b5fb724 100644 --- a/docs/io/output/rpacket_tracking.ipynb +++ b/docs/io/output/rpacket_tracking.ipynb @@ -6,7 +6,7 @@ "id": "f57cd4fe", "metadata": {}, "source": [ - "# Tracking the Properties of Real Packets" + "# Tracking the Properties of Real Packets\n" ] }, { @@ -15,7 +15,7 @@ "id": "c103617c", "metadata": {}, "source": [ - "**TARDIS** has the functionality to track the properties of the *RPackets* that are generated when running the Simulation. The `rpacket_tracker` can track all the interactions a packet undergoes & thus keeps a track of the various properties, a packet may have.
Currently, the `rpacket_tracker` tracks the properties of all the rpackets in the *Last Iteration of the Simulation*. It generates a `List` that contains the individual instances of `RPacketCollection`{`Numba JITClass`}, for storing all the interaction properties as listed below." + "**TARDIS** has the functionality to track the properties of the _RPackets_ that are generated when running the Simulation. The `rpacket_tracker` can track all the interactions a packet undergoes & thus keeps a track of the various properties, a packet may have.
Currently, the `rpacket_tracker` tracks the properties of all the rpackets in the _Last Iteration of the Simulation_. It generates a `List` that contains the individual instances of `RPacketCollection`{`Numba JITClass`}, for storing all the interaction properties as listed below.\n" ] }, { @@ -39,7 +39,7 @@ "
  • interaction_type - Last Interaction type of the packet
  • \n", " \n", " \n", - "" + "\n" ] }, { @@ -48,7 +48,7 @@ "id": "4b0de6ca", "metadata": {}, "source": [ - "The data can be obtained in two ways i.e. `rpacket_tracker` and `rpacket_tracker_df`. The `rpacket_tracker` stores all the data for the interaction of the packets in a `list`, so it needs to accessed with a `list index` for each property for a particular `rpacket`. `rpacket_tracker_df` stores the data in a dataframe. Examples for the same are shown as follows. " + "The data can be obtained in two ways i.e. `rpacket_tracker` and `rpacket_tracker_df`. The `rpacket_tracker` stores all the data for the interaction of the packets in a `list`, so it needs to accessed with a `list index` for each property for a particular `rpacket`. `rpacket_tracker_df` stores the data in a dataframe. Examples for the same are shown as follows.\n" ] }, { @@ -57,7 +57,7 @@ "id": "1686d9f1", "metadata": {}, "source": [ - "## How to Setup the Tracking for the RPackets?" + "## How to Setup the Tracking for the RPackets?\n" ] }, { @@ -66,15 +66,15 @@ "id": "29e14475", "metadata": {}, "source": [ - "**TARDIS**' `rpacket_tracker` is configured via the `YAML` file. This functionality of tracking the packets is turned **off**, by default. This is due to that fact that using this property, may slow down the execution time for the Simulation. An example configuration can be seen below for setting up the *tracking*:\n", + "**TARDIS**' `rpacket_tracker` is configured via the `YAML` file. This functionality of tracking the packets is turned **off**, by default. This is due to that fact that using this property, may slow down the execution time for the Simulation. An example configuration can be seen below for setting up the _tracking_:\n", "\n", "```yaml\n", - "... \n", + "---\n", "montecarlo:\n", - "...\n", + "---\n", "tracking:\n", - " track_rpacket: true\n", - "```" + " track_rpacket: true\n", + "```\n" ] }, { @@ -83,7 +83,7 @@ "id": "13b6420b", "metadata": {}, "source": [ - "The `montecarlo` section of the **YAML** file now has a `tracking` sub section which holds the configuration properties for the `track_rpacket` & the `initial_array_length` (discussed later in the tutorial)." + "The `montecarlo` section of the **YAML** file now has a `tracking` sub section which holds the configuration properties for the `track_rpacket` & the `initial_array_length` (discussed later in the tutorial).\n" ] }, { @@ -92,22 +92,51 @@ "id": "2634c571", "metadata": {}, "source": [ - "Let us see, the new `rpacket_tracker` in action." + "Let us see, the new `rpacket_tracker` in action.\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "a0e975b6", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "4e9096cc57fc42618b34d2575e46afdd", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Iterations: 0/? [00:00\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    09.93e+03 K1.01e+04 K0.40.507
    59.85e+03 K1.02e+04 K0.2110.197
    109.78e+03 K1.01e+04 K0.1430.117
    159.71e+03 K9.87e+03 K0.1050.0869
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 9933.952 K\n", + "\tExpected t_inner for next iteration = 10703.212 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 2 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.071e+43 erg / s\n", + "\tLuminosity absorbed = 3.576e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.01e+04 K1.08e+04 K0.5070.525
    51.02e+04 K1.1e+04 K0.1970.203
    101.01e+04 K1.08e+04 K0.1170.125
    159.87e+03 K1.05e+04 K0.08690.0933
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10703.212 K\n", + "\tExpected t_inner for next iteration = 10673.712 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 3 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.074e+43 erg / s\n", + "\tLuminosity absorbed = 3.391e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.08e+04 K1.1e+04 K0.5250.483
    51.1e+04 K1.12e+04 K0.2030.189
    101.08e+04 K1.1e+04 K0.1250.118
    151.05e+04 K1.06e+04 K0.09330.0895
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10673.712 K\n", + "\tExpected t_inner for next iteration = 10635.953 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 4 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.058e+43 erg / s\n", + "\tLuminosity absorbed = 3.352e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.1e+04 K0.4830.469
    51.12e+04 K1.12e+04 K0.1890.182
    101.1e+04 K1.1e+04 K0.1180.113
    151.06e+04 K1.07e+04 K0.08950.0861
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10635.953 K\n", + "\tExpected t_inner for next iteration = 10638.407 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 5 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.055e+43 erg / s\n", + "\tLuminosity absorbed = 3.399e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.1e+04 K0.4690.479
    51.12e+04 K1.13e+04 K0.1820.178
    101.1e+04 K1.1e+04 K0.1130.113
    151.07e+04 K1.07e+04 K0.08610.0839
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10638.407 K\n", + "\tExpected t_inner for next iteration = 10650.202 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 6 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.061e+43 erg / s\n", + "\tLuminosity absorbed = 3.398e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.1e+04 K0.4790.47
    51.13e+04 K1.12e+04 K0.1780.185
    101.1e+04 K1.11e+04 K0.1130.112
    151.07e+04 K1.07e+04 K0.08390.0856
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10650.202 K\n", + "\tExpected t_inner for next iteration = 10645.955 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 7 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.061e+43 erg / s\n", + "\tLuminosity absorbed = 3.382e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.1e+04 K0.470.47
    51.12e+04 K1.13e+04 K0.1850.178
    101.11e+04 K1.11e+04 K0.1120.112
    151.07e+04 K1.07e+04 K0.08560.086
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10645.955 K\n", + "\tExpected t_inner for next iteration = 10642.050 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 8 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.062e+43 erg / s\n", + "\tLuminosity absorbed = 3.350e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.11e+04 K0.470.472
    51.13e+04 K1.14e+04 K0.1780.175
    101.11e+04 K1.11e+04 K0.1120.111
    151.07e+04 K1.07e+04 K0.0860.084
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10642.050 K\n", + "\tExpected t_inner for next iteration = 10636.106 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 9 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.052e+43 erg / s\n", + "\tLuminosity absorbed = 3.411e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 5/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.11e+04 K0.4720.469
    51.14e+04 K1.15e+04 K0.1750.17
    101.11e+04 K1.11e+04 K0.1110.109
    151.07e+04 K1.08e+04 K0.0840.0822
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10636.106 K\n", + "\tExpected t_inner for next iteration = 10654.313 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 10 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.070e+43 erg / s\n", + "\tLuminosity absorbed = 3.335e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.1e+04 K0.4690.475
    51.15e+04 K1.14e+04 K0.170.177
    101.11e+04 K1.11e+04 K0.1090.112
    151.08e+04 K1.06e+04 K0.08220.0878
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10654.313 K\n", + "\tExpected t_inner for next iteration = 10628.190 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 11 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.053e+43 erg / s\n", + "\tLuminosity absorbed = 3.363e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.1e+04 K0.4750.472
    51.14e+04 K1.12e+04 K0.1770.184
    101.11e+04 K1.1e+04 K0.1120.114
    151.06e+04 K1.06e+04 K0.08780.0859
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10628.190 K\n", + "\tExpected t_inner for next iteration = 10644.054 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 12 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.056e+43 erg / s\n", + "\tLuminosity absorbed = 3.420e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.11e+04 K0.4720.467
    51.12e+04 K1.13e+04 K0.1840.176
    101.1e+04 K1.11e+04 K0.1140.11
    151.06e+04 K1.08e+04 K0.08590.0821
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10644.054 K\n", + "\tExpected t_inner for next iteration = 10653.543 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 13 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.062e+43 erg / s\n", + "\tLuminosity absorbed = 3.406e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.11e+04 K0.4670.466
    51.13e+04 K1.13e+04 K0.1760.18
    101.11e+04 K1.11e+04 K0.110.111
    151.08e+04 K1.08e+04 K0.08210.0841
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10653.543 K\n", + "\tExpected t_inner for next iteration = 10647.277 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 14 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.063e+43 erg / s\n", + "\tLuminosity absorbed = 3.369e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.11e+04 K0.4660.469
    51.13e+04 K1.13e+04 K0.180.182
    101.11e+04 K1.1e+04 K0.1110.113
    151.08e+04 K1.07e+04 K0.08410.0854
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10647.277 K\n", + "\tExpected t_inner for next iteration = 10638.875 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 15 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.053e+43 erg / s\n", + "\tLuminosity absorbed = 3.417e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.1e+04 K0.4690.484
    51.13e+04 K1.13e+04 K0.1820.181
    101.1e+04 K1.1e+04 K0.1130.113
    151.07e+04 K1.07e+04 K0.08540.0858
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10638.875 K\n", + "\tExpected t_inner for next iteration = 10655.125 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 16 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.059e+43 erg / s\n", + "\tLuminosity absorbed = 3.445e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.1e+04 K0.4840.472
    51.13e+04 K1.13e+04 K0.1810.177
    101.1e+04 K1.1e+04 K0.1130.113
    151.07e+04 K1.06e+04 K0.08580.0858
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10655.125 K\n", + "\tExpected t_inner for next iteration = 10655.561 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 17 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.067e+43 erg / s\n", + "\tLuminosity absorbed = 3.372e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.1e+04 K1.11e+04 K0.4720.468
    51.13e+04 K1.14e+04 K0.1770.175
    101.1e+04 K1.11e+04 K0.1130.11
    151.06e+04 K1.08e+04 K0.08580.0816
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10655.561 K\n", + "\tExpected t_inner for next iteration = 10636.536 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 18 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.057e+43 erg / s\n", + "\tLuminosity absorbed = 3.365e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.11e+04 K0.4680.464
    51.14e+04 K1.13e+04 K0.1750.177
    101.11e+04 K1.1e+04 K0.110.113
    151.08e+04 K1.07e+04 K0.08160.0848
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10636.536 K\n", + "\tExpected t_inner for next iteration = 10641.692 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 19 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.056e+43 erg / s\n", + "\tLuminosity absorbed = 3.405e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\tIteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:261)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tPlasma stratification: (\u001b[1mbase.py\u001b[0m:541)\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    Shell No.t_radnext_t_radwnext_w
    01.11e+04 K1.11e+04 K0.4640.466
    51.13e+04 K1.13e+04 K0.1770.177
    101.1e+04 K1.11e+04 K0.1130.111
    151.07e+04 K1.07e+04 K0.08480.0853
    \n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tCurrent t_inner = 10641.692 K\n", + "\tExpected t_inner for next iteration = 10650.463 K\n", + " (\u001b[1mbase.py\u001b[0m:568)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] \n", + "\t/Users/archil/Documents/tardis/tardis/plasma/properties/radiative_properties.py:93: RuntimeWarning: invalid value encountered in divide\n", + " (g_lower * n_upper) / (g_upper * n_lower)\n", + " (\u001b[1mwarnings.py\u001b[0m:109)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tSimulation finished in 19 iterations \n", + "\tSimulation took 42.08 s\n", + " (\u001b[1mbase.py\u001b[0m:469)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tStarting iteration 20 of 20 (\u001b[1mbase.py\u001b[0m:391)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] \n", + "\t\n", + "\tLuminosity emitted = 1.061e+43 erg / s\n", + "\tLuminosity absorbed = 3.401e+42 erg / s\n", + "\tLuminosity requested = 1.059e+43 erg / s\n", + " (\u001b[1mbase.py\u001b[0m:573)\n" + ] + } + ], "source": [ "# Running the simulation from the config\n", "\n", @@ -192,15 +1838,26 @@ "id": "532bfafc", "metadata": {}, "source": [ - "Now, the `tracked` properties can be accessed via the `rpacket_tracker` attribute of the `sim.transport` object. " + "Now, the `tracked` properties can be accessed via the `rpacket_tracker` attribute of the `sim.transport.transport_state` object.\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "f8b3424f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "numba.typed.typedlist.List" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "type(sim.transport.transport_state.rpacket_tracker)" ] @@ -211,7 +1868,7 @@ "id": "4771d92a", "metadata": {}, "source": [ - "It can be seen from the above code, that the `sim.transport.rpacket_tracker` is an instance of the `List` specifically *Numba Typed List*. The `RPacketCollection` class has the following structure for the properties : {More information in the **TARDIS API** for `RPacketCollection` class}" + "It can be seen from the above code, that the `sim.transport.transport_state.rpacket_tracker` is an instance of the `List` specifically _Numba Typed List_. The `RPacketCollection` class has the following structure for the properties : {More information in the **TARDIS API** for `RPacketCollection` class}\n" ] }, { @@ -233,15 +1890,26 @@ " energy\n", " shell_id\n", " interaction_type\n", - "```" + "```\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "a3ea2f54", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "100000" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "len(sim.transport.transport_state.rpacket_tracker)" ] @@ -252,7 +1920,7 @@ "id": "0f8566f4", "metadata": {}, "source": [ - "### Accessing properties through `rpacket_tracker`" + "### Accessing properties through `rpacket_tracker`\n" ] }, { @@ -262,7 +1930,7 @@ "metadata": {}, "source": [ "To access these different properties, we may consider the following examples for the `rpacket_tracker`:\n", - "
    In this Example, we are trying to access the properties of the packet at index `10`.
    In a similar way, we can check for any property for any packet in the range of packets for the last iteration." + "
    In this Example, we are trying to access the properties of the packet at index `10`.
    In a similar way, we can check for any property for any packet in the range of packets for the last iteration.\n" ] }, { @@ -271,15 +1939,26 @@ "id": "a4772b00", "metadata": {}, "source": [ - "#### Accessing the `index` property for the packet with index = 10 :" + "#### Accessing the `index` property for the packet with index = 10 :\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "de7b8877", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker[10].index" ] @@ -290,15 +1969,26 @@ "id": "d81fbbf7", "metadata": {}, "source": [ - "#### Accessing the `seed` property for the packet with index = 10 :" + "#### Accessing the `seed` property for the packet with index = 10 :\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "39e2dbd2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "2729103521" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker[10].seed" ] @@ -309,15 +1999,28 @@ "id": "7afe2110", "metadata": {}, "source": [ - "#### Accessing the `status` property for the packet with index = 10 :" + "#### Accessing the `status` property for the packet with index = 10 :\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "e82427ea", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", + " 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n", + " 0, 0, 0, 0, 0, 0, 0, 0, 1])" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker[10].status" ] @@ -328,7 +2031,7 @@ "id": "ea308a55", "metadata": {}, "source": [ - "Thus, all other properties (`r`, `nu`, `mu`, `energy`, `shell_id`,`interaction_type`) can be accessed accordingly." + "Thus, all other properties (`r`, `nu`, `mu`, `energy`, `shell_id`,`interaction_type`) can be accessed accordingly.\n" ] }, { @@ -337,15 +2040,26 @@ "id": "c83dd906", "metadata": {}, "source": [ - "We can also see the total number of interactions of index `10` packet under went, with the following example:" + "We can also see the total number of interactions of index `10` packet under went, with the following example:\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "090b1517", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "53" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "len(sim.transport.transport_state.rpacket_tracker[10].shell_id)" ] @@ -360,8 +2074,9 @@ "\n", "Warning\n", "\n", - "If we try to access `sim.transport.rpacket_tracker` property when we have the `track_rpacket` property in the `tracking` subsection of `montecarlo` config, turned off as follows `config[\"montecarlo\"][\"tracking\"][\"track_rpacket\"] = False`, it will return `None`. Error will be raised if we try to access the properties i.e. `seed`, `index`, etc.\n", - "" + "If we try to access `sim.transport.transport_state.rpacket_tracker` property when we have the `track_rpacket` property in the `tracking` subsection of `montecarlo` config, turned off as follows `config[\"montecarlo\"][\"tracking\"][\"track_rpacket\"] = False`, it will return `None`. Error will be raised if we try to access the properties i.e. `seed`, `index`, etc.\n", + "\n", + "\n" ] }, { @@ -373,9 +2088,10 @@ "
    \n", "\n", "Note\n", - " \n", + "\n", "When we initialise the `RPacketCollection()` class, the properties arrays {`index`, `seed`, `status`, etc} are allocated certain length based on the `initial_array_length` parameter that can be set via the `initial_array_length` property under `montecarlo -> tracking` section of the configuration. The default size of the array is `10`. This variable is important as the number of interactions a packet may have is variable, thus we need to allocate space dynamically. This variable is used to compute the size and expand the array such that the properties are able to hold these values for the packet interaction. Higher number, allocates more space initially leading to lesser times the arrays expands and vice versa. It can be set in the following manner `config[\"montecarlo\"][\"tracking\"][\"initial_array_length\"] = {value}`.\n", - "
    " + "\n", + "\n" ] }, { @@ -384,7 +2100,7 @@ "id": "2da1215e", "metadata": {}, "source": [ - "### Accessing properties with `rpacket_tracker_df`" + "### Accessing properties with `rpacket_tracker_df`\n" ] }, { @@ -393,15 +2109,26 @@ "id": "6eaee13d", "metadata": {}, "source": [ - "Also, the `tracked` properties can be accessed via the `rpacket_tracker_df` attribute of the `sim.transport` object. " + "Also, the `tracked` properties can be accessed via the `rpacket_tracker_df` attribute of the `sim.transport.transport_state` object.\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "5fa074c2", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "pandas.core.frame.DataFrame" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "type(sim.transport.transport_state.rpacket_tracker_df)" ] @@ -412,7 +2139,7 @@ "id": "9a39309b", "metadata": {}, "source": [ - "Here, all the properties of the rpackets discussed above are stored as a `Pandas.Dataframe` object. This makes accessing the properties of any rpacket more convenient and in a more organized way." + "Here, all the properties of the rpackets discussed above are stored as a `Pandas.Dataframe` object. This makes accessing the properties of any rpacket more convenient and in a more organized way.\n" ] }, { @@ -442,7 +2169,7 @@ "
  • interaction_type
  • \n", " \n", " \n", - "" + "\n" ] }, { @@ -451,15 +2178,226 @@ "id": "54dce761", "metadata": {}, "source": [ - "The entire dataframe, containing all the properties mentioned above, can be fetched as:" + "The entire dataframe, containing all the properties mentioned above, can be fetched as:\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "0ec47b2f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    statusseedrnumuenergyshell_idinteraction_type
    indexstep
    00033380163381.235520e+151.736483e+150.8397650.000010-1
    1033380163381.263676e+152.569811e+15-0.6085490.0000102
    2033380163381.244956e+151.684571e+150.0522090.0000102
    3033380163381.245022e+151.682866e+150.0258720.0000102
    4033380163381.248276e+159.577869e+14-0.2815240.0000102
    ..............................
    999991708644150012.044224e+151.159042e+140.9048340.00001161
    1808644150012.094768e+151.159042e+140.9095970.00001171
    1908644150012.145312e+151.159042e+140.9140060.00001181
    2008644150012.195856e+151.159042e+140.9180940.00001191
    2118644150012.246400e+151.159042e+140.9218930.00001191
    \n", + "

    1981438 rows × 8 columns

    \n", + "
    " + ], + "text/plain": [ + " status seed r nu mu energy \\\n", + "index step \n", + "0 0 0 3338016338 1.235520e+15 1.736483e+15 0.839765 0.00001 \n", + " 1 0 3338016338 1.263676e+15 2.569811e+15 -0.608549 0.00001 \n", + " 2 0 3338016338 1.244956e+15 1.684571e+15 0.052209 0.00001 \n", + " 3 0 3338016338 1.245022e+15 1.682866e+15 0.025872 0.00001 \n", + " 4 0 3338016338 1.248276e+15 9.577869e+14 -0.281524 0.00001 \n", + "... ... ... ... ... ... ... \n", + "99999 17 0 864415001 2.044224e+15 1.159042e+14 0.904834 0.00001 \n", + " 18 0 864415001 2.094768e+15 1.159042e+14 0.909597 0.00001 \n", + " 19 0 864415001 2.145312e+15 1.159042e+14 0.914006 0.00001 \n", + " 20 0 864415001 2.195856e+15 1.159042e+14 0.918094 0.00001 \n", + " 21 1 864415001 2.246400e+15 1.159042e+14 0.921893 0.00001 \n", + "\n", + " shell_id interaction_type \n", + "index step \n", + "0 0 0 -1 \n", + " 1 0 2 \n", + " 2 0 2 \n", + " 3 0 2 \n", + " 4 0 2 \n", + "... ... ... \n", + "99999 17 16 1 \n", + " 18 17 1 \n", + " 19 18 1 \n", + " 20 19 1 \n", + " 21 19 1 \n", + "\n", + "[1981438 rows x 8 columns]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker_df" ] @@ -471,7 +2409,7 @@ "metadata": {}, "source": [ "To access these different properties in the dataframe, we may consider the following examples for the `rpacket_tracker_df`:\n", - "
    In this Example, we are trying to access the properties of the packet at index `10`.
    In a similar way, we can check for any property for any packet in the range of packets for the last iteration." + "
    In this Example, we are trying to access the properties of the packet at index `10`.
    In a similar way, we can check for any property for any packet in the range of packets for the last iteration.\n" ] }, { @@ -480,15 +2418,764 @@ "id": "eb8df3d9", "metadata": {}, "source": [ - "#### Accessing all the properties for the packet with index = 10:" + "#### Accessing all the properties for the packet with index = 10:\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "612c8234", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
    \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
    statusseedrnumuenergyshell_idinteraction_type
    step
    0027291035211.235520e+152.100434e+150.5874330.0000100-1
    1027291035211.286064e+152.100434e+150.6289230.0000101-1
    2027291035211.336608e+152.100434e+150.6636230.0000102-1
    3027291035211.387152e+152.100434e+150.6931330.0000103-1
    4027291035211.437696e+152.100434e+150.7185560.0000104-1
    5027291035211.488240e+152.100434e+150.7406880.0000105-1
    6027291035211.514008e+151.966980e+15-0.7071270.00001051
    7027291035211.488240e+151.966980e+15-0.6946680.00001041
    8027291035211.437696e+151.966980e+15-0.6674900.00001031
    9027291035211.387152e+151.966980e+15-0.6359250.00001021
    10027291035211.387113e+152.093418e+150.8686960.00001022
    11027291035211.387152e+152.093418e+150.8687040.00001032
    12027291035211.437696e+152.093418e+150.8784050.00001042
    13027291035211.488240e+152.093418e+150.8870430.00001052
    14027291035211.538784e+152.093418e+150.8947730.00001062
    15027291035211.589328e+152.093418e+150.9017200.00001072
    16027291035211.639872e+152.093418e+150.9079880.00001082
    17027291035211.690416e+152.093418e+150.9136650.00001092
    18027291035211.709334e+152.754770e+150.3570890.00001092
    19027291035211.726723e+153.040742e+150.2242090.00001092
    20027291035211.740960e+153.040742e+150.2563980.000010102
    21027291035211.752721e+151.680385e+150.2264000.000010102
    22027291035211.764487e+151.669485e+150.1297740.000010102
    23027291035211.791504e+151.669485e+150.2151070.000010112
    24027291035211.793179e+151.575386e+15-0.8893320.000009112
    25027291035211.791504e+151.575386e+15-0.8891120.000009102
    26027291035211.740960e+151.575386e+15-0.8821450.00000992
    27027291035211.690416e+151.575386e+15-0.8744810.00000982
    28027291035211.639872e+151.575386e+15-0.8660190.00000972
    29027291035211.589328e+151.575386e+15-0.8566420.00000962
    30027291035211.538784e+151.575386e+15-0.8462050.00000952
    31027291035211.488240e+151.575386e+15-0.8345350.00000942
    32027291035211.439546e+151.610949e+15-0.2874070.00000941
    33027291035211.437696e+151.610949e+15-0.2832680.00000931
    34027291035211.419306e+152.160489e+150.4958930.00001032
    35027291035211.437696e+152.160489e+150.5148570.00001042
    36027291035211.488240e+152.160489e+150.5604900.00001052
    37027291035211.513523e+151.212817e+150.6187400.00001052
    38027291035211.538784e+151.212817e+150.6347720.00001062
    39027291035211.589328e+151.212817e+150.6635570.00001072
    40027291035211.639872e+151.212817e+150.6886780.00001082
    41027291035211.690416e+151.212817e+150.7108070.00001092
    42027291035211.740960e+151.212817e+150.7304500.000010102
    43027291035211.791504e+151.212817e+150.7480010.000010112
    44027291035211.842048e+151.212817e+150.7637710.000010122
    45027291035211.892592e+151.212817e+150.7780130.000010132
    46027291035211.943136e+151.212817e+150.7909300.000010142
    47027291035211.993680e+151.212817e+150.8026920.000010152
    48027291035212.044224e+151.212817e+150.8134410.000010162
    49027291035212.094768e+151.212817e+150.8232950.000010172
    50027291035212.145312e+151.212817e+150.8323570.000010182
    51027291035212.195856e+151.212817e+150.8407120.000010192
    52127291035212.246400e+151.212817e+150.8484350.000010192
    \n", + "
    " + ], + "text/plain": [ + " status seed r nu mu energy \\\n", + "step \n", + "0 0 2729103521 1.235520e+15 2.100434e+15 0.587433 0.000010 \n", + "1 0 2729103521 1.286064e+15 2.100434e+15 0.628923 0.000010 \n", + "2 0 2729103521 1.336608e+15 2.100434e+15 0.663623 0.000010 \n", + "3 0 2729103521 1.387152e+15 2.100434e+15 0.693133 0.000010 \n", + "4 0 2729103521 1.437696e+15 2.100434e+15 0.718556 0.000010 \n", + "5 0 2729103521 1.488240e+15 2.100434e+15 0.740688 0.000010 \n", + "6 0 2729103521 1.514008e+15 1.966980e+15 -0.707127 0.000010 \n", + "7 0 2729103521 1.488240e+15 1.966980e+15 -0.694668 0.000010 \n", + "8 0 2729103521 1.437696e+15 1.966980e+15 -0.667490 0.000010 \n", + "9 0 2729103521 1.387152e+15 1.966980e+15 -0.635925 0.000010 \n", + "10 0 2729103521 1.387113e+15 2.093418e+15 0.868696 0.000010 \n", + "11 0 2729103521 1.387152e+15 2.093418e+15 0.868704 0.000010 \n", + "12 0 2729103521 1.437696e+15 2.093418e+15 0.878405 0.000010 \n", + "13 0 2729103521 1.488240e+15 2.093418e+15 0.887043 0.000010 \n", + "14 0 2729103521 1.538784e+15 2.093418e+15 0.894773 0.000010 \n", + "15 0 2729103521 1.589328e+15 2.093418e+15 0.901720 0.000010 \n", + "16 0 2729103521 1.639872e+15 2.093418e+15 0.907988 0.000010 \n", + "17 0 2729103521 1.690416e+15 2.093418e+15 0.913665 0.000010 \n", + "18 0 2729103521 1.709334e+15 2.754770e+15 0.357089 0.000010 \n", + "19 0 2729103521 1.726723e+15 3.040742e+15 0.224209 0.000010 \n", + "20 0 2729103521 1.740960e+15 3.040742e+15 0.256398 0.000010 \n", + "21 0 2729103521 1.752721e+15 1.680385e+15 0.226400 0.000010 \n", + "22 0 2729103521 1.764487e+15 1.669485e+15 0.129774 0.000010 \n", + "23 0 2729103521 1.791504e+15 1.669485e+15 0.215107 0.000010 \n", + "24 0 2729103521 1.793179e+15 1.575386e+15 -0.889332 0.000009 \n", + "25 0 2729103521 1.791504e+15 1.575386e+15 -0.889112 0.000009 \n", + "26 0 2729103521 1.740960e+15 1.575386e+15 -0.882145 0.000009 \n", + "27 0 2729103521 1.690416e+15 1.575386e+15 -0.874481 0.000009 \n", + "28 0 2729103521 1.639872e+15 1.575386e+15 -0.866019 0.000009 \n", + "29 0 2729103521 1.589328e+15 1.575386e+15 -0.856642 0.000009 \n", + "30 0 2729103521 1.538784e+15 1.575386e+15 -0.846205 0.000009 \n", + "31 0 2729103521 1.488240e+15 1.575386e+15 -0.834535 0.000009 \n", + "32 0 2729103521 1.439546e+15 1.610949e+15 -0.287407 0.000009 \n", + "33 0 2729103521 1.437696e+15 1.610949e+15 -0.283268 0.000009 \n", + "34 0 2729103521 1.419306e+15 2.160489e+15 0.495893 0.000010 \n", + "35 0 2729103521 1.437696e+15 2.160489e+15 0.514857 0.000010 \n", + "36 0 2729103521 1.488240e+15 2.160489e+15 0.560490 0.000010 \n", + "37 0 2729103521 1.513523e+15 1.212817e+15 0.618740 0.000010 \n", + "38 0 2729103521 1.538784e+15 1.212817e+15 0.634772 0.000010 \n", + "39 0 2729103521 1.589328e+15 1.212817e+15 0.663557 0.000010 \n", + "40 0 2729103521 1.639872e+15 1.212817e+15 0.688678 0.000010 \n", + "41 0 2729103521 1.690416e+15 1.212817e+15 0.710807 0.000010 \n", + "42 0 2729103521 1.740960e+15 1.212817e+15 0.730450 0.000010 \n", + "43 0 2729103521 1.791504e+15 1.212817e+15 0.748001 0.000010 \n", + "44 0 2729103521 1.842048e+15 1.212817e+15 0.763771 0.000010 \n", + "45 0 2729103521 1.892592e+15 1.212817e+15 0.778013 0.000010 \n", + "46 0 2729103521 1.943136e+15 1.212817e+15 0.790930 0.000010 \n", + "47 0 2729103521 1.993680e+15 1.212817e+15 0.802692 0.000010 \n", + "48 0 2729103521 2.044224e+15 1.212817e+15 0.813441 0.000010 \n", + "49 0 2729103521 2.094768e+15 1.212817e+15 0.823295 0.000010 \n", + "50 0 2729103521 2.145312e+15 1.212817e+15 0.832357 0.000010 \n", + "51 0 2729103521 2.195856e+15 1.212817e+15 0.840712 0.000010 \n", + "52 1 2729103521 2.246400e+15 1.212817e+15 0.848435 0.000010 \n", + "\n", + " shell_id interaction_type \n", + "step \n", + "0 0 -1 \n", + "1 1 -1 \n", + "2 2 -1 \n", + "3 3 -1 \n", + "4 4 -1 \n", + "5 5 -1 \n", + "6 5 1 \n", + "7 4 1 \n", + "8 3 1 \n", + "9 2 1 \n", + "10 2 2 \n", + "11 3 2 \n", + "12 4 2 \n", + "13 5 2 \n", + "14 6 2 \n", + "15 7 2 \n", + "16 8 2 \n", + "17 9 2 \n", + "18 9 2 \n", + "19 9 2 \n", + "20 10 2 \n", + "21 10 2 \n", + "22 10 2 \n", + "23 11 2 \n", + "24 11 2 \n", + "25 10 2 \n", + "26 9 2 \n", + "27 8 2 \n", + "28 7 2 \n", + "29 6 2 \n", + "30 5 2 \n", + "31 4 2 \n", + "32 4 1 \n", + "33 3 1 \n", + "34 3 2 \n", + "35 4 2 \n", + "36 5 2 \n", + "37 5 2 \n", + "38 6 2 \n", + "39 7 2 \n", + "40 8 2 \n", + "41 9 2 \n", + "42 10 2 \n", + "43 11 2 \n", + "44 12 2 \n", + "45 13 2 \n", + "46 14 2 \n", + "47 15 2 \n", + "48 16 2 \n", + "49 17 2 \n", + "50 18 2 \n", + "51 19 2 \n", + "52 19 2 " + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker_df.loc[10]" ] @@ -504,10 +3191,75 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "2c84adb1", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "step\n", + "0 0.000010\n", + "1 0.000010\n", + "2 0.000010\n", + "3 0.000010\n", + "4 0.000010\n", + "5 0.000010\n", + "6 0.000010\n", + "7 0.000010\n", + "8 0.000010\n", + "9 0.000010\n", + "10 0.000010\n", + "11 0.000010\n", + "12 0.000010\n", + "13 0.000010\n", + "14 0.000010\n", + "15 0.000010\n", + "16 0.000010\n", + "17 0.000010\n", + "18 0.000010\n", + "19 0.000010\n", + "20 0.000010\n", + "21 0.000010\n", + "22 0.000010\n", + "23 0.000010\n", + "24 0.000009\n", + "25 0.000009\n", + "26 0.000009\n", + "27 0.000009\n", + "28 0.000009\n", + "29 0.000009\n", + "30 0.000009\n", + "31 0.000009\n", + "32 0.000009\n", + "33 0.000009\n", + "34 0.000010\n", + "35 0.000010\n", + "36 0.000010\n", + "37 0.000010\n", + "38 0.000010\n", + "39 0.000010\n", + "40 0.000010\n", + "41 0.000010\n", + "42 0.000010\n", + "43 0.000010\n", + "44 0.000010\n", + "45 0.000010\n", + "46 0.000010\n", + "47 0.000010\n", + "48 0.000010\n", + "49 0.000010\n", + "50 0.000010\n", + "51 0.000010\n", + "52 0.000010\n", + "Name: energy, dtype: float64" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker_df.loc[10][\"energy\"]" ] @@ -518,25 +3270,47 @@ "id": "1beffb1f", "metadata": {}, "source": [ - "The above command returns a Pandas Series for the packet `#10` across different steps. To access any property at a particular step (for example at step `5`), the following commands can be used." + "The above command returns a Pandas Series for the packet `#10` across different steps. To access any property at a particular step (for example at step `5`), the following commands can be used.\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "1d7f0bb4", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "1.0220289382469194e-05" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "sim.transport.transport_state.rpacket_tracker_df.loc[10,5][\"energy\"]" + "sim.transport.transport_state.rpacket_tracker_df.loc[10, 5][\"energy\"]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "1cf17109", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "1.0220289382469194e-05" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "sim.transport.transport_state.rpacket_tracker_df.loc[10][\"energy\"][5]" ] @@ -547,8 +3321,45 @@ "id": "6921f480", "metadata": {}, "source": [ - "Thus, all other properties (`status`, `seed`, `r`, `nu`, `mu`, `shell_id`,`interaction_type`) can be accessed accordingly." + "Thus, all other properties (`status`, `seed`, `r`, `nu`, `mu`, `shell_id`,`interaction_type`) can be accessed accordingly.\n" ] + }, + { + "cell_type": "markdown", + "id": "7713f247", + "metadata": {}, + "source": [ + "## DType of \"interaction_type\" is pd.CategoricalDType\n" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "f9fa30c0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "CategoricalDtype(categories=[-1, 1, 2, 4, 8], ordered=False, categories_dtype=int64)" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sim.transport.transport_state.rpacket_tracker_df.interaction_type.dtype" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f1e1492", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/docs/tardis_example.yml b/docs/tardis_example.yml index 08d25b44eca..004f3d39716 100644 --- a/docs/tardis_example.yml +++ b/docs/tardis_example.yml @@ -34,6 +34,8 @@ plasma: line_interaction_type: macroatom montecarlo: + tracking: + track_rpacket: true seed: 23111963 no_of_packets: 4.0e+4 iterations: 20 diff --git a/tardis/montecarlo/montecarlo_numba/r_packet.py b/tardis/montecarlo/montecarlo_numba/r_packet.py index a6d927e5eee..383ed0529b9 100644 --- a/tardis/montecarlo/montecarlo_numba/r_packet.py +++ b/tardis/montecarlo/montecarlo_numba/r_packet.py @@ -22,6 +22,11 @@ class InteractionType(IntEnum): CONTINUUM_PROCESS = 8 +INTERACTION_TYPE_DTYPE = pd.CategoricalDtype( + categories=[-1] + [interaction.value for interaction in InteractionType] +) + + class PacketStatus(IntEnum): IN_PROCESS = 0 EMITTED = 1 @@ -134,13 +139,17 @@ def rpacket_trackers_to_dataframe(rpacket_trackers): prev_index = cur_index cur_index = prev_index + len(rpacket_tracker.r) for j, column_name in enumerate(df_dtypes.fields.keys()): - rpacket_tracker_ndarray[column_name][ - prev_index:cur_index - ] = getattr(rpacket_tracker, column_name) + rpacket_tracker_ndarray[column_name][prev_index:cur_index] = ( + getattr(rpacket_tracker, column_name) + ) index_array[0][prev_index:cur_index] = getattr(rpacket_tracker, "index") index_array[1][prev_index:cur_index] = range(cur_index - prev_index) - return pd.DataFrame( + rpacket_dataframe = pd.DataFrame( rpacket_tracker_ndarray, index=pd.MultiIndex.from_arrays(index_array, names=["index", "step"]), columns=df_dtypes.names, ) + rpacket_dataframe.interaction_type = ( + rpacket_dataframe.interaction_type.astype(INTERACTION_TYPE_DTYPE) + ) + return rpacket_dataframe