From 1ac064cc0e4ccff6e4417f7bacefff4557a634aa Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Tue, 13 Nov 2012 22:26:36 -0500 Subject: [PATCH] fixed some of the nist data --- tardis/tests/data/nist_si2.dat | 6 +++++- tardis/tests/data/nist_si3.dat | 8 +++++++- tardis/tests/test_plasma.py | 15 ++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tardis/tests/data/nist_si2.dat b/tardis/tests/data/nist_si2.dat index 80c29e37d37..0716b98ae1d 100644 --- a/tardis/tests/data/nist_si2.dat +++ b/tardis/tests/data/nist_si2.dat @@ -1,3 +1,7 @@ +------------------------------------------------------------------------------------------------------------------------- +Configuration | Term | J | Level | Leading percentages | Reference +----------------------|--------|------|---------------------------|------------------------------------------|----------- + | | | | | 3s2.3p | 2P* | 1/2 | 0.00000 | 94 : 3 3p3 2P* | L5815 | | 3/2 | 0.035613 | 94 : 3 3p3 2P* | | | | | | @@ -144,4 +148,4 @@ 3s.3p.(3P*).4p | 4D | 1/2 | 16.33924 | | | | 3/2 | 16.348795 | | | | 5/2 | 16.364432 | | - | | 7/2 | 16.386035 | | + | | 7/2 | 16.386035 | | \ No newline at end of file diff --git a/tardis/tests/data/nist_si3.dat b/tardis/tests/data/nist_si3.dat index 96cc3c30bd3..9708fff6b07 100644 --- a/tardis/tests/data/nist_si3.dat +++ b/tardis/tests/data/nist_si3.dat @@ -1,3 +1,7 @@ +---------------------------------------------------------------------------------------------------------------------- +Configuration | Term | J | Level | Leading percentages | Reference +--------------------|-----------|-----|----------------------------|--------------------------------------|----------- + | | | | | 2p6.3s2 | 1S | 0 | 0.00000 | 95 : 5 3p2 1S | L5815 | | | | | 3s.3p | 3P* | 0 | 6.537028 | | @@ -266,4 +270,6 @@ | | | | | 3p.4d | 1D*? | 2 | 33.163771 | | | | | | | -3p.4d | 3F*? | 4 | 33.188892 | \ No newline at end of file +3p.4d | 3F*? | 4 | 33.188892 | | + | | 2 | | | + | | 3 | | | \ No newline at end of file diff --git a/tardis/tests/test_plasma.py b/tardis/tests/test_plasma.py index 4ac67efce3a..331b364a812 100644 --- a/tardis/tests/test_plasma.py +++ b/tardis/tests/test_plasma.py @@ -6,12 +6,25 @@ from ..import atomic, plasma from numpy import testing import pytest -from astropy import units +import numpy as np +from astropy import units, table atom_model = atomic.AtomData.from_hdf5() fe_mass = atom_model._atom[25]['mass'] + +def read_nist_data(fname): + data = np.genfromtxt(fname, skip_header=3, delimiter='|', usecols=(2, 3), + converters={3: lambda s: float(s.strip().strip('?[]'))}, names=('j', 'energy')) + table.Table(data) + + +nist_si1 = read_nist_data('data/nist_si1.dat') +nist_si2 = read_nist_data('data/nist_si2.dat') +nist_si3 = read_nist_data('data/nist_si3.dat') + + @pytest.mark.parametrize(("abundances", "abundance_fraction_fe"), [ (dict(Fe=0.5, Ni=0.5), 0.5), (dict(Fe=1., Ni=0.5), 1. / 1.5)