From 69d8f73847d987097d77a8ead7607e53ee2be9b0 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Wed, 17 Apr 2019 11:29:52 -0400 Subject: [PATCH 01/15] Added warning when user specified inner boundary velocity is ignored. --- tardis/model/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tardis/model/base.py b/tardis/model/base.py index 64574f85e88..5e1fd5b2fa8 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -233,6 +233,7 @@ def v_boundary_inner(self, value): raise ValueError('v_boundary_inner is outside of ' 'the model range.') if value <= self.raw_velocity[0]: + logger.warning('User specified inner boundary velocity ignored. TARDIS grid established only using velocity and density information.') value = None self._v_boundary_inner = value # Invalidate the cached cut-down velocity array From 203351bf04d7434ec9e144f7c9c53b1104c9354f Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Wed, 17 Apr 2019 16:03:01 -0400 Subject: [PATCH 02/15] Added custom density file boundary velocity explanation. --- docs/examples/densitycust.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/examples/densitycust.rst b/docs/examples/densitycust.rst index 30bbafd1f88..ebc4c31fb3b 100644 --- a/docs/examples/densitycust.rst +++ b/docs/examples/densitycust.rst @@ -42,6 +42,13 @@ The values in the example here define a density profile that is dropping off wit taken as the outer boundaries of grid cells and the density is assumed to be uniform with each cell. +Inner Boundary +============== + +The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation to the photosphere. The density associated with this velocity is the density of the optically thick inner region, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density fileAND specify v_inner_boundary and v_outer_boundary in the configuration YAML file for a TARDIS run. In this case, v_inner_boundary is ignored if it is less than the smallest velocity listed in the custom density file. Likewise, v_outer_boundary is ignored if it is larger than the largest velocity in the custom density file. If either of the YAML specified boundary velocities fall within the velocity range specified in the custom density file, then the boundary velocity is set equal to the number in the configuration YAML file. This has the effect of splitting a cell in the custom density file into two parts, a region within the boundary and a region outside the boundary. + +It is always a good idea to check the model velocities and abundances used in a TARDIS simulation after it has been successfully run. + .. warning:: The example given here is to show the format only. It is not a From 5f13ad3a925590d36daac6f7d05f3b4b5668e746 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Wed, 17 Apr 2019 16:09:09 -0400 Subject: [PATCH 03/15] Added warning when user specified v_outer_boundary is ignored. --- tardis/model/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tardis/model/base.py b/tardis/model/base.py index 5e1fd5b2fa8..5068abc9f8d 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -256,6 +256,7 @@ def v_boundary_outer(self, value): raise ValueError('v_boundary_outer is outside of ' 'the model range.') if value >= self.raw_velocity[-1]: + logger.warning('User specified outer boundary velocity ignored. TARDIS grid established only using velocity and density information.') value = None self._v_boundary_outer = value # Invalidate the cached cut-down velocity array From b9a658a29e36ae8108d37b9f67c0678068ce0c45 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 17:16:28 -0400 Subject: [PATCH 04/15] Removed default values for v_inner_boundary and v_outer_boundary --- tardis/io/schemas/model.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/tardis/io/schemas/model.yml b/tardis/io/schemas/model.yml index 59f83bed856..c0d4820993a 100644 --- a/tardis/io/schemas/model.yml +++ b/tardis/io/schemas/model.yml @@ -109,11 +109,9 @@ definitions: description: file type v_inner_boundary: type: quantity - default: 0 km/s description: location of the inner boundary chosen from the model v_outer_boundary: type: quantity - default: inf km/s description: location of the inner boundary chosen from the model required: - filename From c04ba6e768b8c5caf127c5ec11713ed2e200dceb Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 17:17:44 -0400 Subject: [PATCH 05/15] Changed Warnings to raise errors when yml inner or outer boundaries are outside of model velocity range. --- tardis/model/base.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tardis/model/base.py b/tardis/model/base.py index 5068abc9f8d..da93bcb74fa 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -232,9 +232,11 @@ def v_boundary_inner(self, value): if value > self.raw_velocity[-1]: raise ValueError('v_boundary_inner is outside of ' 'the model range.') - if value <= self.raw_velocity[0]: - logger.warning('User specified inner boundary velocity ignored. TARDIS grid established only using velocity and density information.') - value = None + if value < self.raw_velocity[0]: + raise ValueError('v_boundary_inner is outside of the model range.') + #if value <= self.raw_velocity[0]: + # logger.warning('User specified inner boundary velocity ignored. TARDIS grid established only using velocity and density information.') + # value = None self._v_boundary_inner = value # Invalidate the cached cut-down velocity array self._velocity = None @@ -255,9 +257,11 @@ def v_boundary_outer(self, value): if value < self.raw_velocity[0]: raise ValueError('v_boundary_outer is outside of ' 'the model range.') - if value >= self.raw_velocity[-1]: - logger.warning('User specified outer boundary velocity ignored. TARDIS grid established only using velocity and density information.') - value = None + if value > self.raw_velocity[-1]: + raise ValueError('v_boundary_outer is outside of the model range.') + #if value >= self.raw_velocity[-1]: + # logger.warning('User specified outer boundary velocity ignored. TARDIS grid established only using velocity and density information.') + # value = None self._v_boundary_outer = value # Invalidate the cached cut-down velocity array self._velocity = None From 9fd0671fcdae3e2403a767d9e8ec5854def739d9 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 17:56:28 -0400 Subject: [PATCH 06/15] Changed default values of inner and outer boundaries to -1 --- tardis/io/schemas/model.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tardis/io/schemas/model.yml b/tardis/io/schemas/model.yml index c0d4820993a..67ca554aaa8 100644 --- a/tardis/io/schemas/model.yml +++ b/tardis/io/schemas/model.yml @@ -109,9 +109,11 @@ definitions: description: file type v_inner_boundary: type: quantity + default: -1 km/s description: location of the inner boundary chosen from the model v_outer_boundary: type: quantity + default: -1 km/s description: location of the inner boundary chosen from the model required: - filename From fab030f5347f9727ee3941624552aa05717e3cc3 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 17:58:18 -0400 Subject: [PATCH 07/15] Added special case check for setters and getters for default schema values for v_inner_boundary and v_outer_boundar --- tardis/model/base.py | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tardis/model/base.py b/tardis/model/base.py index da93bcb74fa..e47efff8d3b 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -220,23 +220,23 @@ def no_of_raw_shells(self): def v_boundary_inner(self): if self._v_boundary_inner is None: return self.raw_velocity[0] + if self._v_boundary_inner < 0: + return self.raw_velocity[0] return self._v_boundary_inner @v_boundary_inner.setter def v_boundary_inner(self, value): if value is not None: - value = u.Quantity(value, self.v_boundary_inner.unit) - if value > self.v_boundary_outer: - raise ValueError('v_boundary_inner must not be higher than ' - 'v_boundary_outer.') - if value > self.raw_velocity[-1]: - raise ValueError('v_boundary_inner is outside of ' - 'the model range.') - if value < self.raw_velocity[0]: - raise ValueError('v_boundary_inner is outside of the model range.') - #if value <= self.raw_velocity[0]: - # logger.warning('User specified inner boundary velocity ignored. TARDIS grid established only using velocity and density information.') - # value = None + if value > 0: + value = u.Quantity(value, self.v_boundary_inner.unit) + if value > self.v_boundary_outer: + raise ValueError('v_boundary_inner must not be higher than ' + 'v_boundary_outer.') + if value > self.raw_velocity[-1]: + raise ValueError('v_boundary_inner is outside of ' + 'the model range.') + if value < self.raw_velocity[0]: + raise ValueError('v_boundary_inner is outside of the model range.') self._v_boundary_inner = value # Invalidate the cached cut-down velocity array self._velocity = None @@ -245,23 +245,23 @@ def v_boundary_inner(self, value): def v_boundary_outer(self): if self._v_boundary_outer is None: return self.raw_velocity[-1] + if self._v_boundary_outer < 0: + return self.raw_velocity[-1] return self._v_boundary_outer @v_boundary_outer.setter def v_boundary_outer(self, value): if value is not None: - value = u.Quantity(value, self.v_boundary_outer.unit) - if value < self.v_boundary_inner: - raise ValueError('v_boundary_outer must not be smaller than ' - 'v_boundary_inner.') - if value < self.raw_velocity[0]: - raise ValueError('v_boundary_outer is outside of ' - 'the model range.') - if value > self.raw_velocity[-1]: - raise ValueError('v_boundary_outer is outside of the model range.') - #if value >= self.raw_velocity[-1]: - # logger.warning('User specified outer boundary velocity ignored. TARDIS grid established only using velocity and density information.') - # value = None + if value > 0: + value = u.Quantity(value, self.v_boundary_outer.unit) + if value < self.v_boundary_inner: + raise ValueError('v_boundary_outer must not be smaller than ' + 'v_boundary_inner.') + if value < self.raw_velocity[0]: + raise ValueError('v_boundary_outer is outside of ' + 'the model range.') + if value > self.raw_velocity[-1]: + raise ValueError('v_boundary_outer is outside of the model range.') self._v_boundary_outer = value # Invalidate the cached cut-down velocity array self._velocity = None From ed0448be68c296ea92d573898b3a4925d7250bfa Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 18:06:24 -0400 Subject: [PATCH 08/15] Updated to reflect error raising when YAML boundary velocities are outside model velocity range. --- docs/examples/densitycust.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/densitycust.rst b/docs/examples/densitycust.rst index ebc4c31fb3b..cd6dc1fd41f 100644 --- a/docs/examples/densitycust.rst +++ b/docs/examples/densitycust.rst @@ -45,7 +45,7 @@ The values in the example here define a density profile that is dropping off wit Inner Boundary ============== -The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation to the photosphere. The density associated with this velocity is the density of the optically thick inner region, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density fileAND specify v_inner_boundary and v_outer_boundary in the configuration YAML file for a TARDIS run. In this case, v_inner_boundary is ignored if it is less than the smallest velocity listed in the custom density file. Likewise, v_outer_boundary is ignored if it is larger than the largest velocity in the custom density file. If either of the YAML specified boundary velocities fall within the velocity range specified in the custom density file, then the boundary velocity is set equal to the number in the configuration YAML file. This has the effect of splitting a cell in the custom density file into two parts, a region within the boundary and a region outside the boundary. +The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation to the photosphere. The density associated with this velocity is the density within the inner boundary, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density file AND specify v_inner_boundary or v_outer_boundary in the configuration YAML file for a TARDIS run. However, the YAML specified values must be within the velocity range specified in the custom density file, otherwise TARDIS will raise an error. When one of the YAML specified boundary velocities falls within the velocity range specified in the custom density file, then the boundary velocity is set equal to the number in the configuration YAML file. This has the effect of splitting a cell in the custom density file into two parts, a region within the boundary and a region outside the boundary. It is always a good idea to check the model velocities and abundances used in a TARDIS simulation after it has been successfully run. From 824fa9a55685276b55cbc00e1d956fc78007e35a Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 18:16:07 -0400 Subject: [PATCH 09/15] Removed mention of photosphere. --- docs/examples/densitycust.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/densitycust.rst b/docs/examples/densitycust.rst index cd6dc1fd41f..18e24eec083 100644 --- a/docs/examples/densitycust.rst +++ b/docs/examples/densitycust.rst @@ -45,7 +45,7 @@ The values in the example here define a density profile that is dropping off wit Inner Boundary ============== -The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation to the photosphere. The density associated with this velocity is the density within the inner boundary, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density file AND specify v_inner_boundary or v_outer_boundary in the configuration YAML file for a TARDIS run. However, the YAML specified values must be within the velocity range specified in the custom density file, otherwise TARDIS will raise an error. When one of the YAML specified boundary velocities falls within the velocity range specified in the custom density file, then the boundary velocity is set equal to the number in the configuration YAML file. This has the effect of splitting a cell in the custom density file into two parts, a region within the boundary and a region outside the boundary. +The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation. The density associated with this velocity is the density within the inner boundary, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density file AND specify v_inner_boundary or v_outer_boundary in the configuration YAML file for a TARDIS run. However, the YAML specified values must be within the velocity range specified in the custom density file, otherwise TARDIS will raise an error. When one of the YAML specified boundary velocities falls within the velocity range specified in the custom density file, then the boundary velocity is set equal to the number in the configuration YAML file. This has the effect of splitting a cell in the custom density file into two parts, a region within the boundary and a region outside the boundary. It is always a good idea to check the model velocities and abundances used in a TARDIS simulation after it has been successfully run. From 746b2061ed2cd31c81d3b9adfc4c45e529e2365e Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Mon, 29 Apr 2019 18:27:18 -0400 Subject: [PATCH 10/15] Added astropy quantity units to boundary velocities setters and getters. --- tardis/model/base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tardis/model/base.py b/tardis/model/base.py index e47efff8d3b..8dd010b5086 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -220,14 +220,14 @@ def no_of_raw_shells(self): def v_boundary_inner(self): if self._v_boundary_inner is None: return self.raw_velocity[0] - if self._v_boundary_inner < 0: + if self._v_boundary_inner < 0 * u.km/u.s: return self.raw_velocity[0] return self._v_boundary_inner @v_boundary_inner.setter def v_boundary_inner(self, value): if value is not None: - if value > 0: + if value > 0 * u.km/u.s: value = u.Quantity(value, self.v_boundary_inner.unit) if value > self.v_boundary_outer: raise ValueError('v_boundary_inner must not be higher than ' @@ -236,7 +236,7 @@ def v_boundary_inner(self, value): raise ValueError('v_boundary_inner is outside of ' 'the model range.') if value < self.raw_velocity[0]: - raise ValueError('v_boundary_inner is outside of the model range.') + raise ValueError('v_boundary_inner is lower than the lowest shell in the model.') self._v_boundary_inner = value # Invalidate the cached cut-down velocity array self._velocity = None @@ -245,14 +245,14 @@ def v_boundary_inner(self, value): def v_boundary_outer(self): if self._v_boundary_outer is None: return self.raw_velocity[-1] - if self._v_boundary_outer < 0: + if self._v_boundary_outer < 0 * u.km/u.s: return self.raw_velocity[-1] return self._v_boundary_outer @v_boundary_outer.setter def v_boundary_outer(self, value): if value is not None: - if value > 0: + if value > 0 * u.km/u.s: value = u.Quantity(value, self.v_boundary_outer.unit) if value < self.v_boundary_inner: raise ValueError('v_boundary_outer must not be smaller than ' @@ -261,7 +261,7 @@ def v_boundary_outer(self, value): raise ValueError('v_boundary_outer is outside of ' 'the model range.') if value > self.raw_velocity[-1]: - raise ValueError('v_boundary_outer is outside of the model range.') + raise ValueError('v_boundary_outer is larger than the largest shell in the model.') self._v_boundary_outer = value # Invalidate the cached cut-down velocity array self._velocity = None From 63ca77eb2b669fc66b79beed731cb329e94df698 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Tue, 30 Apr 2019 18:15:03 -0400 Subject: [PATCH 11/15] Added jupyter notebook for custom density model. --- docs/examples/test_abund.dat | 4 + docs/examples/test_density.txt | 5 + .../Custom_TARDIS_Model_Tutorial.ipynb | 873 ++++++++++++++++++ docs/yml_files/densitycust/test_config.yml | 75 ++ .../yml_files/densitycust/test_config_ex1.yml | 75 ++ .../yml_files/densitycust/test_config_ex2.yml | 75 ++ .../yml_files/densitycust/test_config_ex3.yml | 76 ++ 7 files changed, 1183 insertions(+) create mode 100644 docs/examples/test_abund.dat create mode 100644 docs/examples/test_density.txt create mode 100644 docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb create mode 100644 docs/yml_files/densitycust/test_config.yml create mode 100644 docs/yml_files/densitycust/test_config_ex1.yml create mode 100644 docs/yml_files/densitycust/test_config_ex2.yml create mode 100644 docs/yml_files/densitycust/test_config_ex3.yml diff --git a/docs/examples/test_abund.dat b/docs/examples/test_abund.dat new file mode 100644 index 00000000000..29ca89fe7bd --- /dev/null +++ b/docs/examples/test_abund.dat @@ -0,0 +1,4 @@ +H He + +0.0 1.0 +0.4 0.6 diff --git a/docs/examples/test_density.txt b/docs/examples/test_density.txt new file mode 100644 index 00000000000..31d541518f7 --- /dev/null +++ b/docs/examples/test_density.txt @@ -0,0 +1,5 @@ +80 day + +0 9500 9e-16 +1 10500 6e-16 +2 12000 2e-17 diff --git a/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb b/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb new file mode 100644 index 00000000000..25e8a6e9141 --- /dev/null +++ b/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb @@ -0,0 +1,873 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# How to run TARDIS with a custom ejecta model\n", + "\n", + "This notebook will go through multiple detailed examples of how to properly run TARDIS with a custom ejecta profile specified by a custom density file and a custom abundance file. " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import tardis\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Your custom density file\n", + "\n", + "First, let's look at an example of a custom density file." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "80 day\n", + "\n", + "0 9500 9e-16\n", + "1 10500 6e-16\n", + "2 12000 2e-17\n", + "\n" + ] + } + ], + "source": [ + "f = open('../examples/test_density.txt','r')\n", + "contents = f.read()\n", + "f.close()\n", + "print(contents)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* The first line specifies the time in days after the explosion\n", + "* After a skipped line, each row corresponds to a shell with index specified by the first column.\n", + "* The second column lists the velocities of the outer boundary of the cell in km/s.\n", + "* The third column lists the density of the cell.\n", + "\n", + "### The default behavior of TARDIS is to use the first shell as the inner boundary. This means that v_inner_boundary = 9500, and the corresponding density 9e-16 is ignored because it is within the inner boundary. It can be replaced by an arbitrary number. The outer boundary of the last shell will be used as v_outer_boundary, so the default behavior will set v_outer_boundary = 12000." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Your custom abundance file\n", + "\n", + "Let's look at an example of a custom density file." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "H He\n", + "\n", + "0.0 1.0\n", + "0.4 0.6\n", + "\n" + ] + } + ], + "source": [ + "f = open('../examples/test_abund.dat','r')\n", + "contents = f.read()\n", + "f.close()\n", + "print(contents)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* The first line indicates which elements (or isotopes) correspond to which columns.\n", + "* After a skipped line, each row specifies the chemical abundance of one shell. Therefore the numbers in a given row should sum to 1.0\n", + "\n", + "### Note that there are only 2 shells specified in this abundance file (despite the custom density file having 3 lines). This is because the custom density file specifies the boundaries of the shells, while the abundance file specifies the abundances within each shell." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Running TARDIS with the custom files\n", + "\n", + "Now let's run TARDIS using the example custom files." + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "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:367)\n", + "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/src/dev/tardis/tardis/data/atom_data.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "__init__() missing 1 required positional argument: 'atom_data' Error might be from the use of an old-format of the atomic database, \n", + "please see https://github.com/tardis-sn/tardis-refdata/tree/master/atom_data,for the most recent version.\n" + ] + }, + { + "ename": "TypeError", + "evalue": "__init__() missing 1 required positional argument: 'atom_data'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mconfig_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/../docs/yml_files/densitycust/test_config.yml'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0matom_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/data/atom_data.h5'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig_fname\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 435\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 436\u001b[0m plasma = assemble_plasma(config, model,\n\u001b[0;32m--> 437\u001b[0;31m atom_data=kwargs.get('atom_data', None))\n\u001b[0m\u001b[1;32m 438\u001b[0m \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[1;32m 439\u001b[0m \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[0;32m~/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m in \u001b[0;36massemble_plasma\u001b[0;34m(config, model, atom_data)\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 80\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0matomic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mAtomData\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0matom_data_fname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 82\u001b[0m print(e, 'Error might be from the use of an old-format of the atomic database, \\n'\n", + "\u001b[0;32m~/src/dev/tardis/tardis/io/atomic.py\u001b[0m in \u001b[0;36mfrom_hdf\u001b[0;34m(cls, fname)\u001b[0m\n\u001b[1;32m 150\u001b[0m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 152\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mdataframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 153\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 154\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m: __init__() missing 1 required positional argument: 'atom_data'" + ] + } + ], + "source": [ + "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config.yml'\n", + "model = tardis.run_tardis(config_fname)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "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 base:37\n", + "*** 'base' not found from sys.path\n", + "ipdb> b ~/src/dev/tardis/tardis/base:37\n", + "*** '~/src/dev/tardis/tardis/base' not found from sys.path\n", + "ipdb> b tardis/tardis/base:37\n", + "*** 'tardis/tardis/base' not found from sys.path\n", + "ipdb> b tardis/base:37\n", + "Breakpoint 1 at /home/mew488/src/dev/tardis/tardis/base.py:37\n", + "ipdb> c\n", + "> \u001b[0;32m/home/mew488/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> atom_data\n", + "ipdb> l\n", + "\u001b[1;32m 32 \u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 33 \u001b[0m \u001b[0mtardis_config\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mConfiguration\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_yaml\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[1;32m 34 \u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 35 \u001b[0m \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[1;32m 36 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\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[1;32m 38 \u001b[0m \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[1;32m 39 \u001b[0m \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[1;32m 40 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 41 \u001b[0m \u001b[0msimulation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\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[1;32m 42 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\n", + "ipdb> b tardis/plasma/standard_plasmas:80\n", + "Breakpoint 2 at /home/mew488/src/dev/tardis/tardis/plasma/standard_plasmas.py:80\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[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/src/dev/tardis/tardis/data/atom_data.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m(80)\u001b[0;36massemble_plasma\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 78 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 79 \u001b[0;31m \u001b[0;32mtry\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--> 80 \u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0matomic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mAtomData\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0matom_data_fname\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 81 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\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 82 \u001b[0;31m print(e, 'Error might be from the use of an old-format of the atomic database, \\n'\n", + "\u001b[0m\n", + "ipdb> atom_data_fname\n", + "'/home/mew488/src/dev/tardis/tardis/data/atom_data.h5'\n", + "ipdb> s\n", + "--Call--\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(129)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 127 \u001b[0;31m (\"collision_data\", \"collision_data_temperatures\")]\n", + "\u001b[0m\u001b[0;32m 128 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m--> 129 \u001b[0;31m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 130 \u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfname\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 131 \u001b[0;31m \"\"\"\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(142)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 140 \u001b[0;31m \"\"\"\n", + "\u001b[0m\u001b[0;32m 141 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m--> 142 \u001b[0;31m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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 143 \u001b[0;31m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> l\n", + "\u001b[1;32m 137 \u001b[0m \u001b[0mfname\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moptional\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 138 \u001b[0m \u001b[0mPath\u001b[0m \u001b[0mto\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mHDFStore\u001b[0m \u001b[0mfile\u001b[0m\u001b[0;34m.\u001b[0m \u001b[0mPlease\u001b[0m \u001b[0mcontact\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mauthors\u001b[0m \u001b[0mto\u001b[0m \u001b[0mget\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mup\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mdate\u001b[0m \u001b[0mfile\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 139 \u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mdefault\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[0m\n", + "\u001b[1;32m 140 \u001b[0m \"\"\"\n", + "\u001b[1;32m 141 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m--> 142 \u001b[0;31m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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;32m 143 \u001b[0m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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[1;32m 144 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 145 \u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 146 \u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 147 \u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\n", + "ipdb> fname\n", + "'/home/mew488/src/dev/tardis/tardis/data/atom_data.h5'\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(143)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 141 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 142 \u001b[0;31m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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--> 143 \u001b[0;31m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(145)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 143 \u001b[0;31m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m--> 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(146)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(147)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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--> 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> name\n", + "'atom_data'\n", + "ipdb> dataframes\n", + "{}\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(148)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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--> 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "KeyError: 'No object named atom_data in the file'\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(148)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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--> 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(149)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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--> 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\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 151 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(150)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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--> 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\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 151 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 152 \u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mdataframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(146)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> name\n", + "'atom_data'\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(147)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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--> 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(148)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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--> 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> n\n", + "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(146)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", + "\u001b[0;32m 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "ipdb> cls.hdf_names\n", + "['atom_data', 'ionization_data', 'levels', 'lines', 'macro_atom_data', 'macro_atom_references', 'zeta_data', 'collision_data', 'collision_data_temperatures', 'synpp_refs', 'ion_cx_th_data', 'ion_cx_sp_data']\n", + "ipdb> name\n", + "'ionization_data'\n", + "ipdb> l\n", + "\u001b[1;32m 141 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 142 \u001b[0m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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[1;32m 143 \u001b[0m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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[1;32m 144 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 145 \u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m 147 \u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 148 \u001b[0m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 149 \u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 150 \u001b[0m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 151 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ipdb> b 178\n", + "Breakpoint 3 at /home/mew488/src/dev/tardis/tardis/io/atomic.py:178\n", + "ipdb> c\n", + "__init__() missing 1 required positional argument: 'atom_data' Error might be from the use of an old-format of the atomic database, \n", + "please see https://github.com/tardis-sn/tardis-refdata/tree/master/atom_data,for the most recent version.\n", + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)\n", + "\u001b[0;32m~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n", + "\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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", + "\n", + "\u001b[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n", + "\u001b[1;32m 435\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 436\u001b[0m plasma = assemble_plasma(config, model,\n", + "\u001b[0;32m--> 437\u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", + "\u001b[0m\u001b[1;32m 438\u001b[0m \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[1;32m 439\u001b[0m \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", + "\n", + "\u001b[0;32m~/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m in \u001b[0;36massemble_plasma\u001b[0;34m(config, model, atom_data)\u001b[0m\n", + "\u001b[1;32m 78\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 79\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m---> 80\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0matomic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mAtomData\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0matom_data_fname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 82\u001b[0m print(e, 'Error might be from the use of an old-format of the atomic database, \\n'\n", + "\n", + "\u001b[0;32m~/src/dev/tardis/tardis/io/atomic.py\u001b[0m in \u001b[0;36mfrom_hdf\u001b[0;34m(cls, fname)\u001b[0m\n", + "\u001b[1;32m 150\u001b[0m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 151\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m--> 152\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mdataframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m 153\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[1;32m 154\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\n", + "\u001b[0;31mTypeError\u001b[0m: __init__() missing 1 required positional argument: 'atom_data'\n" + ] + } + ], + "source": [ + "%%debug\n", + "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config.yml'\n", + "model = tardis.run_tardis(config_fname)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can check to make sure that the model loaded and used by TARDIS during the simulation is consistent with your expectations based on the custom files you provided:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_inner_boundary = 950000000.0 cm / s\n", + "v_outer_boundary = 1200000000.0 cm / s\n", + "\n", + "\n", + "velocities of shell boundaries: \n", + "[9.50e+08 1.05e+09 1.20e+09] cm / s\n", + "\n", + "\n", + "densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)\n", + "[7.5e-14 2.5e-15] g / cm3\n" + ] + } + ], + "source": [ + "print('v_inner_boundary = ',model.model.v_boundary_inner)\n", + "print('v_outer_boundary = ',model.model.v_boundary_outer)\n", + "print('\\n')\n", + "print('velocities of shell boundaries: ')\n", + "print(model.model.velocity)\n", + "print('\\n')\n", + "print('densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)')\n", + "print(model.model.density)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Specifying boundary velocities in the config file\n", + "\n", + "In addition to specifying custom density and abundance files, the user can set the v_inner_boundary and v_outer_boundary velocities in the YAML config file. This can cause some confusion, so we carefully go through some examples.\n", + "\n", + "### Boundary velocities set in the YAML config file must be within the velocity range specified in the custom density file (if one is provided)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1) v_inner_boundary lower than first velocity in density file\n", + "\n", + "In this example, the first velocity in the density file is 9500 km/s. The user can specify in the config file the velocity of the inner boundary to a lower velocity, say v_inner_boundary = 9000 km/s. This will cause TARDIS to raise an error." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "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:367)\n" + ] + }, + { + "ename": "ValueError", + "evalue": "v_boundary_inner is lower than the lowest shell in the model.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mconfig_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/../docs/yml_files/densitycust/test_config_ex1.yml'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig_fname\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, velocity, homologous_density, abundance, isotope_abundance, time_explosion, t_inner, luminosity_requested, t_radiative, dilution_factor, v_boundary_inner, v_boundary_outer, electron_densities)\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_velocity\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[1;32m 79\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvelocity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 80\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhomologous_density\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhomologous_density\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mv_boundary_inner\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 237\u001b[0m 'the model range.')\n\u001b[1;32m 238\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\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[0;32m--> 239\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_boundary_inner is lower than the lowest shell in the model.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 240\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_v_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 241\u001b[0m \u001b[0;31m# Invalidate the cached cut-down velocity array\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: v_boundary_inner is lower than the lowest shell in the model." + ] + } + ], + "source": [ + "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config_ex1.yml'\n", + "model = tardis.run_tardis(config_fname)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2) v_outer_boundary larger than last velocity in density file\n", + "\n", + "In this example, the last velocity in the density file is 12000 km/s. The user can specify in the config file the velocity of the outer boundary to a larger velocity, say v_outer_boundary = 13000 km/s. This will cause TARDIS to raise an error." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "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:367)\n" + ] + }, + { + "ename": "ValueError", + "evalue": "v_boundary_outer is larger than the largest shell in the model.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mconfig_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/../docs/yml_files/densitycust/test_config_ex2.yml'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig_fname\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, velocity, homologous_density, abundance, isotope_abundance, time_explosion, t_inner, luminosity_requested, t_radiative, dilution_factor, v_boundary_inner, v_boundary_outer, electron_densities)\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvelocity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 81\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 82\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhomologous_density\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhomologous_density\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_abundance\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mabundance\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mv_boundary_outer\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 262\u001b[0m 'the model range.')\n\u001b[1;32m 263\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\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[0;32m--> 264\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_boundary_outer is larger than the largest shell in the model.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 265\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_v_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[0;31m# Invalidate the cached cut-down velocity array\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: v_boundary_outer is larger than the largest shell in the model." + ] + } + ], + "source": [ + "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config_ex2.yml'\n", + "model = tardis.run_tardis(config_fname)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3) v_boundaries in config file are within density file velocity range\n", + "\n", + "Here the user sets v_inner_boundary = 9700 and v_outer_boundary = 11500 in the config file. Both values fall within the velocity range specified by the custom density file." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "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:367)\n", + "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3291: 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.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1matomic.py\u001b[0m:173)\n", + "[\u001b[1mtardis.io.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1matomic.py\u001b[0m:176)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/src/dev/tardis/tardis/plasma/properties/ion_population.py:59: 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] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 = 2.31451e+42 erg / s Luminosity absorbed = 2.20992e+38 erg / s Luminosity requested = 2.26469e+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 6475.378267 6488.637521 0.360681 0.366243\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.018 K -- next t_inner 6413.863 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 = 2.21599e+42 erg / s Luminosity absorbed = 2.64272e+38 erg / s Luminosity requested = 2.26469e+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 6488.637521 6427.216436 0.366243 0.363775\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.863 K -- next t_inner 6483.959 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 = 2.31470e+42 erg / s Luminosity absorbed = 1.66285e+38 erg / s Luminosity requested = 2.26469e+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 6427.216436 6492.265498 0.363775 0.364173\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.959 K -- next t_inner 6413.533 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 = 2.21561e+42 erg / s Luminosity absorbed = 1.59276e+38 erg / s Luminosity requested = 2.26469e+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 6492.265498 6417.052425 0.364173 0.366605\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.533 K -- next t_inner 6484.185 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 = 2.31470e+42 erg / s Luminosity absorbed = 1.65313e+38 erg / s Luminosity requested = 2.26469e+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 6417.052425 6482.377118 0.366605 0.368425\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.185 K -- next t_inner 6413.755 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 = 2.21602e+42 erg / s Luminosity absorbed = 1.05695e+38 erg / s Luminosity requested = 2.26469e+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 6482.377118 6394.506844 0.368425 0.371037\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.755 K -- next t_inner 6483.813 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 = 2.31410e+42 erg / s Luminosity absorbed = 2.76180e+38 erg / s Luminosity requested = 2.26469e+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 6394.506844 6519.309507 0.371037 0.36027\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.813 K -- next t_inner 6414.228 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 = 2.21639e+42 erg / s Luminosity absorbed = 2.64764e+38 erg / s Luminosity requested = 2.26469e+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 6519.309507 6383.889203 0.36027 0.374686\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 6414.228 K -- next t_inner 6483.748 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 = 2.31428e+42 erg / s Luminosity absorbed = 5.54016e+37 erg / s Luminosity requested = 2.26469e+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 6383.889203 6473.974678 0.374686 0.369973\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.748 K -- next t_inner 6413.915 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 = 2.21596e+42 erg / s Luminosity absorbed = 2.63810e+38 erg / s Luminosity requested = 2.26469e+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 6473.974678 6406.611113 0.369973 0.369657\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.915 K -- next t_inner 6484.063 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 = 2.31457e+42 erg / s Luminosity absorbed = 2.20714e+38 erg / s Luminosity requested = 2.26469e+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 6406.611113 6501.97906 0.369657 0.363763\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.063 K -- next t_inner 6413.825 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 = 2.21609e+42 erg / s Luminosity absorbed = 1.59204e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\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 6501.97906 6442.380908 0.363763 0.360018\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.825 K -- next t_inner 6483.774 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 = 2.31415e+42 erg / s Luminosity absorbed = 1.64927e+38 erg / s Luminosity requested = 2.26469e+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 6442.380908 6479.130222 0.360018 0.369277\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.774 K -- next t_inner 6414.121 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 = 2.21646e+42 erg / s Luminosity absorbed = 1.59283e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 14/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 6479.130222 6416.085322 0.369277 0.365588\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.121 K -- next t_inner 6483.538 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 = 2.31368e+42 erg / s Luminosity absorbed = 2.20875e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 15/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 6416.085322 6449.419113 0.365588 0.376548\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.538 K -- next t_inner 6414.538 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 = 2.21696e+42 erg / s Luminosity absorbed = 1.05743e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 16/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 6449.419113 6417.878262 0.376548 0.367147\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.538 K -- next t_inner 6483.218 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 = 2.31321e+42 erg / s Luminosity absorbed = 2.75526e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 17/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 6417.878262 6473.045585 0.367147 0.371157\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.218 K -- next t_inner 6414.863 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 = 2.21737e+42 erg / s Luminosity absorbed = 1.58484e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 18/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 6473.045585 6436.504989 0.371157 0.362441\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.863 K -- next t_inner 6482.959 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" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 2.31299e+42 erg / s Luminosity absorbed = 2.20411e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 19/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 6436.504989 6520.140466 0.362441 0.358913\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.959 K -- next t_inner 6414.912 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 = 2.21744e+42 erg / s Luminosity absorbed = 1.90600e+38 erg / s Luminosity requested = 2.26469e+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.09 s (\u001b[1mbase.py\u001b[0m:306)\n" + ] + } + ], + "source": [ + "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config_ex3.yml'\n", + "model = tardis.run_tardis(config_fname)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_inner_boundary = 970000000.0 cm / s\n", + "v_outer_boundary = 1150000000.0 cm / s\n", + "\n", + "\n", + "velocities of shell boundaries: \n", + "[9.70e+08 1.05e+09 1.15e+09] cm / s\n", + "\n", + "\n", + "densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)\n", + "[7.5e-14 2.5e-15] g / cm3\n" + ] + } + ], + "source": [ + "print('v_inner_boundary = ',model.model.v_boundary_inner)\n", + "print('v_outer_boundary = ',model.model.v_boundary_outer)\n", + "print('\\n')\n", + "print('velocities of shell boundaries: ')\n", + "print(model.model.velocity)\n", + "print('\\n')\n", + "print('densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)')\n", + "print(model.model.density)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Notice that the inner and outer boundary velocities are the ones specifically set by the user." + ] + } + ], + "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.6.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/yml_files/densitycust/test_config.yml b/docs/yml_files/densitycust/test_config.yml new file mode 100644 index 00000000000..2e5f273ecb7 --- /dev/null +++ b/docs/yml_files/densitycust/test_config.yml @@ -0,0 +1,75 @@ +# Example YAML configuration for TARDIS +tardis_config_version: v1.0 + +supernova: + luminosity_requested: 8.770 log_lsun + time_explosion: 16 day + distance: 8.32 Mpc + +# standard atomic data base; get it from the tardis-refdata repository +atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 + +model: + structure: + #v_inner_boundary: 9500 km/s + type: file + filename: test_density.txt + filetype: simple_ascii + # showing different configuration options separated by comments + # simple uniform + #--------------- + #type: uniform + #value: 1e-40 g/cm^3 + #--------------- + # branch85_w7 - fit of seven order polynomial to W7 (like Branch 85) + #--------------- + #type: branch85_w7 + # default, no need to change + #w7_time_0: 19.9999584 s + # default, no need to change + #w7_rho_0: 3e29 g/cm^3 + #--------------- + + abundances: + type: file + filename: test_abund.dat + filetype: custom_composition + +plasma: + #initial_t_inner: 10000 K + #initial_t_rad: 10000 K + disable_electron_scattering: no + ionization: lte + excitation: lte + # radiative_rates_type - currently supported are dilute-blackbody, detailed and blackbody + radiative_rates_type: dilute-blackbody + # line_interaction_type - currently supported are scatter, downbranch and macroatom + line_interaction_type: macroatom + +montecarlo: + seed: 23111963 + no_of_packets: 4.0e+4 + iterations: 20 + # Number of threads used in OMP mode; uncomment if you want to control the + # OMP behaviour via the config; otherwise the maximum available number of + # threads is used or the number specified in the OMP_NUM_THREADS environment + # variable + # -------- + #nthreads: 1 + + last_no_of_packets: 1.e+5 + no_of_virtual_packets: 10 + + convergence_strategy: + type: damped + damping_constant: 1.0 + threshold: 0.05 + fraction: 0.8 + hold_iterations: 3 + t_inner: + damping_constant: 1.0 + +spectrum: + start: 500 angstrom + stop: 20000 angstrom + num: 10000 diff --git a/docs/yml_files/densitycust/test_config_ex1.yml b/docs/yml_files/densitycust/test_config_ex1.yml new file mode 100644 index 00000000000..278e0b3bf2d --- /dev/null +++ b/docs/yml_files/densitycust/test_config_ex1.yml @@ -0,0 +1,75 @@ +# Example YAML configuration for TARDIS +tardis_config_version: v1.0 + +supernova: + luminosity_requested: 8.770 log_lsun + time_explosion: 16 day + distance: 8.32 Mpc + +# standard atomic data base; get it from the tardis-refdata repository +atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 + +model: + structure: + v_inner_boundary: 9000 km/s + type: file + filename: test_density.txt + filetype: simple_ascii + # showing different configuration options separated by comments + # simple uniform + #--------------- + #type: uniform + #value: 1e-40 g/cm^3 + #--------------- + # branch85_w7 - fit of seven order polynomial to W7 (like Branch 85) + #--------------- + #type: branch85_w7 + # default, no need to change + #w7_time_0: 19.9999584 s + # default, no need to change + #w7_rho_0: 3e29 g/cm^3 + #--------------- + + abundances: + type: file + filename: test_abund.dat + filetype: custom_composition + +plasma: + #initial_t_inner: 10000 K + #initial_t_rad: 10000 K + disable_electron_scattering: no + ionization: lte + excitation: lte + # radiative_rates_type - currently supported are dilute-blackbody, detailed and blackbody + radiative_rates_type: dilute-blackbody + # line_interaction_type - currently supported are scatter, downbranch and macroatom + line_interaction_type: macroatom + +montecarlo: + seed: 23111963 + no_of_packets: 4.0e+4 + iterations: 20 + # Number of threads used in OMP mode; uncomment if you want to control the + # OMP behaviour via the config; otherwise the maximum available number of + # threads is used or the number specified in the OMP_NUM_THREADS environment + # variable + # -------- + #nthreads: 1 + + last_no_of_packets: 1.e+5 + no_of_virtual_packets: 10 + + convergence_strategy: + type: damped + damping_constant: 1.0 + threshold: 0.05 + fraction: 0.8 + hold_iterations: 3 + t_inner: + damping_constant: 1.0 + +spectrum: + start: 500 angstrom + stop: 20000 angstrom + num: 10000 diff --git a/docs/yml_files/densitycust/test_config_ex2.yml b/docs/yml_files/densitycust/test_config_ex2.yml new file mode 100644 index 00000000000..5ce5c9315a1 --- /dev/null +++ b/docs/yml_files/densitycust/test_config_ex2.yml @@ -0,0 +1,75 @@ +# Example YAML configuration for TARDIS +tardis_config_version: v1.0 + +supernova: + luminosity_requested: 8.770 log_lsun + time_explosion: 16 day + distance: 8.32 Mpc + +# standard atomic data base; get it from the tardis-refdata repository +atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 + +model: + structure: + v_outer_boundary: 13000 km/s + type: file + filename: test_density.txt + filetype: simple_ascii + # showing different configuration options separated by comments + # simple uniform + #--------------- + #type: uniform + #value: 1e-40 g/cm^3 + #--------------- + # branch85_w7 - fit of seven order polynomial to W7 (like Branch 85) + #--------------- + #type: branch85_w7 + # default, no need to change + #w7_time_0: 19.9999584 s + # default, no need to change + #w7_rho_0: 3e29 g/cm^3 + #--------------- + + abundances: + type: file + filename: test_abund.dat + filetype: custom_composition + +plasma: + #initial_t_inner: 10000 K + #initial_t_rad: 10000 K + disable_electron_scattering: no + ionization: lte + excitation: lte + # radiative_rates_type - currently supported are dilute-blackbody, detailed and blackbody + radiative_rates_type: dilute-blackbody + # line_interaction_type - currently supported are scatter, downbranch and macroatom + line_interaction_type: macroatom + +montecarlo: + seed: 23111963 + no_of_packets: 4.0e+4 + iterations: 20 + # Number of threads used in OMP mode; uncomment if you want to control the + # OMP behaviour via the config; otherwise the maximum available number of + # threads is used or the number specified in the OMP_NUM_THREADS environment + # variable + # -------- + #nthreads: 1 + + last_no_of_packets: 1.e+5 + no_of_virtual_packets: 10 + + convergence_strategy: + type: damped + damping_constant: 1.0 + threshold: 0.05 + fraction: 0.8 + hold_iterations: 3 + t_inner: + damping_constant: 1.0 + +spectrum: + start: 500 angstrom + stop: 20000 angstrom + num: 10000 diff --git a/docs/yml_files/densitycust/test_config_ex3.yml b/docs/yml_files/densitycust/test_config_ex3.yml new file mode 100644 index 00000000000..ae6325bc9db --- /dev/null +++ b/docs/yml_files/densitycust/test_config_ex3.yml @@ -0,0 +1,76 @@ +# Example YAML configuration for TARDIS +tardis_config_version: v1.0 + +supernova: + luminosity_requested: 8.770 log_lsun + time_explosion: 16 day + distance: 8.32 Mpc + +# standard atomic data base; get it from the tardis-refdata repository +atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 + +model: + structure: + v_inner_boundary: 9700 km/s + v_outer_boundary: 11500 km/s + type: file + filename: test_density.txt + filetype: simple_ascii + # showing different configuration options separated by comments + # simple uniform + #--------------- + #type: uniform + #value: 1e-40 g/cm^3 + #--------------- + # branch85_w7 - fit of seven order polynomial to W7 (like Branch 85) + #--------------- + #type: branch85_w7 + # default, no need to change + #w7_time_0: 19.9999584 s + # default, no need to change + #w7_rho_0: 3e29 g/cm^3 + #--------------- + + abundances: + type: file + filename: test_abund.dat + filetype: custom_composition + +plasma: + #initial_t_inner: 10000 K + #initial_t_rad: 10000 K + disable_electron_scattering: no + ionization: lte + excitation: lte + # radiative_rates_type - currently supported are dilute-blackbody, detailed and blackbody + radiative_rates_type: dilute-blackbody + # line_interaction_type - currently supported are scatter, downbranch and macroatom + line_interaction_type: macroatom + +montecarlo: + seed: 23111963 + no_of_packets: 4.0e+4 + iterations: 20 + # Number of threads used in OMP mode; uncomment if you want to control the + # OMP behaviour via the config; otherwise the maximum available number of + # threads is used or the number specified in the OMP_NUM_THREADS environment + # variable + # -------- + #nthreads: 1 + + last_no_of_packets: 1.e+5 + no_of_virtual_packets: 10 + + convergence_strategy: + type: damped + damping_constant: 1.0 + threshold: 0.05 + fraction: 0.8 + hold_iterations: 3 + t_inner: + damping_constant: 1.0 + +spectrum: + start: 500 angstrom + stop: 20000 angstrom + num: 10000 From 732cbbf410fd471ffd490ccd0c424a498dec5af1 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Tue, 30 Apr 2019 19:02:54 -0400 Subject: [PATCH 12/15] Changed style of comments and reading custom files. --- .../Custom_TARDIS_Model_Tutorial.ipynb | 585 ++++++++---------- 1 file changed, 254 insertions(+), 331 deletions(-) diff --git a/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb b/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb index 25e8a6e9141..1acd79c197c 100644 --- a/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb +++ b/docs/notebooks/Custom_TARDIS_Model_Tutorial.ipynb @@ -30,28 +30,14 @@ ] }, { - "cell_type": "code", - "execution_count": 2, + "cell_type": "raw", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "80 day\n", - "\n", - "0 9500 9e-16\n", - "1 10500 6e-16\n", - "2 12000 2e-17\n", - "\n" - ] - } - ], "source": [ - "f = open('../examples/test_density.txt','r')\n", - "contents = f.read()\n", - "f.close()\n", - "print(contents)" + "80 day\n", + "\n", + "0 9500 9e-16\n", + "1 10500 6e-16\n", + "2 12000 2e-17" ] }, { @@ -63,7 +49,8 @@ "* The second column lists the velocities of the outer boundary of the cell in km/s.\n", "* The third column lists the density of the cell.\n", "\n", - "### The default behavior of TARDIS is to use the first shell as the inner boundary. This means that v_inner_boundary = 9500, and the corresponding density 9e-16 is ignored because it is within the inner boundary. It can be replaced by an arbitrary number. The outer boundary of the last shell will be used as v_outer_boundary, so the default behavior will set v_outer_boundary = 12000." + "## Important: \n", + "The __default behavior__ of TARDIS is to use the first shell as the inner boundary. This means that v_inner_boundary = 9500, and the corresponding density 9e-16 is ignored because it is within the inner boundary. It can be replaced by an arbitrary number. The outer boundary of the last shell will be used as v_outer_boundary, so the default behavior will set v_outer_boundary = 12000." ] }, { @@ -76,27 +63,13 @@ ] }, { - "cell_type": "code", - "execution_count": 3, + "cell_type": "raw", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "H He\n", - "\n", - "0.0 1.0\n", - "0.4 0.6\n", - "\n" - ] - } - ], "source": [ - "f = open('../examples/test_abund.dat','r')\n", - "contents = f.read()\n", - "f.close()\n", - "print(contents)" + "H He\n", + "\n", + "0.0 1.0\n", + "0.4 0.6" ] }, { @@ -106,7 +79,8 @@ "* The first line indicates which elements (or isotopes) correspond to which columns.\n", "* After a skipped line, each row specifies the chemical abundance of one shell. Therefore the numbers in a given row should sum to 1.0\n", "\n", - "### Note that there are only 2 shells specified in this abundance file (despite the custom density file having 3 lines). This is because the custom density file specifies the boundaries of the shells, while the abundance file specifies the abundances within each shell." + "## Important: \n", + "Note that there are only 2 shells specified in this abundance file (despite the custom density file having 3 lines). This is because the custom density file specifies the boundaries of the shells, while the abundance file specifies the abundances within each shell." ] }, { @@ -120,303 +94,253 @@ }, { "cell_type": "code", - "execution_count": 26, - "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:367)\n", - "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/src/dev/tardis/tardis/data/atom_data.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", - "__init__() missing 1 required positional argument: 'atom_data' Error might be from the use of an old-format of the atomic database, \n", - "please see https://github.com/tardis-sn/tardis-refdata/tree/master/atom_data,for the most recent version.\n" - ] - }, - { - "ename": "TypeError", - "evalue": "__init__() missing 1 required positional argument: 'atom_data'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mconfig_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/../docs/yml_files/densitycust/test_config.yml'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0matom_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/data/atom_data.h5'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig_fname\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 435\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 436\u001b[0m plasma = assemble_plasma(config, model,\n\u001b[0;32m--> 437\u001b[0;31m atom_data=kwargs.get('atom_data', None))\n\u001b[0m\u001b[1;32m 438\u001b[0m \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[1;32m 439\u001b[0m \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[0;32m~/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m in \u001b[0;36massemble_plasma\u001b[0;34m(config, model, atom_data)\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 80\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0matomic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mAtomData\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0matom_data_fname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 82\u001b[0m print(e, 'Error might be from the use of an old-format of the atomic database, \\n'\n", - "\u001b[0;32m~/src/dev/tardis/tardis/io/atomic.py\u001b[0m in \u001b[0;36mfrom_hdf\u001b[0;34m(cls, fname)\u001b[0m\n\u001b[1;32m 150\u001b[0m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 152\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mdataframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 153\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 154\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mTypeError\u001b[0m: __init__() missing 1 required positional argument: 'atom_data'" - ] - } - ], - "source": [ - "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config.yml'\n", - "model = tardis.run_tardis(config_fname)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, + "execution_count": 2, "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 base:37\n", - "*** 'base' not found from sys.path\n", - "ipdb> b ~/src/dev/tardis/tardis/base:37\n", - "*** '~/src/dev/tardis/tardis/base' not found from sys.path\n", - "ipdb> b tardis/tardis/base:37\n", - "*** 'tardis/tardis/base' not found from sys.path\n", - "ipdb> b tardis/base:37\n", - "Breakpoint 1 at /home/mew488/src/dev/tardis/tardis/base.py:37\n", - "ipdb> c\n", - "> \u001b[0;32m/home/mew488/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> atom_data\n", - "ipdb> l\n", - "\u001b[1;32m 32 \u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 33 \u001b[0m \u001b[0mtardis_config\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mConfiguration\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_yaml\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[1;32m 34 \u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 35 \u001b[0m \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[1;32m 36 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\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[1;32m 38 \u001b[0m \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[1;32m 39 \u001b[0m \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[1;32m 40 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 41 \u001b[0m \u001b[0msimulation\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\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[1;32m 42 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\n", - "ipdb> b tardis/plasma/standard_plasmas:80\n", - "Breakpoint 2 at /home/mew488/src/dev/tardis/tardis/plasma/standard_plasmas.py:80\n", - "ipdb> c\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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] /home/mew488/anaconda2/envs/tardis3/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[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/src/dev/tardis/tardis/data/atom_data.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m(80)\u001b[0;36massemble_plasma\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 78 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 79 \u001b[0;31m \u001b[0;32mtry\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--> 80 \u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0matomic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mAtomData\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0matom_data_fname\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 81 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\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 82 \u001b[0;31m print(e, 'Error might be from the use of an old-format of the atomic database, \\n'\n", - "\u001b[0m\n", - "ipdb> atom_data_fname\n", - "'/home/mew488/src/dev/tardis/tardis/data/atom_data.h5'\n", - "ipdb> s\n", - "--Call--\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(129)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 127 \u001b[0;31m (\"collision_data\", \"collision_data_temperatures\")]\n", - "\u001b[0m\u001b[0;32m 128 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m--> 129 \u001b[0;31m \u001b[0;34m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 130 \u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfname\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 131 \u001b[0;31m \"\"\"\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(142)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 140 \u001b[0;31m \"\"\"\n", - "\u001b[0m\u001b[0;32m 141 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m--> 142 \u001b[0;31m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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 143 \u001b[0;31m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> l\n", - "\u001b[1;32m 137 \u001b[0m \u001b[0mfname\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moptional\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 138 \u001b[0m \u001b[0mPath\u001b[0m \u001b[0mto\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mHDFStore\u001b[0m \u001b[0mfile\u001b[0m\u001b[0;34m.\u001b[0m \u001b[0mPlease\u001b[0m \u001b[0mcontact\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mauthors\u001b[0m \u001b[0mto\u001b[0m \u001b[0mget\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mup\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mto\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mdate\u001b[0m \u001b[0mfile\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 139 \u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mdefault\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[0m\n", - "\u001b[1;32m 140 \u001b[0m \"\"\"\n", - "\u001b[1;32m 141 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m--> 142 \u001b[0;31m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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;32m 143 \u001b[0m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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[1;32m 144 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 145 \u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 146 \u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 147 \u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\n", - "ipdb> fname\n", - "'/home/mew488/src/dev/tardis/tardis/data/atom_data.h5'\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(143)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 141 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 142 \u001b[0;31m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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--> 143 \u001b[0;31m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(145)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 143 \u001b[0;31m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m--> 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(146)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n" + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3291: 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.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1matomic.py\u001b[0m:173)\n", + "[\u001b[1mtardis.io.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1matomic.py\u001b[0m:176)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/src/dev/tardis/tardis/plasma/properties/ion_population.py:59: 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] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 = 2.31327e+42 erg / s Luminosity absorbed = 3.85232e+38 erg / s Luminosity requested = 2.26469e+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 6541.006187 6556.13016 0.343875 0.350118\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.915 K -- next t_inner 6482.755 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 = 2.21734e+42 erg / s Luminosity absorbed = 2.64889e+38 erg / s Luminosity requested = 2.26469e+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 6556.13016 6495.397989 0.350118 0.347789\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.755 K -- next t_inner 6551.611 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 = 2.31324e+42 erg / s Luminosity absorbed = 2.21576e+38 erg / s Luminosity requested = 2.26469e+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 6495.397989 6558.906259 0.347789 0.348258\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.611 K -- next t_inner 6482.500 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 = 2.21685e+42 erg / s Luminosity absorbed = 3.70488e+38 erg / s Luminosity requested = 2.26469e+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 6558.906259 6485.545593 0.348258 0.350397\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.500 K -- next t_inner 6552.082 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 = 2.31359e+42 erg / s Luminosity absorbed = 2.20402e+38 erg / s Luminosity requested = 2.26469e+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 6485.545593 6550.104752 0.350397 0.352096\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6552.082 K -- next t_inner 6482.479 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 = 2.21697e+42 erg / s Luminosity absorbed = 2.64706e+38 erg / s Luminosity requested = 2.26469e+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 6550.104752 6464.323819 0.352096 0.354247\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.479 K -- next t_inner 6551.873 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 = 2.31327e+42 erg / s Luminosity absorbed = 2.76611e+38 erg / s Luminosity requested = 2.26469e+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 6464.323819 6586.535643 0.354247 0.344429\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(147)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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--> 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> name\n", - "'atom_data'\n", - "ipdb> dataframes\n", - "{}\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(148)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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--> 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "KeyError: 'No object named atom_data in the file'\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(148)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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--> 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(149)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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--> 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\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 151 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(150)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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--> 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\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 151 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 152 \u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mdataframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(146)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> name\n", - "'atom_data'\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(147)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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--> 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(148)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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--> 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\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 149 \u001b[0;31m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\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 150 \u001b[0;31m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> n\n", - "> \u001b[0;32m/home/mew488/src/dev/tardis/tardis/io/atomic.py\u001b[0m(146)\u001b[0;36mfrom_hdf\u001b[0;34m()\u001b[0m\n", - "\u001b[0;32m 144 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[0;32m 145 \u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\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--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\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 147 \u001b[0;31m \u001b[0;32mtry\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 148 \u001b[0;31m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "ipdb> cls.hdf_names\n", - "['atom_data', 'ionization_data', 'levels', 'lines', 'macro_atom_data', 'macro_atom_references', 'zeta_data', 'collision_data', 'collision_data_temperatures', 'synpp_refs', 'ion_cx_th_data', 'ion_cx_sp_data']\n", - "ipdb> name\n", - "'ionization_data'\n", - "ipdb> l\n", - "\u001b[1;32m 141 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 142 \u001b[0m \u001b[0mdataframes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdict\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[1;32m 143 \u001b[0m \u001b[0mnonavailable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\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[1;32m 144 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 145 \u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mHDFStore\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m--> 146 \u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mname\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhdf_names\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m 147 \u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 148 \u001b[0m \u001b[0mdataframes\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstore\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 149 \u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 150 \u001b[0m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 151 \u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\n" + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.873 K -- next t_inner 6482.711 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 = 2.21723e+42 erg / s Luminosity absorbed = 2.12445e+38 erg / s Luminosity requested = 2.26469e+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 6586.535643 6452.0629 0.344429 0.358012\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.711 K -- next t_inner 6551.731 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 = 2.31306e+42 erg / s Luminosity absorbed = 3.30756e+38 erg / s Luminosity requested = 2.26469e+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 6452.0629 6542.502642 0.358012 0.353289\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.731 K -- next t_inner 6482.870 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 = 2.21734e+42 erg / s Luminosity absorbed = 3.17660e+38 erg / s Luminosity requested = 2.26469e+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 6542.502642 6474.094395 0.353289 0.353484\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.870 K -- next t_inner 6551.733 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 = 2.31318e+42 erg / s Luminosity absorbed = 2.21194e+38 erg / s Luminosity requested = 2.26469e+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 6474.094395 6569.860807 0.353484 0.34756\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.733 K -- next t_inner 6482.698 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 = 2.21741e+42 erg / s Luminosity absorbed = 1.59417e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\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 6569.860807 6510.554611 0.34756 0.344308\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.698 K -- next t_inner 6551.446 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 = 2.31272e+42 erg / s Luminosity absorbed = 2.20953e+38 erg / s Luminosity requested = 2.26469e+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 6510.554611 6546.768598 0.344308 0.352781\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.446 K -- next t_inner 6483.070 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 = 2.21777e+42 erg / s Luminosity absorbed = 2.64910e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 14/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 6546.768598 6485.552351 0.352781 0.349363\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.070 K -- next t_inner 6551.293 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 = 2.31237e+42 erg / s Luminosity absorbed = 2.76461e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 15/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 6485.552351 6516.39366 0.349363 0.35982\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.293 K -- next t_inner 6483.402 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 = 2.21811e+42 erg / s Luminosity absorbed = 2.64705e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 16/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 6516.39366 6487.025434 0.35982 0.350732\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.402 K -- next t_inner 6551.133 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 = 2.31225e+42 erg / s Luminosity absorbed = 2.21332e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 17/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 6487.025434 6541.53332 0.350732 0.354308\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.133 K -- next t_inner 6483.406 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" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "ipdb> b 178\n", - "Breakpoint 3 at /home/mew488/src/dev/tardis/tardis/io/atomic.py:178\n", - "ipdb> c\n", - "__init__() missing 1 required positional argument: 'atom_data' Error might be from the use of an old-format of the atomic database, \n", - "please see https://github.com/tardis-sn/tardis-refdata/tree/master/atom_data,for the most recent version.\n", - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)\n", - "\u001b[0;32m~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n", - "\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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", - "\n", - "\u001b[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n", - "\u001b[1;32m 435\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 436\u001b[0m plasma = assemble_plasma(config, model,\n", - "\u001b[0;32m--> 437\u001b[0;31m atom_data=kwargs.get('atom_data', None))\n", - "\u001b[0m\u001b[1;32m 438\u001b[0m \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[1;32m 439\u001b[0m \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", - "\n", - "\u001b[0;32m~/src/dev/tardis/tardis/plasma/standard_plasmas.py\u001b[0m in \u001b[0;36massemble_plasma\u001b[0;34m(config, model, atom_data)\u001b[0m\n", - "\u001b[1;32m 78\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 79\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m---> 80\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0matomic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mAtomData\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_hdf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0matom_data_fname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTypeError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 82\u001b[0m print(e, 'Error might be from the use of an old-format of the atomic database, \\n'\n", - "\n", - "\u001b[0;32m~/src/dev/tardis/tardis/io/atomic.py\u001b[0m in \u001b[0;36mfrom_hdf\u001b[0;34m(cls, fname)\u001b[0m\n", - "\u001b[1;32m 150\u001b[0m \u001b[0mnonavailable\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 151\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m--> 152\u001b[0;31m \u001b[0matom_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mdataframes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m 153\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[1;32m 154\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\n", - "\u001b[0;31mTypeError\u001b[0m: __init__() missing 1 required positional argument: 'atom_data'\n" + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 2.21806e+42 erg / s Luminosity absorbed = 3.18123e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 18/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 6541.53332 6506.188917 0.354308 0.346155\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.406 K -- next t_inner 6551.206 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 = 2.31238e+42 erg / s Luminosity absorbed = 2.76543e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 19/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 6506.188917 6589.429688 0.346155 0.342891\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.206 K -- next t_inner 6483.296 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 = 2.21775e+42 erg / s Luminosity absorbed = 5.09249e+38 erg / s Luminosity requested = 2.26469e+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.68 s (\u001b[1mbase.py\u001b[0m:306)\n" ] } ], "source": [ - "%%debug\n", - "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config.yml'\n", - "model = tardis.run_tardis(config_fname)" + "model = tardis.run_tardis('./test_config.yml')" ] }, { @@ -428,7 +352,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -467,7 +391,8 @@ "\n", "In addition to specifying custom density and abundance files, the user can set the v_inner_boundary and v_outer_boundary velocities in the YAML config file. This can cause some confusion, so we carefully go through some examples.\n", "\n", - "### Boundary velocities set in the YAML config file must be within the velocity range specified in the custom density file (if one is provided)." + "## Important: \n", + "Boundary velocities set in the YAML config file must be __within__ the velocity range specified in the custom density file (if one is provided)." ] }, { @@ -481,7 +406,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -498,7 +423,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mconfig_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/../docs/yml_files/densitycust/test_config_ex1.yml'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig_fname\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\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./test_config_ex1.yml'\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", @@ -509,8 +434,7 @@ } ], "source": [ - "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config_ex1.yml'\n", - "model = tardis.run_tardis(config_fname)" + "model = tardis.run_tardis('./test_config_ex1.yml')" ] }, { @@ -524,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -541,7 +465,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mconfig_fname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__path__\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m'/../docs/yml_files/densitycust/test_config_ex2.yml'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconfig_fname\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\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./test_config_ex2.yml'\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", @@ -552,8 +476,7 @@ } ], "source": [ - "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config_ex2.yml'\n", - "model = tardis.run_tardis(config_fname)" + "model = tardis.run_tardis('./test_config_ex2.yml')" ] }, { @@ -567,7 +490,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -799,18 +722,17 @@ "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.959 K -- next t_inner 6414.912 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 = 2.21744e+42 erg / s Luminosity absorbed = 1.90600e+38 erg / s Luminosity requested = 2.26469e+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.09 s (\u001b[1mbase.py\u001b[0m:306)\n" + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Simulation finished in 20 iterations and took 2.44 s (\u001b[1mbase.py\u001b[0m:306)\n" ] } ], "source": [ - "config_fname = tardis.__path__[0] + '/../docs/yml_files/densitycust/test_config_ex3.yml'\n", - "model = tardis.run_tardis(config_fname)" + "model = tardis.run_tardis('./test_config_ex3.yml')" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -845,7 +767,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Notice that the inner and outer boundary velocities are the ones specifically set by the user." + "## Important: \n", + "Notice that the inner and outer boundary velocities are the ones specifically set by the user." ] } ], From 8dce50272cc80e52ab7fc6675d39551347e604a5 Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Wed, 1 May 2019 16:53:22 -0400 Subject: [PATCH 13/15] changed name of notebook and title --- ...stom_Density_And_Boundary_Velocities.ipynb | 796 ++++++++++++++++++ 1 file changed, 796 insertions(+) create mode 100644 docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb diff --git a/docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb b/docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb new file mode 100644 index 00000000000..314cea85914 --- /dev/null +++ b/docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb @@ -0,0 +1,796 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Specifying boundary velocities in addition to a custom density file\n", + "\n", + "This notebook will go through multiple detailed examples of how to properly run TARDIS with a custom ejecta profile specified by a custom density file and a custom abundance file. " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import tardis\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Your custom density file\n", + "\n", + "First, let's look at an example of a custom density file." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "80 day\n", + "\n", + "0 9500 9e-16\n", + "1 10500 6e-16\n", + "2 12000 2e-17" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* The first line specifies the time in days after the explosion\n", + "* After a skipped line, each row corresponds to a shell with index specified by the first column.\n", + "* The second column lists the velocities of the outer boundary of the cell in km/s.\n", + "* The third column lists the density of the cell.\n", + "\n", + "## Important: \n", + "The __default behavior__ of TARDIS is to use the first shell as the inner boundary. This means that v_inner_boundary = 9500, and the corresponding density 9e-16 is ignored because it is within the inner boundary. It can be replaced by an arbitrary number. The outer boundary of the last shell will be used as v_outer_boundary, so the default behavior will set v_outer_boundary = 12000." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Your custom abundance file\n", + "\n", + "Let's look at an example of a custom density file." + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "H He\n", + "\n", + "0.0 1.0\n", + "0.4 0.6" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* The first line indicates which elements (or isotopes) correspond to which columns.\n", + "* After a skipped line, each row specifies the chemical abundance of one shell. Therefore the numbers in a given row should sum to 1.0\n", + "\n", + "## Important: \n", + "Note that there are only 2 shells specified in this abundance file (despite the custom density file having 3 lines). This is because the custom density file specifies the boundaries of the shells, while the abundance file specifies the abundances within each shell." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Running TARDIS with the custom files\n", + "\n", + "Now let's run TARDIS using the example custom files." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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] /home/mew488/anaconda2/envs/tardis3/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] /home/mew488/anaconda2/envs/tardis3/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 /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3291: 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.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1matomic.py\u001b[0m:173)\n", + "[\u001b[1mtardis.io.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1matomic.py\u001b[0m:176)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/src/dev/tardis/tardis/plasma/properties/ion_population.py:59: 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] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 = 2.31327e+42 erg / s Luminosity absorbed = 3.85232e+38 erg / s Luminosity requested = 2.26469e+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 6541.006187 6556.13016 0.343875 0.350118\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.915 K -- next t_inner 6482.755 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 = 2.21734e+42 erg / s Luminosity absorbed = 2.64889e+38 erg / s Luminosity requested = 2.26469e+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 6556.13016 6495.397989 0.350118 0.347789\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.755 K -- next t_inner 6551.611 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 = 2.31324e+42 erg / s Luminosity absorbed = 2.21576e+38 erg / s Luminosity requested = 2.26469e+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 6495.397989 6558.906259 0.347789 0.348258\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.611 K -- next t_inner 6482.500 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 = 2.21685e+42 erg / s Luminosity absorbed = 3.70488e+38 erg / s Luminosity requested = 2.26469e+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 6558.906259 6485.545593 0.348258 0.350397\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.500 K -- next t_inner 6552.082 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 = 2.31359e+42 erg / s Luminosity absorbed = 2.20402e+38 erg / s Luminosity requested = 2.26469e+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 6485.545593 6550.104752 0.350397 0.352096\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6552.082 K -- next t_inner 6482.479 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 = 2.21697e+42 erg / s Luminosity absorbed = 2.64706e+38 erg / s Luminosity requested = 2.26469e+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 6550.104752 6464.323819 0.352096 0.354247\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.479 K -- next t_inner 6551.873 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 = 2.31327e+42 erg / s Luminosity absorbed = 2.76611e+38 erg / s Luminosity requested = 2.26469e+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 6464.323819 6586.535643 0.354247 0.344429\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 6551.873 K -- next t_inner 6482.711 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 = 2.21723e+42 erg / s Luminosity absorbed = 2.12445e+38 erg / s Luminosity requested = 2.26469e+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 6586.535643 6452.0629 0.344429 0.358012\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.711 K -- next t_inner 6551.731 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 = 2.31306e+42 erg / s Luminosity absorbed = 3.30756e+38 erg / s Luminosity requested = 2.26469e+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 6452.0629 6542.502642 0.358012 0.353289\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.731 K -- next t_inner 6482.870 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 = 2.21734e+42 erg / s Luminosity absorbed = 3.17660e+38 erg / s Luminosity requested = 2.26469e+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 6542.502642 6474.094395 0.353289 0.353484\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.870 K -- next t_inner 6551.733 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 = 2.31318e+42 erg / s Luminosity absorbed = 2.21194e+38 erg / s Luminosity requested = 2.26469e+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 6474.094395 6569.860807 0.353484 0.34756\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.733 K -- next t_inner 6482.698 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 = 2.21741e+42 erg / s Luminosity absorbed = 1.59417e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\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 6569.860807 6510.554611 0.34756 0.344308\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.698 K -- next t_inner 6551.446 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 = 2.31272e+42 erg / s Luminosity absorbed = 2.20953e+38 erg / s Luminosity requested = 2.26469e+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 6510.554611 6546.768598 0.344308 0.352781\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.446 K -- next t_inner 6483.070 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 = 2.21777e+42 erg / s Luminosity absorbed = 2.64910e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 14/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 6546.768598 6485.552351 0.352781 0.349363\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.070 K -- next t_inner 6551.293 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 = 2.31237e+42 erg / s Luminosity absorbed = 2.76461e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 15/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 6485.552351 6516.39366 0.349363 0.35982\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.293 K -- next t_inner 6483.402 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 = 2.21811e+42 erg / s Luminosity absorbed = 2.64705e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 16/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 6516.39366 6487.025434 0.35982 0.350732\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.402 K -- next t_inner 6551.133 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 = 2.31225e+42 erg / s Luminosity absorbed = 2.21332e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 17/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 6487.025434 6541.53332 0.350732 0.354308\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.133 K -- next t_inner 6483.406 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" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 2.21806e+42 erg / s Luminosity absorbed = 3.18123e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 18/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 6541.53332 6506.188917 0.354308 0.346155\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.406 K -- next t_inner 6551.206 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 = 2.31238e+42 erg / s Luminosity absorbed = 2.76543e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 19/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 6506.188917 6589.429688 0.346155 0.342891\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.206 K -- next t_inner 6483.296 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 = 2.21775e+42 erg / s Luminosity absorbed = 5.09249e+38 erg / s Luminosity requested = 2.26469e+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.68 s (\u001b[1mbase.py\u001b[0m:306)\n" + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config.yml')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can check to make sure that the model loaded and used by TARDIS during the simulation is consistent with your expectations based on the custom files you provided:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_inner_boundary = 950000000.0 cm / s\n", + "v_outer_boundary = 1200000000.0 cm / s\n", + "\n", + "\n", + "velocities of shell boundaries: \n", + "[9.50e+08 1.05e+09 1.20e+09] cm / s\n", + "\n", + "\n", + "densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)\n", + "[7.5e-14 2.5e-15] g / cm3\n" + ] + } + ], + "source": [ + "print('v_inner_boundary = ',model.model.v_boundary_inner)\n", + "print('v_outer_boundary = ',model.model.v_boundary_outer)\n", + "print('\\n')\n", + "print('velocities of shell boundaries: ')\n", + "print(model.model.velocity)\n", + "print('\\n')\n", + "print('densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)')\n", + "print(model.model.density)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Specifying boundary velocities in the config file\n", + "\n", + "In addition to specifying custom density and abundance files, the user can set the v_inner_boundary and v_outer_boundary velocities in the YAML config file. This can cause some confusion, so we carefully go through some examples.\n", + "\n", + "## Important: \n", + "Boundary velocities set in the YAML config file must be __within__ the velocity range specified in the custom density file (if one is provided)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1) v_inner_boundary lower than first velocity in density file\n", + "\n", + "In this example, the first velocity in the density file is 9500 km/s. The user can specify in the config file the velocity of the inner boundary to a lower velocity, say v_inner_boundary = 9000 km/s. This will cause TARDIS to raise an error." + ] + }, + { + "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:367)\n" + ] + }, + { + "ename": "ValueError", + "evalue": "v_boundary_inner is lower than the lowest shell in the model.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\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[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./test_config_ex1.yml'\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, velocity, homologous_density, abundance, isotope_abundance, time_explosion, t_inner, luminosity_requested, t_radiative, dilution_factor, v_boundary_inner, v_boundary_outer, electron_densities)\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_velocity\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[1;32m 79\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvelocity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 80\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhomologous_density\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhomologous_density\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mv_boundary_inner\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 237\u001b[0m 'the model range.')\n\u001b[1;32m 238\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\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[0;32m--> 239\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_boundary_inner is lower than the lowest shell in the model.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 240\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_v_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 241\u001b[0m \u001b[0;31m# Invalidate the cached cut-down velocity array\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: v_boundary_inner is lower than the lowest shell in the model." + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config_ex1.yml')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2) v_outer_boundary larger than last velocity in density file\n", + "\n", + "In this example, the last velocity in the density file is 12000 km/s. The user can specify in the config file the velocity of the outer boundary to a larger velocity, say v_outer_boundary = 13000 km/s. This will cause TARDIS to raise an error." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "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:367)\n" + ] + }, + { + "ename": "ValueError", + "evalue": "v_boundary_outer is larger than the largest shell in the model.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\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[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./test_config_ex2.yml'\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, velocity, homologous_density, abundance, isotope_abundance, time_explosion, t_inner, luminosity_requested, t_radiative, dilution_factor, v_boundary_inner, v_boundary_outer, electron_densities)\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvelocity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 81\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 82\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhomologous_density\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhomologous_density\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_abundance\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mabundance\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mv_boundary_outer\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 262\u001b[0m 'the model range.')\n\u001b[1;32m 263\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\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[0;32m--> 264\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_boundary_outer is larger than the largest shell in the model.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 265\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_v_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[0;31m# Invalidate the cached cut-down velocity array\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: v_boundary_outer is larger than the largest shell in the model." + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config_ex2.yml')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3) v_boundaries in config file are within density file velocity range\n", + "\n", + "Here the user sets v_inner_boundary = 9700 and v_outer_boundary = 11500 in the config file. Both values fall within the velocity range specified by the custom density file." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "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:367)\n", + "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3291: 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.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1matomic.py\u001b[0m:173)\n", + "[\u001b[1mtardis.io.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1matomic.py\u001b[0m:176)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/src/dev/tardis/tardis/plasma/properties/ion_population.py:59: 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] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 = 2.31451e+42 erg / s Luminosity absorbed = 2.20992e+38 erg / s Luminosity requested = 2.26469e+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 6475.378267 6488.637521 0.360681 0.366243\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.018 K -- next t_inner 6413.863 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 = 2.21599e+42 erg / s Luminosity absorbed = 2.64272e+38 erg / s Luminosity requested = 2.26469e+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 6488.637521 6427.216436 0.366243 0.363775\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.863 K -- next t_inner 6483.959 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 = 2.31470e+42 erg / s Luminosity absorbed = 1.66285e+38 erg / s Luminosity requested = 2.26469e+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 6427.216436 6492.265498 0.363775 0.364173\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.959 K -- next t_inner 6413.533 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 = 2.21561e+42 erg / s Luminosity absorbed = 1.59276e+38 erg / s Luminosity requested = 2.26469e+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 6492.265498 6417.052425 0.364173 0.366605\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.533 K -- next t_inner 6484.185 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 = 2.31470e+42 erg / s Luminosity absorbed = 1.65313e+38 erg / s Luminosity requested = 2.26469e+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 6417.052425 6482.377118 0.366605 0.368425\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.185 K -- next t_inner 6413.755 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 = 2.21602e+42 erg / s Luminosity absorbed = 1.05695e+38 erg / s Luminosity requested = 2.26469e+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 6482.377118 6394.506844 0.368425 0.371037\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.755 K -- next t_inner 6483.813 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 = 2.31410e+42 erg / s Luminosity absorbed = 2.76180e+38 erg / s Luminosity requested = 2.26469e+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 6394.506844 6519.309507 0.371037 0.36027\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.813 K -- next t_inner 6414.228 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 = 2.21639e+42 erg / s Luminosity absorbed = 2.64764e+38 erg / s Luminosity requested = 2.26469e+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 6519.309507 6383.889203 0.36027 0.374686\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 6414.228 K -- next t_inner 6483.748 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 = 2.31428e+42 erg / s Luminosity absorbed = 5.54016e+37 erg / s Luminosity requested = 2.26469e+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 6383.889203 6473.974678 0.374686 0.369973\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.748 K -- next t_inner 6413.915 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 = 2.21596e+42 erg / s Luminosity absorbed = 2.63810e+38 erg / s Luminosity requested = 2.26469e+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 6473.974678 6406.611113 0.369973 0.369657\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.915 K -- next t_inner 6484.063 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 = 2.31457e+42 erg / s Luminosity absorbed = 2.20714e+38 erg / s Luminosity requested = 2.26469e+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 6406.611113 6501.97906 0.369657 0.363763\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.063 K -- next t_inner 6413.825 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 = 2.21609e+42 erg / s Luminosity absorbed = 1.59204e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\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 6501.97906 6442.380908 0.363763 0.360018\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.825 K -- next t_inner 6483.774 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 = 2.31415e+42 erg / s Luminosity absorbed = 1.64927e+38 erg / s Luminosity requested = 2.26469e+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 6442.380908 6479.130222 0.360018 0.369277\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.774 K -- next t_inner 6414.121 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 = 2.21646e+42 erg / s Luminosity absorbed = 1.59283e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 14/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 6479.130222 6416.085322 0.369277 0.365588\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.121 K -- next t_inner 6483.538 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 = 2.31368e+42 erg / s Luminosity absorbed = 2.20875e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 15/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 6416.085322 6449.419113 0.365588 0.376548\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.538 K -- next t_inner 6414.538 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 = 2.21696e+42 erg / s Luminosity absorbed = 1.05743e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 16/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 6449.419113 6417.878262 0.376548 0.367147\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.538 K -- next t_inner 6483.218 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 = 2.31321e+42 erg / s Luminosity absorbed = 2.75526e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 17/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 6417.878262 6473.045585 0.367147 0.371157\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.218 K -- next t_inner 6414.863 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 = 2.21737e+42 erg / s Luminosity absorbed = 1.58484e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 18/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 6473.045585 6436.504989 0.371157 0.362441\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.863 K -- next t_inner 6482.959 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" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 2.31299e+42 erg / s Luminosity absorbed = 2.20411e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 19/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 6436.504989 6520.140466 0.362441 0.358913\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.959 K -- next t_inner 6414.912 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 = 2.21744e+42 erg / s Luminosity absorbed = 1.90600e+38 erg / s Luminosity requested = 2.26469e+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.44 s (\u001b[1mbase.py\u001b[0m:306)\n" + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config_ex3.yml')" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_inner_boundary = 970000000.0 cm / s\n", + "v_outer_boundary = 1150000000.0 cm / s\n", + "\n", + "\n", + "velocities of shell boundaries: \n", + "[9.70e+08 1.05e+09 1.15e+09] cm / s\n", + "\n", + "\n", + "densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)\n", + "[7.5e-14 2.5e-15] g / cm3\n" + ] + } + ], + "source": [ + "print('v_inner_boundary = ',model.model.v_boundary_inner)\n", + "print('v_outer_boundary = ',model.model.v_boundary_outer)\n", + "print('\\n')\n", + "print('velocities of shell boundaries: ')\n", + "print(model.model.velocity)\n", + "print('\\n')\n", + "print('densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)')\n", + "print(model.model.density)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Important: \n", + "Notice that the inner and outer boundary velocities are the ones specifically set by the user." + ] + } + ], + "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.6.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 894a17b1f0b6039eac70aa2d10e43c7101a0bc1c Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Thu, 2 May 2019 13:26:14 -0400 Subject: [PATCH 14/15] Changed formatting of titles --- ...y_And_Boundary_Velocities-checkpoint.ipynb | 810 ++++++++++++++++++ ...stom_Density_And_Boundary_Velocities.ipynb | 32 +- docs/examples/densitycust.rst | 4 + 3 files changed, 837 insertions(+), 9 deletions(-) create mode 100644 docs/examples/.ipynb_checkpoints/Custom_Density_And_Boundary_Velocities-checkpoint.ipynb rename docs/{notebooks => examples}/Custom_Density_And_Boundary_Velocities.ipynb (99%) diff --git a/docs/examples/.ipynb_checkpoints/Custom_Density_And_Boundary_Velocities-checkpoint.ipynb b/docs/examples/.ipynb_checkpoints/Custom_Density_And_Boundary_Velocities-checkpoint.ipynb new file mode 100644 index 00000000000..06804eac9d7 --- /dev/null +++ b/docs/examples/.ipynb_checkpoints/Custom_Density_And_Boundary_Velocities-checkpoint.ipynb @@ -0,0 +1,810 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Specifying boundary velocities in addition to a custom density file\n", + "\n", + "This notebook will go through multiple detailed examples of how to properly run TARDIS with a custom ejecta profile specified by a custom density file and a custom abundance file. " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import tardis\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "__Your custom density file__\n", + "\n", + "First, let's look at an example of a custom density file." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "80 day\n", + "\n", + "0 9500 9e-16\n", + "\n", + "1 10500 6e-16\n", + "\n", + "2 12000 2e-17" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* The first line specifies the time in days after the explosion\n", + "* After a skipped line, each row corresponds to a shell with index specified by the first column.\n", + "* The second column lists the velocities of the outer boundary of the cell in km/s.\n", + "* The third column lists the density of the cell.\n", + "\n", + "__IMPORTANT__\n", + "\n", + "The __default behavior__ of TARDIS is to use the first shell as the inner boundary. This means that v_inner_boundary = 9500, and the corresponding density 9e-16 is ignored because it is within the inner boundary. It can be replaced by an arbitrary number. The outer boundary of the last shell will be used as v_outer_boundary, so the default behavior will set v_outer_boundary = 12000." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "__Your custom abundance file__\n", + "\n", + "Let's look at an example of a custom density file." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "H He\n", + "\n", + "0.0 1.0\n", + "\n", + "0.4 0.6" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* The first line indicates which elements (or isotopes) correspond to which columns.\n", + "* After a skipped line, each row specifies the chemical abundance of one shell. Therefore the numbers in a given row should sum to 1.0\n", + "\n", + "__IMPORTANT__\n", + "\n", + "Note that there are only 2 shells specified in this abundance file (despite the custom density file having 3 lines). This is because the custom density file specifies the boundaries of the shells, while the abundance file specifies the abundances within each shell." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "__Running TARDIS with the custom files__\n", + "\n", + "Now let's run TARDIS using the example custom files." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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] /home/mew488/anaconda2/envs/tardis3/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] /home/mew488/anaconda2/envs/tardis3/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 /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3291: 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.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1matomic.py\u001b[0m:173)\n", + "[\u001b[1mtardis.io.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1matomic.py\u001b[0m:176)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/src/dev/tardis/tardis/plasma/properties/ion_population.py:59: 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] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 = 2.31327e+42 erg / s Luminosity absorbed = 3.85232e+38 erg / s Luminosity requested = 2.26469e+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 6541.006187 6556.13016 0.343875 0.350118\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.915 K -- next t_inner 6482.755 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 = 2.21734e+42 erg / s Luminosity absorbed = 2.64889e+38 erg / s Luminosity requested = 2.26469e+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 6556.13016 6495.397989 0.350118 0.347789\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.755 K -- next t_inner 6551.611 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 = 2.31324e+42 erg / s Luminosity absorbed = 2.21576e+38 erg / s Luminosity requested = 2.26469e+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 6495.397989 6558.906259 0.347789 0.348258\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.611 K -- next t_inner 6482.500 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 = 2.21685e+42 erg / s Luminosity absorbed = 3.70488e+38 erg / s Luminosity requested = 2.26469e+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 6558.906259 6485.545593 0.348258 0.350397\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.500 K -- next t_inner 6552.082 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 = 2.31359e+42 erg / s Luminosity absorbed = 2.20402e+38 erg / s Luminosity requested = 2.26469e+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 6485.545593 6550.104752 0.350397 0.352096\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6552.082 K -- next t_inner 6482.479 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 = 2.21697e+42 erg / s Luminosity absorbed = 2.64706e+38 erg / s Luminosity requested = 2.26469e+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 6550.104752 6464.323819 0.352096 0.354247\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.479 K -- next t_inner 6551.873 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 = 2.31327e+42 erg / s Luminosity absorbed = 2.76611e+38 erg / s Luminosity requested = 2.26469e+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 6464.323819 6586.535643 0.354247 0.344429\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 6551.873 K -- next t_inner 6482.711 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 = 2.21723e+42 erg / s Luminosity absorbed = 2.12445e+38 erg / s Luminosity requested = 2.26469e+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 6586.535643 6452.0629 0.344429 0.358012\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.711 K -- next t_inner 6551.731 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 = 2.31306e+42 erg / s Luminosity absorbed = 3.30756e+38 erg / s Luminosity requested = 2.26469e+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 6452.0629 6542.502642 0.358012 0.353289\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.731 K -- next t_inner 6482.870 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 = 2.21734e+42 erg / s Luminosity absorbed = 3.17660e+38 erg / s Luminosity requested = 2.26469e+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 6542.502642 6474.094395 0.353289 0.353484\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.870 K -- next t_inner 6551.733 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 = 2.31318e+42 erg / s Luminosity absorbed = 2.21194e+38 erg / s Luminosity requested = 2.26469e+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 6474.094395 6569.860807 0.353484 0.34756\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.733 K -- next t_inner 6482.698 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 = 2.21741e+42 erg / s Luminosity absorbed = 1.59417e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\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 6569.860807 6510.554611 0.34756 0.344308\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.698 K -- next t_inner 6551.446 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 = 2.31272e+42 erg / s Luminosity absorbed = 2.20953e+38 erg / s Luminosity requested = 2.26469e+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 6510.554611 6546.768598 0.344308 0.352781\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.446 K -- next t_inner 6483.070 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 = 2.21777e+42 erg / s Luminosity absorbed = 2.64910e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 14/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 6546.768598 6485.552351 0.352781 0.349363\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.070 K -- next t_inner 6551.293 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 = 2.31237e+42 erg / s Luminosity absorbed = 2.76461e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 15/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 6485.552351 6516.39366 0.349363 0.35982\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.293 K -- next t_inner 6483.402 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 = 2.21811e+42 erg / s Luminosity absorbed = 2.64705e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 16/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 6516.39366 6487.025434 0.35982 0.350732\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.402 K -- next t_inner 6551.133 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 = 2.31225e+42 erg / s Luminosity absorbed = 2.21332e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 17/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 6487.025434 6541.53332 0.350732 0.354308\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.133 K -- next t_inner 6483.406 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" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 2.21806e+42 erg / s Luminosity absorbed = 3.18123e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 18/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 6541.53332 6506.188917 0.354308 0.346155\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.406 K -- next t_inner 6551.206 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 = 2.31238e+42 erg / s Luminosity absorbed = 2.76543e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 19/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 6506.188917 6589.429688 0.346155 0.342891\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6551.206 K -- next t_inner 6483.296 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 = 2.21775e+42 erg / s Luminosity absorbed = 5.09249e+38 erg / s Luminosity requested = 2.26469e+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.68 s (\u001b[1mbase.py\u001b[0m:306)\n" + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config.yml')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can check to make sure that the model loaded and used by TARDIS during the simulation is consistent with your expectations based on the custom files you provided:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_inner_boundary = 950000000.0 cm / s\n", + "v_outer_boundary = 1200000000.0 cm / s\n", + "\n", + "\n", + "velocities of shell boundaries: \n", + "[9.50e+08 1.05e+09 1.20e+09] cm / s\n", + "\n", + "\n", + "densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)\n", + "[7.5e-14 2.5e-15] g / cm3\n" + ] + } + ], + "source": [ + "print('v_inner_boundary = ',model.model.v_boundary_inner)\n", + "print('v_outer_boundary = ',model.model.v_boundary_outer)\n", + "print('\\n')\n", + "print('velocities of shell boundaries: ')\n", + "print(model.model.velocity)\n", + "print('\\n')\n", + "print('densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)')\n", + "print(model.model.density)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Specifying boundary velocities in the config file\n", + "\n", + "In addition to specifying custom density and abundance files, the user can set the v_inner_boundary and v_outer_boundary velocities in the YAML config file. This can cause some confusion, so we carefully go through some examples.\n", + "\n", + "__IMPORTANT__\n", + "\n", + "Boundary velocities set in the YAML config file must be __within__ the velocity range specified in the custom density file (if one is provided)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1) v_inner_boundary lower than first velocity in density file\n", + "\n", + "In this example, the first velocity in the density file is 9500 km/s. The user can specify in the config file the velocity of the inner boundary to a lower velocity, say v_inner_boundary = 9000 km/s. This will cause TARDIS to raise an error." + ] + }, + { + "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:367)\n" + ] + }, + { + "ename": "ValueError", + "evalue": "v_boundary_inner is lower than the lowest shell in the model.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\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[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./test_config_ex1.yml'\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, velocity, homologous_density, abundance, isotope_abundance, time_explosion, t_inner, luminosity_requested, t_radiative, dilution_factor, v_boundary_inner, v_boundary_outer, electron_densities)\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_velocity\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[1;32m 79\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvelocity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 80\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 81\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 82\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhomologous_density\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhomologous_density\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mv_boundary_inner\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 237\u001b[0m 'the model range.')\n\u001b[1;32m 238\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0;34m<\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\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[0;32m--> 239\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_boundary_inner is lower than the lowest shell in the model.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 240\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_v_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 241\u001b[0m \u001b[0;31m# Invalidate the cached cut-down velocity array\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: v_boundary_inner is lower than the lowest shell in the model." + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config_ex1.yml')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2) v_outer_boundary larger than last velocity in density file\n", + "\n", + "In this example, the last velocity in the density file is 12000 km/s. The user can specify in the config file the velocity of the outer boundary to a larger velocity, say v_outer_boundary = 13000 km/s. This will cause TARDIS to raise an error." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "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:367)\n" + ] + }, + { + "ename": "ValueError", + "evalue": "v_boundary_outer is larger than the largest shell in the model.", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\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[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtardis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_tardis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./test_config_ex2.yml'\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~/src/dev/tardis/tardis/base.py\u001b[0m in \u001b[0;36mrun_tardis\u001b[0;34m(config, atom_data, simulation_callbacks)\u001b[0m\n\u001b[1;32m 35\u001b[0m \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[1;32m 36\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\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[1;32m 38\u001b[0m \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[1;32m 39\u001b[0m \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[0;32m~/src/dev/tardis/tardis/simulation/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config, **kwargs)\u001b[0m\n\u001b[1;32m 430\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'model'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 431\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[0;32m--> 432\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mRadial1DModel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrom_config\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[1;32m 433\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m'plasma'\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[1;32m 434\u001b[0m \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[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mfrom_config\u001b[0;34m(cls, config)\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_inner_boundary'\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[1;32m 384\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mstructure\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_outer_boundary'\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[0;32m--> 385\u001b[0;31m electron_densities=electron_densities)\n\u001b[0m", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, velocity, homologous_density, abundance, isotope_abundance, time_explosion, t_inner, luminosity_requested, t_radiative, dilution_factor, v_boundary_inner, v_boundary_outer, electron_densities)\u001b[0m\n\u001b[1;32m 79\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvelocity\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_inner\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_inner\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 81\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mv_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mv_boundary_outer\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 82\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhomologous_density\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhomologous_density\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_abundance\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mabundance\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/src/dev/tardis/tardis/model/base.py\u001b[0m in \u001b[0;36mv_boundary_outer\u001b[0;34m(self, value)\u001b[0m\n\u001b[1;32m 262\u001b[0m 'the model range.')\n\u001b[1;32m 263\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraw_velocity\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\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[0;32m--> 264\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'v_boundary_outer is larger than the largest shell in the model.'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 265\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_v_boundary_outer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[0;31m# Invalidate the cached cut-down velocity array\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: v_boundary_outer is larger than the largest shell in the model." + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config_ex2.yml')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3) v_boundaries in config file are within density file velocity range\n", + "\n", + "Here the user sets v_inner_boundary = 9700 and v_outer_boundary = 11500 in the config file. Both values fall within the velocity range specified by the custom density file." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "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:367)\n", + "[\u001b[1mtardis.plasma.standard_plasmas\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Reading Atomic Data from /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 (\u001b[1mstandard_plasmas.py\u001b[0m:77)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3291: 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.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Read Atom Data with UUID=6f7b09e887a311e7a06b246e96350010 and MD5=864f1753714343c41f99cb065710cace. (\u001b[1matomic.py\u001b[0m:173)\n", + "[\u001b[1mtardis.io.atomic \u001b[0m][\u001b[1;37mINFO\u001b[0m ] Non provided atomic data: synpp_refs, ion_cx_th_data, ion_cx_sp_data (\u001b[1matomic.py\u001b[0m:176)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/src/dev/tardis/tardis/plasma/properties/ion_population.py:59: 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] /home/mew488/anaconda2/envs/tardis3/lib/python3.6/site-packages/astropy/units/equivalencies.py:90: RuntimeWarning: divide by zero encountered in double_scalars\n", + " (si.m, si.Hz, lambda x: _si.c.value / x),\n", + " (\u001b[1mwarnings.py\u001b[0m:99)\n", + "[\u001b[1mpy.warnings \u001b[0m][\u001b[1;33mWARNING\u001b[0m] /home/mew488/anaconda2/envs/tardis3/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 = 2.31451e+42 erg / s Luminosity absorbed = 2.20992e+38 erg / s Luminosity requested = 2.26469e+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 6475.378267 6488.637521 0.360681 0.366243\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.018 K -- next t_inner 6413.863 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 = 2.21599e+42 erg / s Luminosity absorbed = 2.64272e+38 erg / s Luminosity requested = 2.26469e+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 6488.637521 6427.216436 0.366243 0.363775\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.863 K -- next t_inner 6483.959 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 = 2.31470e+42 erg / s Luminosity absorbed = 1.66285e+38 erg / s Luminosity requested = 2.26469e+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 6427.216436 6492.265498 0.363775 0.364173\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.959 K -- next t_inner 6413.533 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 = 2.21561e+42 erg / s Luminosity absorbed = 1.59276e+38 erg / s Luminosity requested = 2.26469e+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 6492.265498 6417.052425 0.364173 0.366605\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.533 K -- next t_inner 6484.185 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 = 2.31470e+42 erg / s Luminosity absorbed = 1.65313e+38 erg / s Luminosity requested = 2.26469e+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 6417.052425 6482.377118 0.366605 0.368425\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.185 K -- next t_inner 6413.755 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 = 2.21602e+42 erg / s Luminosity absorbed = 1.05695e+38 erg / s Luminosity requested = 2.26469e+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 6482.377118 6394.506844 0.368425 0.371037\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.755 K -- next t_inner 6483.813 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 = 2.31410e+42 erg / s Luminosity absorbed = 2.76180e+38 erg / s Luminosity requested = 2.26469e+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 6394.506844 6519.309507 0.371037 0.36027\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.813 K -- next t_inner 6414.228 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 = 2.21639e+42 erg / s Luminosity absorbed = 2.64764e+38 erg / s Luminosity requested = 2.26469e+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 6519.309507 6383.889203 0.36027 0.374686\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 6414.228 K -- next t_inner 6483.748 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 = 2.31428e+42 erg / s Luminosity absorbed = 5.54016e+37 erg / s Luminosity requested = 2.26469e+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 6383.889203 6473.974678 0.374686 0.369973\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.748 K -- next t_inner 6413.915 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 = 2.21596e+42 erg / s Luminosity absorbed = 2.63810e+38 erg / s Luminosity requested = 2.26469e+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 6473.974678 6406.611113 0.369973 0.369657\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.915 K -- next t_inner 6484.063 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 = 2.31457e+42 erg / s Luminosity absorbed = 2.20714e+38 erg / s Luminosity requested = 2.26469e+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 6406.611113 6501.97906 0.369657 0.363763\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6484.063 K -- next t_inner 6413.825 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 = 2.21609e+42 erg / s Luminosity absorbed = 1.59204e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\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 6501.97906 6442.380908 0.363763 0.360018\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6413.825 K -- next t_inner 6483.774 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 = 2.31415e+42 erg / s Luminosity absorbed = 1.64927e+38 erg / s Luminosity requested = 2.26469e+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 6442.380908 6479.130222 0.360018 0.369277\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.774 K -- next t_inner 6414.121 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 = 2.21646e+42 erg / s Luminosity absorbed = 1.59283e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 14/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 6479.130222 6416.085322 0.369277 0.365588\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.121 K -- next t_inner 6483.538 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 = 2.31368e+42 erg / s Luminosity absorbed = 2.20875e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 15/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 6416.085322 6449.419113 0.365588 0.376548\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.538 K -- next t_inner 6414.538 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 = 2.21696e+42 erg / s Luminosity absorbed = 1.05743e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 16/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 6449.419113 6417.878262 0.376548 0.367147\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.538 K -- next t_inner 6483.218 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 = 2.31321e+42 erg / s Luminosity absorbed = 2.75526e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 17/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 6417.878262 6473.045585 0.367147 0.371157\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6483.218 K -- next t_inner 6414.863 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 = 2.21737e+42 erg / s Luminosity absorbed = 1.58484e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 18/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 6473.045585 6436.504989 0.371157 0.362441\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6414.863 K -- next t_inner 6482.959 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" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Luminosity emitted = 2.31299e+42 erg / s Luminosity absorbed = 2.20411e+38 erg / s Luminosity requested = 2.26469e+42 erg / s (\u001b[1mbase.py\u001b[0m:357)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] Iteration converged 19/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 6436.504989 6520.140466 0.362441 0.358913\n", + "\n", + " (\u001b[1mbase.py\u001b[0m:348)\n", + "[\u001b[1mtardis.simulation.base\u001b[0m][\u001b[1;37mINFO\u001b[0m ] t_inner 6482.959 K -- next t_inner 6414.912 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 = 2.21744e+42 erg / s Luminosity absorbed = 1.90600e+38 erg / s Luminosity requested = 2.26469e+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.44 s (\u001b[1mbase.py\u001b[0m:306)\n" + ] + } + ], + "source": [ + "model = tardis.run_tardis('./test_config_ex3.yml')" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "v_inner_boundary = 970000000.0 cm / s\n", + "v_outer_boundary = 1150000000.0 cm / s\n", + "\n", + "\n", + "velocities of shell boundaries: \n", + "[9.70e+08 1.05e+09 1.15e+09] cm / s\n", + "\n", + "\n", + "densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)\n", + "[7.5e-14 2.5e-15] g / cm3\n" + ] + } + ], + "source": [ + "print('v_inner_boundary = ',model.model.v_boundary_inner)\n", + "print('v_outer_boundary = ',model.model.v_boundary_outer)\n", + "print('\\n')\n", + "print('velocities of shell boundaries: ')\n", + "print(model.model.velocity)\n", + "print('\\n')\n", + "print('densities loaded by TARDIS: (NOTE that the density in the first line of the file was ignored! Densities are also rescaled.)')\n", + "print(model.model.density)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "__IMPORTANT__\n", + "\n", + "Notice that the inner and outer boundary velocities are the ones specifically set by the user." + ] + }, + { + "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.6.7" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb b/docs/examples/Custom_Density_And_Boundary_Velocities.ipynb similarity index 99% rename from docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb rename to docs/examples/Custom_Density_And_Boundary_Velocities.ipynb index 314cea85914..06804eac9d7 100644 --- a/docs/notebooks/Custom_Density_And_Boundary_Velocities.ipynb +++ b/docs/examples/Custom_Density_And_Boundary_Velocities.ipynb @@ -24,19 +24,21 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Your custom density file\n", + "__Your custom density file__\n", "\n", "First, let's look at an example of a custom density file." ] }, { - "cell_type": "raw", + "cell_type": "markdown", "metadata": {}, "source": [ "80 day\n", "\n", "0 9500 9e-16\n", + "\n", "1 10500 6e-16\n", + "\n", "2 12000 2e-17" ] }, @@ -49,7 +51,8 @@ "* The second column lists the velocities of the outer boundary of the cell in km/s.\n", "* The third column lists the density of the cell.\n", "\n", - "## Important: \n", + "__IMPORTANT__\n", + "\n", "The __default behavior__ of TARDIS is to use the first shell as the inner boundary. This means that v_inner_boundary = 9500, and the corresponding density 9e-16 is ignored because it is within the inner boundary. It can be replaced by an arbitrary number. The outer boundary of the last shell will be used as v_outer_boundary, so the default behavior will set v_outer_boundary = 12000." ] }, @@ -57,18 +60,19 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Your custom abundance file\n", + "__Your custom abundance file__\n", "\n", "Let's look at an example of a custom density file." ] }, { - "cell_type": "raw", + "cell_type": "markdown", "metadata": {}, "source": [ "H He\n", "\n", "0.0 1.0\n", + "\n", "0.4 0.6" ] }, @@ -79,7 +83,8 @@ "* The first line indicates which elements (or isotopes) correspond to which columns.\n", "* After a skipped line, each row specifies the chemical abundance of one shell. Therefore the numbers in a given row should sum to 1.0\n", "\n", - "## Important: \n", + "__IMPORTANT__\n", + "\n", "Note that there are only 2 shells specified in this abundance file (despite the custom density file having 3 lines). This is because the custom density file specifies the boundaries of the shells, while the abundance file specifies the abundances within each shell." ] }, @@ -87,7 +92,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Running TARDIS with the custom files\n", + "__Running TARDIS with the custom files__\n", "\n", "Now let's run TARDIS using the example custom files." ] @@ -391,7 +396,8 @@ "\n", "In addition to specifying custom density and abundance files, the user can set the v_inner_boundary and v_outer_boundary velocities in the YAML config file. This can cause some confusion, so we carefully go through some examples.\n", "\n", - "## Important: \n", + "__IMPORTANT__\n", + "\n", "Boundary velocities set in the YAML config file must be __within__ the velocity range specified in the custom density file (if one is provided)." ] }, @@ -767,9 +773,17 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Important: \n", + "__IMPORTANT__\n", + "\n", "Notice that the inner and outer boundary velocities are the ones specifically set by the user." ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/docs/examples/densitycust.rst b/docs/examples/densitycust.rst index 18e24eec083..e18c754367b 100644 --- a/docs/examples/densitycust.rst +++ b/docs/examples/densitycust.rst @@ -47,6 +47,10 @@ Inner Boundary The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation. The density associated with this velocity is the density within the inner boundary, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density file AND specify v_inner_boundary or v_outer_boundary in the configuration YAML file for a TARDIS run. However, the YAML specified values must be within the velocity range specified in the custom density file, otherwise TARDIS will raise an error. When one of the YAML specified boundary velocities falls within the velocity range specified in the custom density file, then the boundary velocity is set equal to the number in the configuration YAML file. This has the effect of splitting a cell in the custom density file into two parts, a region within the boundary and a region outside the boundary. +.. toctree:: + + Custom_Density_And_Boundary_Velocities.ipynb + It is always a good idea to check the model velocities and abundances used in a TARDIS simulation after it has been successfully run. .. warning:: From d552c3f625717e9a57006c468eb9e3fe3c88941d Mon Sep 17 00:00:00 2001 From: Marc Williamson Date: Thu, 2 May 2019 13:30:02 -0400 Subject: [PATCH 15/15] Removed full paths in yml files --- docs/yml_files/densitycust/test_config.yml | 2 +- docs/yml_files/densitycust/test_config_ex1.yml | 2 +- docs/yml_files/densitycust/test_config_ex2.yml | 2 +- docs/yml_files/densitycust/test_config_ex3.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/yml_files/densitycust/test_config.yml b/docs/yml_files/densitycust/test_config.yml index 2e5f273ecb7..3943171dbf8 100644 --- a/docs/yml_files/densitycust/test_config.yml +++ b/docs/yml_files/densitycust/test_config.yml @@ -7,7 +7,7 @@ supernova: distance: 8.32 Mpc # standard atomic data base; get it from the tardis-refdata repository -atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 +atom_data: kurucz_cd23_chianti_H_He.h5 model: structure: diff --git a/docs/yml_files/densitycust/test_config_ex1.yml b/docs/yml_files/densitycust/test_config_ex1.yml index 278e0b3bf2d..ac8546e1389 100644 --- a/docs/yml_files/densitycust/test_config_ex1.yml +++ b/docs/yml_files/densitycust/test_config_ex1.yml @@ -7,7 +7,7 @@ supernova: distance: 8.32 Mpc # standard atomic data base; get it from the tardis-refdata repository -atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 +atom_data: kurucz_cd23_chianti_H_He.h5 model: structure: diff --git a/docs/yml_files/densitycust/test_config_ex2.yml b/docs/yml_files/densitycust/test_config_ex2.yml index 5ce5c9315a1..e38a0efb35f 100644 --- a/docs/yml_files/densitycust/test_config_ex2.yml +++ b/docs/yml_files/densitycust/test_config_ex2.yml @@ -7,7 +7,7 @@ supernova: distance: 8.32 Mpc # standard atomic data base; get it from the tardis-refdata repository -atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 +atom_data: kurucz_cd23_chianti_H_He.h5 model: structure: diff --git a/docs/yml_files/densitycust/test_config_ex3.yml b/docs/yml_files/densitycust/test_config_ex3.yml index ae6325bc9db..921320d1005 100644 --- a/docs/yml_files/densitycust/test_config_ex3.yml +++ b/docs/yml_files/densitycust/test_config_ex3.yml @@ -7,7 +7,7 @@ supernova: distance: 8.32 Mpc # standard atomic data base; get it from the tardis-refdata repository -atom_data: /home/mew488/Research/TARDIS/tardis-refdata/atom_data/kurucz_cd23_chianti_H_He.h5 +atom_data: kurucz_cd23_chianti_H_He.h5 model: structure: