{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Initial_t_rad Bug\n", "\n", "The purpose of this notebook is to demonstrate the bug associated with setting the initial_t_rad tardis.plasma property." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'/Users/marcwilliamson/src/dev/tardis/docs/notebooks'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pwd" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/anaconda2/envs/tardis/lib/python3.6/site-packages/tqdm/autonotebook/__init__.py:14: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n", " \" (e.g. in jupyter console)\", TqdmExperimentalWarning)\n" ] } ], "source": [ "import tardis\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Density and Abundance test files\n", "\n", "Below are the density and abundance data from the test files used for demonstrating this bug." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[0.00000000e+00 2.90000000e+03 4.28253781e-16]\n", " [1.00000000e+00 3.00000000e+03 4.12668886e-16]\n", " [2.00000000e+00 3.10000000e+03 3.94940562e-16]\n", " [3.00000000e+00 3.20000000e+03 3.80047743e-16]\n", " [4.00000000e+00 3.30000000e+03 3.63720829e-16]\n", " [5.00000000e+00 3.40000000e+03 3.53372945e-16]\n", " [6.00000000e+00 3.50000000e+03 3.46148955e-16]\n", " [7.00000000e+00 3.60000000e+03 3.37683976e-16]\n", " [8.00000000e+00 3.70000000e+03 3.30780715e-16]\n", " [9.00000000e+00 3.80000000e+03 3.26689004e-16]\n", " [1.00000000e+01 3.90000000e+03 3.23089580e-16]]\n", "[[0. 1. ]\n", " [0.1 0.9]\n", " [0.2 0.8]\n", " [0.3 0.7]\n", " [0.4 0.6]\n", " [0.5 0.5]\n", " [0.6 0.4]\n", " [0.7 0.3]\n", " [0.8 0.2]\n", " [0.9 0.1]]\n" ] } ], "source": [ "density_dat = np.loadtxt('data/density.txt',skiprows=1)\n", "abund_dat = np.loadtxt('data/abund.dat', skiprows=1)\n", "\n", "print(density_dat)\n", "print(abund_dat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## No initial_t_rad\n", "\n", "Below we run a simple tardis simulation where `initial_t_rad` is not set. The simulation has v_inner_boundary = 3350 km/s and v_outer_boundary = 3750 km/s, both within the velocity range in the density file. The simulation runs fine." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.data is not yet QA compliant.\n", " return f(*args, **kwds)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.material is not yet QA compliant.\n", " return f(*args, **kwds)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:394)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /Users/marcwilliamson/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:74)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3296: 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:99)\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:184)\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:187)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/ion_population.py:63: FutureWarning: \n", "Passing list-likes to .loc or [] with any missing label will raise\n", "KeyError in the future, you can use .reindex() as an alternative.\n", "\n", "See the documentation here:\n", "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", " partition_function.index].dropna())\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 1/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 7.60257e+41 erg / s Luminosity absorbed = 2.81189e+40 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 9464.058312 9484.781155 0.439255 0.464482\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 9464.848 K -- next t_inner 12021.255 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/ion_population.py:63: FutureWarning: \n", "Passing list-likes to .loc or [] with any missing label will raise\n", "KeyError in the future, you can use .reindex() as an alternative.\n", "\n", "See the documentation here:\n", "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", " partition_function.index].dropna())\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 2/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.60837e+42 erg / s Luminosity absorbed = 5.98006e+40 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 9484.781155 12054.327238 0.464482 0.464327\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12021.255 K -- next t_inner 10497.194 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 3/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 9.75339e+41 erg / s Luminosity absorbed = 1.31663e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 12054.327238 10542.291939 0.464327 0.509656\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10497.194 K -- next t_inner 11770.965 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 4/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.41912e+42 erg / s Luminosity absorbed = 1.52432e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 10542.291939 11750.092484 0.509656 0.512801\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11770.965 K -- next t_inner 10942.574 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 5/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.11236e+42 erg / s Luminosity absorbed = 1.52914e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 11750.092484 10938.987367 0.512801 0.525724\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10942.574 K -- next t_inner 11489.809 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 6/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.29924e+42 erg / s Luminosity absorbed = 1.66012e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 10938.987367 11456.397166 0.525724 0.521184\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11489.809 K -- next t_inner 11163.104 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 7/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.16874e+42 erg / s Luminosity absorbed = 1.57467e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11456.397166 11225.829447 0.521184 0.516013\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11163.104 K -- next t_inner 11435.147 K (\u001b[1mbase.py\u001b[0m:350)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 8/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.27029e+42 erg / s Luminosity absorbed = 1.71822e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11225.829447 11346.454712 0.516013 0.53765\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11435.147 K -- next t_inner 11235.867 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 9/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.20003e+42 erg / s Luminosity absorbed = 1.63905e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11346.454712 11219.677659 0.53765 0.529105\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11235.867 K -- next t_inner 11358.682 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 10/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.24727e+42 erg / s Luminosity absorbed = 1.71495e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 5/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11219.677659 11296.3854 0.529105 0.53421\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11358.682 K -- next t_inner 11263.268 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 11/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.20567e+42 erg / s Luminosity absorbed = 1.59529e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 6/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11296.3854 11282.219084 0.53421 0.519595\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11263.268 K -- next t_inner 11359.683 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 12/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23796e+42 erg / s Luminosity absorbed = 1.69674e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 7/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11282.219084 11392.613803 0.519595 0.515397\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11359.683 K -- next t_inner 11306.524 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 13/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22796e+42 erg / s Luminosity absorbed = 1.72554e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 11392.613803 11274.095909 0.515397 0.534286\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11306.524 K -- next t_inner 11299.342 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 14/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22087e+42 erg / s Luminosity absorbed = 1.68061e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11274.095909 11272.622074 0.534286 0.523052\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11299.342 K -- next t_inner 11324.894 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 15/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23507e+42 erg / s Luminosity absorbed = 1.67026e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11272.622074 11242.582689 0.523052 0.53977\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11324.894 K -- next t_inner 11285.077 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 16/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.21940e+42 erg / s Luminosity absorbed = 1.66346e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11242.582689 11290.452474 0.53977 0.522924\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11285.077 K -- next t_inner 11317.456 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 17/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22578e+42 erg / s Luminosity absorbed = 1.67022e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11290.452474 11301.322725 0.522924 0.528649\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11317.456 K -- next t_inner 11320.345 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 18/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22546e+42 erg / s Luminosity absorbed = 1.63272e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 5/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11301.322725 11321.012024 0.528649 0.522716\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11320.345 K -- next t_inner 11324.684 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 19/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22575e+42 erg / s Luminosity absorbed = 1.70322e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 6/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11321.012024 11372.823716 0.522716 0.516131\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11324.684 K -- next t_inner 11327.703 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 20/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23543e+42 erg / s Luminosity absorbed = 1.67596e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 1.61 s (\u001b[1mbase.py\u001b[0m:306)\n" ] } ], "source": [ "no_init_trad = tardis.run_tardis('data/config_no_init_trad.yml')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$[3.35 \\times 10^{8},~3.4 \\times 10^{8},~3.5 \\times 10^{8},~3.6 \\times 10^{8},~3.7 \\times 10^{8},~3.75 \\times 10^{8}] \\; \\mathrm{\\frac{cm}{s}}$" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "no_init_trad.model.velocity" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(5, 10)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "no_init_trad.model.no_of_shells, no_init_trad.model.no_of_raw_shells" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "raw velocity: \n", " [2.9e+08 3.0e+08 3.1e+08 3.2e+08 3.3e+08 3.4e+08 3.5e+08 3.6e+08 3.7e+08\n", " 3.8e+08 3.9e+08] cm / s\n", "raw velocity shape: (11,)\n", "(v_boundary_inner, v_boundary_outer) = (3350, 3750)\n", "v_boundary_inner_index: 4\n", "v_boundary_outer_index: 10\n", "t_rad [11372.82371614 11426.15383155 11420.35713928 11382.47864204\n", " 11375.63115928] K\n" ] } ], "source": [ "print('raw velocity: \\n',no_init_trad.model.raw_velocity)\n", "print('raw velocity shape: ',no_init_trad.model.raw_velocity.shape)\n", "print('(v_boundary_inner, v_boundary_outer) = (%i, %i)'%\n", " (no_init_trad.model.v_boundary_inner.to('km/s').value, no_init_trad.model.v_boundary_outer.to('km/s').value))\n", "print('v_boundary_inner_index: ', no_init_trad.model.v_boundary_inner_index)\n", "print('v_boundary_outer_index: ', no_init_trad.model.v_boundary_outer_index)\n", "print('t_rad', no_init_trad.model.t_rad)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Debugging" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NOTE: Enter 'c' at the ipdb> prompt to continue execution.\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> b tardis/plasma/properties/j_blues:34\n", "Breakpoint 1 at /Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/j_blues.py:34\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:368)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /Users/marcwilliamson/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:74)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/bdb.py:434: PerformanceWarning: indexing past lexsort depth may impact performance.\n", " exec(cmd, globals, locals)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\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:184)\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:187)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/j_blues.py\u001b[0m(34)\u001b[0;36mcalculate\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 32 \u001b[0;31m \u001b[0;34m@\u001b[0m\u001b[0mstaticmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 33 \u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mcalculate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlines\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnu\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_rad\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m--> 34 \u001b[0;31m \u001b[0mj_blues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mw\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mintensity_black_body\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnu\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnewaxis\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_rad\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 35 \u001b[0;31m j_blues = pd.DataFrame(j_blues, index=lines.index,\n", "\u001b[0m\u001b[0;32m 36 \u001b[0;31m columns=np.arange(len(t_rad)))\n", "\u001b[0m\n", "ipdb> n\n", "ValueError: operands could not be broadcast together with shapes (5,) (247,6)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/j_blues.py\u001b[0m(34)\u001b[0;36mcalculate\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 32 \u001b[0;31m \u001b[0;34m@\u001b[0m\u001b[0mstaticmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 33 \u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mcalculate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlines\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnu\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_rad\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m--> 34 \u001b[0;31m \u001b[0mj_blues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mw\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mintensity_black_body\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnu\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnewaxis\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_rad\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 35 \u001b[0;31m j_blues = pd.DataFrame(j_blues, index=lines.index,\n", "\u001b[0m\u001b[0;32m 36 \u001b[0;31m columns=np.arange(len(t_rad)))\n", "\u001b[0m\n", "ipdb> restart\n", "Restarting\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:368)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /Users/marcwilliamson/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:74)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/bdb.py:434: PerformanceWarning: indexing past lexsort depth may impact performance.\n", " exec(cmd, globals, locals)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\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:184)\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:187)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/j_blues.py\u001b[0m(34)\u001b[0;36mcalculate\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 32 \u001b[0;31m \u001b[0;34m@\u001b[0m\u001b[0mstaticmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 33 \u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mcalculate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlines\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnu\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_rad\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mw\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m--> 34 \u001b[0;31m \u001b[0mj_blues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mw\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mintensity_black_body\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnu\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnewaxis\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mt_rad\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 35 \u001b[0;31m j_blues = pd.DataFrame(j_blues, index=lines.index,\n", "\u001b[0m\u001b[0;32m 36 \u001b[0;31m columns=np.arange(len(t_rad)))\n", "\u001b[0m\n", "ipdb> t_rad\n", "array([11000., 11000., 11000., 11000., 11000., 11000.])\n", "ipdb> lines.shape\n", "(247, 9)\n", "ipdb> intensity_black_body(nu.values[np.newaxis].T, t_rad)\n", "array([[3.45300820e-23, 3.45300820e-23, 3.45300820e-23, 3.45300820e-23,\n", " 3.45300820e-23, 3.45300820e-23],\n", " [3.45300820e-23, 3.45300820e-23, 3.45300820e-23, 3.45300820e-23,\n", " 3.45300820e-23, 3.45300820e-23],\n", " [1.17024224e-22, 1.17024224e-22, 1.17024224e-22, 1.17024224e-22,\n", " 1.17024224e-22, 1.17024224e-22],\n", " ...,\n", " [1.65889253e-10, 1.65889253e-10, 1.65889253e-10, 1.65889253e-10,\n", " 1.65889253e-10, 1.65889253e-10],\n", " [1.65754663e-10, 1.65754663e-10, 1.65754663e-10, 1.65754663e-10,\n", " 1.65754663e-10, 1.65754663e-10],\n", " [8.99221749e-11, 8.99221749e-11, 8.99221749e-11, 8.99221749e-11,\n", " 8.99221749e-11, 8.99221749e-11]])\n", "ipdb> intensity_black_body(nu.values[np.newaxis].T, t_rad).shape\n", "(247, 6)\n", "ipdb> lines.shape\n", "(247, 9)\n", "ipdb> nu.shape\n", "(247,)\n", "ipdb> restart\n", "Restarting\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> b tardis/simulation/base:436\n", "Breakpoint 2 at /Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py:436\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:368)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py\u001b[0m(436)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 434 \u001b[0;31m \u001b[0mplasma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'plasma'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 435 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m-> 436 \u001b[0;31m plasma = assemble_plasma(config, model,\n", "\u001b[0m\u001b[0;32m 437 \u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", "\u001b[0m\u001b[0;32m 438 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0;34m'runner'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "ipdb> model\n", "\n", "ipdb> model.trad\n", "*** AttributeError: 'Radial1DModel' object has no attribute 'trad'\n", "ipdb> model.t_rad\n", "\n", "ipdb> model.velocity\n", "\n", "ipdb> b tardis/model/base:334\n", "Breakpoint 3 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:334\n", "ipdb> restart\n", "Restarting\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> c\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(334)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 332 \u001b[0;31m \u001b[0mt_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtemperature\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 333 \u001b[0;31m \u001b[0;32melif\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplasma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitial_t_rad\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mu\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mK\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m3\u001b[0;32m-> 334 \u001b[0;31m \u001b[0mt_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mones\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mno_of_shells\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplasma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitial_t_rad\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 335 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 336 \u001b[0;31m \u001b[0mt_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> n\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(338)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 336 \u001b[0;31m \u001b[0mt_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 337 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m--> 338 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplasma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minitial_t_inner\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0;36m0.0\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mu\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mK\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 339 \u001b[0;31m \u001b[0mluminosity_requested\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msupernova\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mluminosity_requested\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 340 \u001b[0;31m \u001b[0mt_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> t_radiative\n", "\n", "ipdb> b tardis/model/base:107\n", "Breakpoint 4 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:107\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:368)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(107)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 105 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 106 \u001b[0;31m \u001b[0;31m#self._t_radiative = t_radiative[self.v_boundary_inner_index + 0:self.v_boundary_outer_index-1]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m4\u001b[0;32m-> 107 \u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_t_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_radiative\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 108 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 109 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mdilution_factor\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> t_radiative\n", "\n" ] } ], "source": [ "%%debug\n", "init_trad = tardis.run_tardis('data/config_init_trad.yml')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:394)\n", "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /Users/marcwilliamson/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:74)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3296: 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:99)\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:184)\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:187)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/ion_population.py:63: FutureWarning: \n", "Passing list-likes to .loc or [] with any missing label will raise\n", "KeyError in the future, you can use .reindex() as an alternative.\n", "\n", "See the documentation here:\n", "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", " partition_function.index].dropna())\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 1/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 5.98252e+41 erg / s Luminosity absorbed = 1.50141e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 11000.0 10177.195287 0.408333 0.538077\n", "\t5 11000.0 10160.603522 0.229156 0.282716\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10172.718 K -- next t_inner 14565.035 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 2/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.82691e+42 erg / s Luminosity absorbed = 2.82152e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 10177.195287 14593.630626 0.538077 0.496563\n", "\t5 10160.603522 14511.556871 0.282716 0.275395\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 14565.035 K -- next t_inner 11933.532 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 3/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 9.71423e+41 erg / s Luminosity absorbed = 2.55207e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 14593.630626 11959.523175 0.496563 0.536576\n", "\t5 14511.556871 11863.444513 0.275395 0.288444\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11933.532 K -- next t_inner 13408.534 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 4/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.34841e+42 erg / s Luminosity absorbed = 3.56350e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 11959.523175 13397.442807 0.536576 0.545853\n", "\t5 11863.444513 13434.561796 0.288444 0.279834\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 13408.534 K -- next t_inner 12787.534 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 5/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.18228e+42 erg / s Luminosity absorbed = 3.17468e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 13397.442807 12761.259654 0.545853 0.549926\n", "\t5 13434.561796 12694.451547 0.279834 0.291458\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12787.534 K -- next t_inner 13023.975 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 6/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.24451e+42 erg / s Luminosity absorbed = 3.27235e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12761.259654 12957.006442 0.549926 0.556939\n", "\t5 12694.451547 12962.669431 0.291458 0.289348\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 13023.975 K -- next t_inner 12928.870 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 7/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.20889e+42 erg / s Luminosity absorbed = 3.17537e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12957.006442 13011.562529 0.556939 0.528909\n", "\t5 12962.669431 12911.385086 0.289348 0.287062\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12928.870 K -- next t_inner 13022.158 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 8/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23931e+42 erg / s Luminosity absorbed = 3.40055e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 13011.562529 12935.144806 0.528909 0.559823\n", "\t5 12911.385086 12870.837942 0.287062 0.295395\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 13022.158 K -- next t_inner 12954.144 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 9/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22083e+42 erg / s Luminosity absorbed = 3.29617e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12935.144806 12952.771269 0.559823 0.547270\n", "\t5 12870.837942 12869.711846 0.295395 0.288923\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12954.144 K -- next t_inner 12983.662 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 10/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23857e+42 erg / s Luminosity absorbed = 3.31449e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 5/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12952.771269 12942.126028 0.547270 0.550270\n", "\t5 12869.711846 12884.875415 0.288923 0.292539\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12983.662 K -- next t_inner 12919.755 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 11/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.21056e+42 erg / s Luminosity absorbed = 3.23893e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 6/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12942.126028 12918.966676 0.550270 0.544292\n", "\t5 12884.875415 12886.798065 0.292539 0.286558\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12919.755 K -- next t_inner 13004.019 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 12/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22616e+42 erg / s Luminosity absorbed = 3.33203e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 7/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12918.966676 13031.662542 0.544292 0.538490\n", "\t5 12886.798065 13010.109337 0.286558 0.282402\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 13004.019 K -- next t_inner 13005.291 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 13/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.24894e+42 erg / s Luminosity absorbed = 3.24574e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 8/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 13031.662542 12990.586647 0.538490 0.548625\n", "\t5 13010.109337 13019.214949 0.282402 0.283709\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 13005.291 K -- next t_inner 12887.418 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 14/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.21057e+42 erg / s Luminosity absorbed = 3.20036e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 9/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12990.586647 12897.972400 0.548625 0.540328\n", "\t5 13019.214949 12826.318536 0.283709 0.288119\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12887.418 K -- next t_inner 12971.403 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 15/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23054e+42 erg / s Luminosity absorbed = 3.31427e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 12897.972400 12860.146712 0.540328 0.564957\n", "\t5 12826.318536 12875.961642 0.288119 0.291152\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12971.403 K -- next t_inner 12949.598 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 16/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22535e+42 erg / s Luminosity absorbed = 3.21967e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12860.146712 12941.966455 0.564957 0.546565\n", "\t5 12875.961642 12851.925013 0.291152 0.290785\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12949.598 K -- next t_inner 12955.177 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 17/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.21929e+42 erg / s Luminosity absorbed = 3.29847e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 12941.966455 12925.141575 0.546565 0.554237\n", "\t5 12851.925013 12885.285408 0.290785 0.289662\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12955.177 K -- next t_inner 12992.898 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 18/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22332e+42 erg / s Luminosity absorbed = 3.27060e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[\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 12925.141575 13004.854945 0.554237 0.543770\n", "\t5 12885.285408 13027.690260 0.289662 0.281762\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12992.898 K -- next t_inner 13009.263 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 19/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22932e+42 erg / s Luminosity absorbed = 3.29206e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 13004.854945 13056.576129 0.543770 0.537160\n", "\t5 13027.690260 13038.177112 0.281762 0.277439\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 13009.263 K -- next t_inner 12993.824 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 20/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23821e+42 erg / s Luminosity absorbed = 3.24957e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 2.23 s (\u001b[1mbase.py\u001b[0m:306)\n" ] } ], "source": [ "init_trad = tardis.run_tardis('data/config_init_trad.yml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Debugging" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Debugging No initial_t_radiative run to compare with Yes initial_t_radiative run\n", "\n", "\n", "We place two breakpoints:\n", "\n", "break 1. tardis/base:37 --> Stops in the run_tardis() function when the simulation is initialized.\n", "\n", "break 2. tardis/simulation/base:436 --> Stops after the Radial1DModel has been built from the config file, but before the plasma has been initialized.\n", "\n", "## IMPORTANT:\n", "\n", "We check the model.t_radiative property INSIDE the assemble_plasma function. Notice that it has len(model.t_radiative) = model.no_of_shells = 5" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NOTE: Enter 'c' at the ipdb> prompt to continue execution.\n", "None\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> b tardis/base:37\n", "Breakpoint 1 at /Users/marcwilliamson/src/dev/tardis/tardis/base.py:37\n", "ipdb> b tardis/simulation/base:436\n", "Breakpoint 2 at /Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py:436\n", "ipdb> c\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/base.py\u001b[0m(37)\u001b[0;36mrun_tardis\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 35 \u001b[0;31m \u001b[0mtardis_config\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mConfiguration\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 36 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m--> 37 \u001b[0;31m \u001b[0msimulation\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSimulation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtardis_config\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0matom_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0matom_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 38 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mcb\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msimulation_callbacks\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 39 \u001b[0;31m \u001b[0msimulation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_callback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:367)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py\u001b[0m(436)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 434 \u001b[0;31m \u001b[0mplasma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'plasma'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 435 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m-> 436 \u001b[0;31m plasma = assemble_plasma(config, model,\n", "\u001b[0m\u001b[0;32m 437 \u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", "\u001b[0m\u001b[0;32m 438 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0;34m'runner'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> s\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py\u001b[0m(437)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 435 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m 436 \u001b[0;31m plasma = assemble_plasma(config, model,\n", "\u001b[0m\u001b[0;32m--> 437 \u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", "\u001b[0m\u001b[0;32m 438 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0;34m'runner'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 439 \u001b[0;31m \u001b[0mrunner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'runner'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> s\n", "--Call--\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m(33)\u001b[0;36massemble_plasma\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 31 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 32 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m---> 33 \u001b[0;31m\u001b[0;32mdef\u001b[0m \u001b[0massemble_plasma\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0matom_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 34 \u001b[0;31m \"\"\"\n", "\u001b[0m\u001b[0;32m 35 \u001b[0;31m \u001b[0mCreate\u001b[0m \u001b[0ma\u001b[0m \u001b[0mBasePlasma\u001b[0m \u001b[0minstance\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0ma\u001b[0m \u001b[0mConfiguration\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> n\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m(52)\u001b[0;36massemble_plasma\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 50 \u001b[0;31m \"\"\"\n", "\u001b[0m\u001b[0;32m 51 \u001b[0;31m \u001b[0;31m# Convert the nlte species list to a proper format.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m---> 52 \u001b[0;31m nlte_species = [species_string_to_tuple(s) for s in\n", "\u001b[0m\u001b[0;32m 53 \u001b[0;31m config.plasma.nlte.species]\n", "\u001b[0m\u001b[0;32m 54 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> model.t_radiative\n", "\n", "ipdb> model.no_of_shells\n", "5\n", "ipdb> len(model.t_radiative)==model.no_of_shells\n", "True\n", "ipdb> exit\n" ] } ], "source": [ "%%debug\n", "no_init_trad = tardis.run_tardis('config_no_init_trad.yml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Debugging Yes initial_t_radiative run\n", "\n", "\n", "\n", "We place the same two breakpoints as above:\n", "\n", "break 1. tardis/base:37 --> Stops in the run_tardis() function when the simulation is initialized.\n", "\n", "break 2. tardis/simulation/base:436 --> Stops after the Radial1DModel has been built from the config file, but before the plasma has been initialized.\n", "\n", "## IMPORTANT:\n", "\n", "We check the model.t_radiative property INSIDE the assemble_plasma function. Notice that it has len(model.t_radiative) = 6 which is NOT EQUAL to model.no_of_shells = 5" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NOTE: Enter 'c' at the ipdb> prompt to continue execution.\n", "None\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> b tardis/base:37\n", "Breakpoint 1 at /Users/marcwilliamson/src/dev/tardis/tardis/base.py:37\n", "ipdb> b tardis/simulation/base:436\n", "Breakpoint 2 at /Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py:436\n", "ipdb> c\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/base.py\u001b[0m(37)\u001b[0;36mrun_tardis\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 35 \u001b[0;31m \u001b[0mtardis_config\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mConfiguration\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 36 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m--> 37 \u001b[0;31m \u001b[0msimulation\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSimulation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtardis_config\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0matom_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0matom_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 38 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mcb\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msimulation_callbacks\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 39 \u001b[0;31m \u001b[0msimulation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_callback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:367)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py\u001b[0m(436)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 434 \u001b[0;31m \u001b[0mplasma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'plasma'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 435 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m-> 436 \u001b[0;31m plasma = assemble_plasma(config, model,\n", "\u001b[0m\u001b[0;32m 437 \u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", "\u001b[0m\u001b[0;32m 438 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0;34m'runner'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> s\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/simulation/base.py\u001b[0m(437)\u001b[0;36mfrom_config\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 435 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m 436 \u001b[0;31m plasma = assemble_plasma(config, model,\n", "\u001b[0m\u001b[0;32m--> 437 \u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", "\u001b[0m\u001b[0;32m 438 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0;34m'runner'\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 439 \u001b[0;31m \u001b[0mrunner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'runner'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> s\n", "--Call--\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m(33)\u001b[0;36massemble_plasma\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 31 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 32 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m---> 33 \u001b[0;31m\u001b[0;32mdef\u001b[0m \u001b[0massemble_plasma\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0matom_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 34 \u001b[0;31m \"\"\"\n", "\u001b[0m\u001b[0;32m 35 \u001b[0;31m \u001b[0mCreate\u001b[0m \u001b[0ma\u001b[0m \u001b[0mBasePlasma\u001b[0m \u001b[0minstance\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0ma\u001b[0m \u001b[0mConfiguration\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> n\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m(52)\u001b[0;36massemble_plasma\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 50 \u001b[0;31m \"\"\"\n", "\u001b[0m\u001b[0;32m 51 \u001b[0;31m \u001b[0;31m# Convert the nlte species list to a proper format.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m---> 52 \u001b[0;31m nlte_species = [species_string_to_tuple(s) for s in\n", "\u001b[0m\u001b[0;32m 53 \u001b[0;31m config.plasma.nlte.species]\n", "\u001b[0m\u001b[0;32m 54 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> model.t_radiative\n", "\n", "ipdb> len(model.t_radiative) == model.no_of_shells\n", "False\n", "ipdb> exit\n" ] } ], "source": [ "%%debug\n", "init_trad = tardis.run_tardis('config_init_trad.yml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Checking model.t_radiative initialization when YES initial_t_rad\n", "\n", "In the above debugging blocks, we have identified the following discrepancy INSIDE assemble_plasma(): \n", "\n", "### len(model.t_radiative) = 6 when YES initial_t_rad\n", "### len(model.t_radiative) = 5 when NO initial_t_rad\n", "\n", "Therefore, we investigate in the following debugging block how model.t_radiative is initialized. We place a breakpoint at tardis/simulation/base:432 and step INSIDE the Radial1DModel initialization.\n", "\n", "Breakpoints:\n", "\n", "break 1. tardis/simulation/base:432 --> Stops so that we can step INSIDE Radial1DModel initialization from_config().\n", "\n", "break 2. tardis/model/base:330 --> Where temperature is handled INSIDE Radial1DModel initialization from_config().\n", "\n", "break 3. tardis/model/base:337 --> `t_radiative` is initialized. It has the same length as `velocity` which is the raw velocities from the density file.\n", "\n", "break 4. tardis/model/base:374 --> init() for Radial1DModel is called. We check values of relevant variables.\n", "\n", "break 5. tardis/model/base:76 --> Stops at first line of Radial1DModel init() function.\n", "\n", "break 6. tardis/model/base:101 --> self.\\_t\\_radiative is set.\n", "\n", "break 7. tardis/model/base:140 --> Stops at first line of self.t_radiative setter.\n", "\n", "break 8. tardis/model/base:132 --> Stops at first line of self.t_radiative getter.\n", "\n", "break 9. tardis/model/base:108 --> Stop right after self.\\_t\\_radiative is set. NOTICE that neither the setter nor the getter was called. __IMPORTANT:__ at line 108, we have len(self.\\_t\\_radiative) = 10. __TO DO:__ Check len(self.\\_t\\_radiative) at line 108 in the NO initial\\_t\\_rad case." ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NOTE: Enter 'c' at the ipdb> prompt to continue execution.\n", "None\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> b tardis/model/base:101\n", "Breakpoint 1 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:101\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:367)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(101)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 99 \u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 100 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m-> 101 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mt_radiative\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 102 \u001b[0;31m \u001b[0mlambda_wien_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconstants\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mb_wien\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 103 \u001b[0;31m self._t_radiative = constants.b_wien / (lambda_wien_inner * (\n", "\u001b[0m\n", "ipdb> n\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(106)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 104 \u001b[0;31m 1 + (self.v_middle - self.v_boundary_inner) / constants.c))\n", "\u001b[0m\u001b[0;32m 105 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m--> 106 \u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_t_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_radiative\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 107 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 108 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mdilution_factor\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> b tardis/model/base:108\n", "Breakpoint 2 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:108\n", "ipdb> b tardis/model/base:140\n", "Breakpoint 3 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:140\n", "ipdb> b tardis/model/base:132\n", "Breakpoint 4 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:132\n", "ipdb> c\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(108)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 106 \u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_t_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_radiative\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 107 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m-> 108 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mdilution_factor\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 109 \u001b[0;31m self.dilution_factor = 0.5 * (1 - np.sqrt(\n", "\u001b[0m\u001b[0;32m 110 \u001b[0;31m 1 - (self.r_inner[0] ** 2 / self.r_middle ** 2).to(1).value))\n", "\u001b[0m\n", "ipdb> self._t_radiative\n", "\n", "ipdb> exit\n" ] } ], "source": [ "%%debug\n", "init_trad = tardis.run_tardis('config_init_trad.yml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Checking self.\\_t\\_radiative initialization when NO initial_t_rad at line 108\n", "\n", "__IMPORTANT:__ We find that len(self.\\_t\\_radiative) = 5. This is a DISCREPANCY with the YES initial_t_rad case." ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NOTE: Enter 'c' at the ipdb> prompt to continue execution.\n", "None\n", "> \u001b[0;32m\u001b[0m(2)\u001b[0;36m\u001b[0;34m()\u001b[0m\n", "\n", "ipdb> b tardis/model/base:101\n", "Breakpoint 1 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:101\n", "ipdb> c\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:367)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(101)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 99 \u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 100 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m-> 101 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mt_radiative\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 102 \u001b[0;31m \u001b[0mlambda_wien_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconstants\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mb_wien\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 103 \u001b[0;31m self._t_radiative = constants.b_wien / (lambda_wien_inner * (\n", "\u001b[0m\n", "ipdb> n\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(102)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 100 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m1\u001b[0;32m 101 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mt_radiative\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m--> 102 \u001b[0;31m \u001b[0mlambda_wien_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconstants\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mb_wien\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 103 \u001b[0;31m self._t_radiative = constants.b_wien / (lambda_wien_inner * (\n", "\u001b[0m\u001b[0;32m 104 \u001b[0;31m 1 + (self.v_middle - self.v_boundary_inner) / constants.c))\n", "\u001b[0m\n", "ipdb> n\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(103)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[1;31m1\u001b[0;32m 101 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mt_radiative\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 102 \u001b[0;31m \u001b[0mlambda_wien_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconstants\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mb_wien\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m--> 103 \u001b[0;31m self._t_radiative = constants.b_wien / (lambda_wien_inner * (\n", "\u001b[0m\u001b[0;32m 104 \u001b[0;31m 1 + (self.v_middle - self.v_boundary_inner) / constants.c))\n", "\u001b[0m\u001b[0;32m 105 \u001b[0;31m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\n", "ipdb> l\n", "\u001b[1;32m 98 \u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;32m 99 \u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;32m 100 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;31m1\u001b[1;32m 101 \u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mt_radiative\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;32m 102 \u001b[0m \u001b[0mlambda_wien_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconstants\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mb_wien\u001b[0m \u001b[0;34m/\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mt_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m--> 103 \u001b[0;31m self._t_radiative = constants.b_wien / (lambda_wien_inner * (\n", "\u001b[0m\u001b[1;32m 104 \u001b[0m 1 + (self.v_middle - self.v_boundary_inner) / constants.c))\n", "\u001b[1;32m 105 \u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;32m 106 \u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_t_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_radiative\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;32m 107 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[1;32m 108 \u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mdilution_factor\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\n", "ipdb> b tardis/model/base:108\n", "Breakpoint 2 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:108\n", "ipdb> b tardis/model/base:140\n", "Breakpoint 3 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:140\n", "ipdb> b tardis/model/base:132\n", "Breakpoint 4 at /Users/marcwilliamson/src/dev/tardis/tardis/model/base.py:132\n", "ipdb> c\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "> \u001b[0;32m/Users/marcwilliamson/src/dev/tardis/tardis/model/base.py\u001b[0m(108)\u001b[0;36m__init__\u001b[0;34m()\u001b[0m\n", "\u001b[0;32m 106 \u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_t_radiative\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mt_radiative\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 107 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[1;31m2\u001b[0;32m-> 108 \u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mdilution_factor\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0m\u001b[0;32m 109 \u001b[0;31m self.dilution_factor = 0.5 * (1 - np.sqrt(\n", "\u001b[0m\u001b[0;32m 110 \u001b[0;31m 1 - (self.r_inner[0] ** 2 / self.r_middle ** 2).to(1).value))\n", "\u001b[0m\n", "ipdb> self._t_radiative\n", "\n", "ipdb> exit\n" ] } ], "source": [ "%%debug\n", "no_init_trad = tardis.run_tardis('config_no_init_trad.yml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CODE CHANGE:\n", "\n", "We propose the following change to tardis/model/base:106\n", "\n", "__Line 106 Before Change:__ `self._t_radiative = t_radiative`\n", "\n", "__Line 106 After Change:__ `self._t_radiative = t_radiative[1:1 + self.no_of_shells]`\n", "\n", "t_radiative\\[0\\] corresponds to the temperature within the inner boundary, and so should be ignored. " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.data is not yet QA compliant.\n", " return f(*args, **kwds)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.material is not yet QA compliant.\n", " return f(*args, **kwds)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.model.base \u001b[0m][\u001b[1;33mWARNING\u001b[0m] Abundances have not been normalized to 1. - normalizing (\u001b[1mbase.py\u001b[0m:367)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /Users/marcwilliamson/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:74)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3296: 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:99)\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:184)\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:187)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/ion_population.py:63: FutureWarning: \n", "Passing list-likes to .loc or [] with any missing label will raise\n", "KeyError in the future, you can use .reindex() as an alternative.\n", "\n", "See the documentation here:\n", "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", " partition_function.index].dropna())\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /anaconda2/envs/tardis/lib/python3.6/site-packages/astropy/units/quantity.py:1067: AstropyDeprecationWarning: The truth value of a Quantity is ambiguous. In the future this will raise a ValueError.\n", " AstropyDeprecationWarning)\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 1/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 6.99873e+41 erg / s Luminosity absorbed = 8.78774e+40 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 11000.0 9480.001506 0.439255 0.516372\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 9464.848 K -- next t_inner 12529.122 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /Users/marcwilliamson/src/dev/tardis/tardis/plasma/properties/ion_population.py:63: FutureWarning: \n", "Passing list-likes to .loc or [] with any missing label will raise\n", "KeyError in the future, you can use .reindex() as an alternative.\n", "\n", "See the documentation here:\n", "https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike\n", " partition_function.index].dropna())\n", " (\u001b[1mwarnings.py\u001b[0m:99)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 2/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.81607e+42 erg / s Luminosity absorbed = 6.48628e+40 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 9480.001506 12575.745392 0.516372 0.460796\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 12529.122 K -- next t_inner 10296.058 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 3/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 9.13387e+41 erg / s Luminosity absorbed = 1.26685e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 12575.745392 10311.711267 0.460796 0.518384\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10296.058 K -- next t_inner 11930.539 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 4/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.49508e+42 erg / s Luminosity absorbed = 1.38767e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 10311.711267 11931.816104 0.518384 0.501568\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11930.539 K -- next t_inner 10805.487 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 5/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.06943e+42 erg / s Luminosity absorbed = 1.45352e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 11931.816104 10806.647371 0.501568 0.521923\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 10805.487 K -- next t_inner 11571.347 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 6/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.33219e+42 erg / s Luminosity absorbed = 1.63948e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\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 10806.647371 11489.044309 0.521923 0.530125\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11571.347 K -- next t_inner 11102.402 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 7/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.14086e+42 erg / s Luminosity absorbed = 1.63206e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 1/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11489.044309 11163.609414 0.530125 0.515142\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11102.402 K -- next t_inner 11511.109 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 8/20 (\u001b[1mbase.py\u001b[0m:266)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.29957e+42 erg / s Luminosity absorbed = 1.72175e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 2/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11163.609414 11445.235326 0.515142 0.532271\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11511.109 K -- next t_inner 11182.357 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 9/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.18350e+42 erg / s Luminosity absorbed = 1.62089e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 3/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11445.235326 11107.763629 0.532271 0.539148\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11182.357 K -- next t_inner 11383.212 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 10/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.25575e+42 erg / s Luminosity absorbed = 1.74191e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 4/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11107.763629 11352.769902 0.539148 0.529162\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11383.212 K -- next t_inner 11249.393 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 11/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.20017e+42 erg / s Luminosity absorbed = 1.59589e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 5/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11352.769902 11267.543143 0.529162 0.52175\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11249.393 K -- next t_inner 11371.684 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 12/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.24238e+42 erg / s Luminosity absorbed = 1.69634e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 6/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11267.543143 11429.077116 0.52175 0.509304\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11371.684 K -- next t_inner 11298.313 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 13/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22572e+42 erg / s Luminosity absorbed = 1.70964e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 7/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11429.077116 11267.038005 0.509304 0.531961\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11298.313 K -- next t_inner 11301.467 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 14/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22675e+42 erg / s Luminosity absorbed = 1.64233e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 8/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11267.038005 11304.057113 0.531961 0.517281\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11301.467 K -- next t_inner 11299.844 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 15/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22841e+42 erg / s Luminosity absorbed = 1.63765e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 9/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11304.057113 11214.865131 0.517281 0.539284\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11299.844 K -- next t_inner 11290.591 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 16/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.21989e+42 erg / s Luminosity absorbed = 1.68821e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 10/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11214.865131 11251.931472 0.539284 0.531043\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11290.591 K -- next t_inner 11320.702 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 17/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22643e+42 erg / s Luminosity absorbed = 1.68202e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 11/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11251.931472 11227.712604 0.531043 0.545636\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11320.702 K -- next t_inner 11320.578 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 18/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22398e+42 erg / s Luminosity absorbed = 1.65226e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 12/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11227.712604 11322.952999 0.545636 0.520921\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11320.578 K -- next t_inner 11331.772 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 19/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.22450e+42 erg / s Luminosity absorbed = 1.74119e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 13/4 consecutive times. (\u001b[1mbase.py\u001b[0m:194)\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 11322.952999 11343.010318 0.520921 0.523692\n", "\n", " (\u001b[1mbase.py\u001b[0m:348)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 11331.772 K -- next t_inner 11340.566 K (\u001b[1mbase.py\u001b[0m:350)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Starting iteration 20/20 (\u001b[1mbase.py\u001b[0m:266)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 1.23739e+42 erg / s Luminosity absorbed = 1.70270e+41 erg / s Luminosity requested = 1.22640e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 1.57 s (\u001b[1mbase.py\u001b[0m:306)\n" ] } ], "source": [ "init_trad = tardis.run_tardis('config_init_trad.yml')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "a = np.array([1,2,3,4,5,6,7,8])" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([4, 5, 6, 7, 8])" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a[3:8]" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([1, 2, 3, 4, 5, 6, 7, 8])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "2 in a" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.argwhere(a==6)[0][0]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.searchsorted(a, 6.5)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "if (2 in a) and (3.5 in a):\n", " print('hi')" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "ename": "AssertionError", "evalue": "test", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32massert\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0;36m1.2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"test\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mAssertionError\u001b[0m: test" ] } ], "source": [ "assert 1==1.2, \"test\"" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([4, 5, 6])" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a[3:6]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.8" } }, "nbformat": 4, "nbformat_minor": 2 }