From b181f21cc3dd9a2306d2162bc9e2c09230c95036 Mon Sep 17 00:00:00 2001 From: maryam Date: Thu, 15 Nov 2012 17:35:32 -0500 Subject: [PATCH 1/4] updated docstrings in plasma.py and added tables for levels data and lines data in atomic.rst --- docs/tardis/atomic.rst | 45 +++++++++++++++++++++++++++++++++++++++--- docs/tardis/plasma.rst | 2 -- tardis/atomic.py | 9 +++++---- tardis/plasma.py | 5 +++-- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/docs/tardis/atomic.rst b/docs/tardis/atomic.rst index 69e45a2096c..852673c6ff1 100644 --- a/docs/tardis/atomic.rst +++ b/docs/tardis/atomic.rst @@ -6,9 +6,11 @@ All atomic data files are stored in an hdf5 file hdf5 ---- -All atomic data are stored in hdf5 files, in tables. The atomic data table contains information on atomic number, -symbol, mass; and the ionization data table contains atomic number, ion number, and ionization energy information. -Tables contain attributes which contains units. +All atomic data are stored in hdf5 files. +The atomic data table contains information on atomic number, symbol, and masses. +The ionization data table contains atomic number, ion number, and ionization energy information. +The levels data table contains + @@ -40,6 +42,43 @@ Ionization Data | ionization energy | Ionization Energy of atom | eV | +------------------------+------------------------------+----------+ +Levels Data + ++------------------------+------------------------------+----------+ +|Name | Description | Symbol | ++========================+==============================+==========+ +| atomic_number(z) | Atomic Number | 1 | ++------------------------+------------------------------+----------+ +| ion number | Ion Number | 1 | ++------------------------+------------------------------+----------+ +| level number | | 1 | ++------------------------+------------------------------+----------+ +| energy | | | ++------------------------+------------------------------+----------+ +| g | | | ++------------------------+------------------------------+----------+ +| metastable | | | ++------------------------+------------------------------+----------+ + +Lines Data + ++------------------------+------------------------------+----------+ +|Name | Description | Symbol | ++========================+==============================+==========+ +| wavelength | | | ++------------------------+------------------------------+----------+ +| atomic_number(z) | Atomic Number | 1 | ++------------------------+------------------------------+----------+ +| ion number | Ion Number | 1 | ++------------------------+------------------------------+----------+ +| f_ul | | | ++------------------------+------------------------------+----------+ +| f_lu | | | ++------------------------+------------------------------+----------+ +| level_id_l | | | ++------------------------+------------------------------+----------+ +| level_od_l | | | ++------------------------+------------------------------+----------+ diff --git a/docs/tardis/plasma.rst b/docs/tardis/plasma.rst index ad2aac8ca80..dff8a8c20cc 100644 --- a/docs/tardis/plasma.rst +++ b/docs/tardis/plasma.rst @@ -1,6 +1,5 @@ Plasma ====== - .. currentmodule:: tardis.plasma Level Populations @@ -10,7 +9,6 @@ We first calculate the number densities for each atom :math:`N_{atom} = \rho_\textrm{total} \times \textrm{Abundance fraction} / m_\textrm{atom}` Next we calculate the partition function (Z) where i is the level number and j the ion number: - :math:`Z_{j} = \sum_{i=0}^{max levels} g_i * e^{-E_i / (k_\textrm{b} T)}` .. automodapi:: tardis.plasma diff --git a/tardis/atomic.py b/tardis/atomic.py index eaa355a8bde..d785719af8e 100644 --- a/tardis/atomic.py +++ b/tardis/atomic.py @@ -119,7 +119,8 @@ def read_ionization_data(fname=None): def read_levels_data(fname=None): - """This function reads the atomic number, ion number, and ionization energy from hdf5 file + """This function reads atomic number, ion number, level_number, energy, g, metastable + information from hdf5 file. Parameters ---------- @@ -131,8 +132,7 @@ def read_levels_data(fname=None): ------- data : `~astropy.table.Table` - table with fields ### FILL IN DATA### - + table with fields z[1], ion[1], level_number, energy, g, metastable """ data_table = read_hdf5_data(fname, 'levels_data') @@ -143,7 +143,8 @@ def read_levels_data(fname=None): def read_lines_data(fname=None): - """This function reads the atomic number, ion number, and ionization energy from hdf5 file + """This function reads the wavelength, atomic number, ion number, f_ul, f_l and level id information + from hdf5 file Parameters ---------- diff --git a/tardis/plasma.py b/tardis/plasma.py index 72eae669adf..31aac81ded2 100644 --- a/tardis/plasma.py +++ b/tardis/plasma.py @@ -68,8 +68,9 @@ def _calculate_atom_number_densities(self): def calculate_partition_functions(self, temperature): """ Calculate partition functions for the ions using the following formula: - .. math:: - Z_{j} = \sum_{i=0}^{max(levels)} g_i * e^{-E_i / (k_\textrm{b} T)} + + :math:`Z_{j} = \\sum_{i=0}^{max levels} g_i \\times e^{-E_i / (k_\\textrm{b} T)}` + Parameters ---------- From ae9263e5d3c8f5cb1303f3b618fd189f4063af18 Mon Sep 17 00:00:00 2001 From: maryam Date: Thu, 15 Nov 2012 17:38:09 -0500 Subject: [PATCH 2/4] updated docstrings in plasma.py and added tables for levels data and lines data in atomic.rst --- docs/tardis/atomic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tardis/atomic.rst b/docs/tardis/atomic.rst index 852673c6ff1..ffe9d494534 100644 --- a/docs/tardis/atomic.rst +++ b/docs/tardis/atomic.rst @@ -53,7 +53,7 @@ Levels Data +------------------------+------------------------------+----------+ | level number | | 1 | +------------------------+------------------------------+----------+ -| energy | | | +| energy | | | +------------------------+------------------------------+----------+ | g | | | +------------------------+------------------------------+----------+ From 1163d19e53c12f8a7b264d30048bba6d4a0b4e71 Mon Sep 17 00:00:00 2001 From: maryam Date: Thu, 15 Nov 2012 17:39:07 -0500 Subject: [PATCH 3/4] updated docstrings in plasma.py and added tables for levels data and lines data in atomic.rst --- docs/tardis/atomic.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tardis/atomic.rst b/docs/tardis/atomic.rst index ffe9d494534..be2feafb81d 100644 --- a/docs/tardis/atomic.rst +++ b/docs/tardis/atomic.rst @@ -51,7 +51,7 @@ Levels Data +------------------------+------------------------------+----------+ | ion number | Ion Number | 1 | +------------------------+------------------------------+----------+ -| level number | | 1 | +| level number | Level Number | 1 | +------------------------+------------------------------+----------+ | energy | | | +------------------------+------------------------------+----------+ From d8db38e9827baab7060c2c19e5fcfa201b6c6b29 Mon Sep 17 00:00:00 2001 From: maryam Date: Thu, 15 Nov 2012 17:41:02 -0500 Subject: [PATCH 4/4] updated docstrings in plasma.py and added tables for levels data and lines data in atomic.rst --- docs/tardis/atomic.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tardis/atomic.rst b/docs/tardis/atomic.rst index be2feafb81d..a689b5a7211 100644 --- a/docs/tardis/atomic.rst +++ b/docs/tardis/atomic.rst @@ -44,6 +44,7 @@ Ionization Data Levels Data + +------------------------+------------------------------+----------+ |Name | Description | Symbol | +========================+==============================+==========+