Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The final carsus merge #786

Merged
merged 92 commits into from
Aug 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
d182924
move atomic.py and test_atomic.py to io
mishinma Jun 24, 2016
4be5f1e
fix imports
mishinma Jun 24, 2016
4610db6
fix data_path in atomic.py
mishinma Jun 24, 2016
e45f130
fix the imports in conftest
mishinma Jun 27, 2016
53a27b4
fix links in atomic_data_description
mishinma Jun 27, 2016
20d257a
fix paths in test_atomic
mishinma Jun 27, 2016
afc2103
fix import in test_w7
mishinma Jun 27, 2016
88feb16
implement tests_data_path in atomic
mishinma Jun 27, 2016
493289f
fix import in tardis/base.py
mishinma Jun 27, 2016
b461474
refactor from_hdf and __init__
mishinma Jun 28, 2016
2458b9e
ditch all read functions
mishinma Jun 28, 2016
0e806b5
ditch symbol2atomic_number
mishinma Jun 28, 2016
b57f59c
write better docstrings
mishinma Jun 28, 2016
aa2f002
set lines attr in __init__
mishinma Jun 28, 2016
533e51a
fix a typo with _v_attrs
mishinma Jun 28, 2016
b111f8a
add attributes and methods to AtomData's docstring
mishinma Jun 28, 2016
7e6021a
add attributes in the else clauses
mishinma Jun 28, 2016
2537725
change _df to _data
mishinma Jun 28, 2016
dc7f4cf
change the description of the dataframes to comply with the old ones
mishinma Jun 28, 2016
64e9087
return symbol2atomic_number and atomic_number2symbol
mishinma Jun 30, 2016
a24409f
uncomment zeta_data, synpp_refs and ion_cx_data
mishinma Jul 1, 2016
c7c2e99
remove conversion to cgs units
mishinma Jul 1, 2016
f5fe635
remove set multiindex for synpp_refs
mishinma Jul 1, 2016
372c77c
change from_hdfstore and md5 in the kurucz_atomic_data fixture
mishinma Jul 1, 2016
9f99941
download kurucz_cd23_chianti_H_He.h5 from carsus-db
mishinma Jul 4, 2016
dc517fb
change the dataframes names in the hdfstore
mishinma Jul 6, 2016
1f4ee7b
Rewrite AtomData.prepare_atom_data
mishinma Jul 28, 2016
920d603
Change from_hdfstore to from_hdf
mishinma Jul 28, 2016
384e363
Restructure AtomData.__init__
mishinma Jul 28, 2016
dd11d04
Ditch the "has_some_data" attributes
mishinma Jul 28, 2016
a1892c2
Get collision temps in another try..except block
mishinma Jul 28, 2016
9678086
Fix a typo
mishinma Jul 28, 2016
4588586
Remove a comment
mishinma Jul 28, 2016
c3ebde6
Fix a typo
mishinma Jul 28, 2016
c2c6f86
Rename macro_atom attributes in init
mishinma Jul 28, 2016
2b3a3af
Update AtomData docstring
mishinma Jul 28, 2016
494260b
Clear imports
mishinma Jul 28, 2016
e3535c0
Fix a typo in name
mishinma Jul 28, 2016
f2fb61d
Replace has_some_data with is not None
mishinma Jul 28, 2016
2984eb0
Use a dict to instantiate AtomData
mishinma Jul 28, 2016
987704a
Use logger instead of print stmts
mishinma Jul 29, 2016
b48d485
Correct a typo in hdf names
mishinma Jul 29, 2016
10013f5
Use try..except to read md5 and uuid1
mishinma Jul 29, 2016
5dbd5df
Check either all or none of the related dfs are given
mishinma Jul 29, 2016
30d5d03
Convert values to CGS in init
mishinma Aug 2, 2016
c2fb39b
Add a comment
mishinma Aug 2, 2016
0cd298f
Use loc to create and set columns
mishinma Aug 4, 2016
ff56083
Remove extra blank lines
mishinma Aug 15, 2016
a73be2f
Move helper functions from atomic to util
mishinma Aug 18, 2016
aa5fe25
Make fname a positional argument
mishinma Aug 18, 2016
18116ca
Remove girname
mishinma Aug 18, 2016
dd4d492
Remove unused fixtures from conftest
mishinma Aug 18, 2016
ee9f903
Clean imports in conftest
mishinma Aug 18, 2016
ca08ffd
Use --atomic-dataset instead of chianti_he_db
mishinma Aug 18, 2016
f3d89d5
Change method name to from_hdf
mishinma Aug 18, 2016
fb8fb19
Reimplement tests for atomic
mishinma Aug 18, 2016
746a37a
Use global variable for defauld UUID
mishinma Aug 18, 2016
e999d6f
Change the default UUID
mishinma Aug 18, 2016
61bf9c8
Change method name
mishinma Aug 22, 2016
b03161e
Print a 'non provided' AtomData logging info message only if there ar…
ftsamis Jan 14, 2017
26ecf38
Rename leftover calls of AtomData.from_hdf5 to AtomData.from_hdf.
ftsamis Jan 15, 2017
4e2265f
Finish rebase onto upstream/master
yeganer Aug 1, 2017
c3c1acc
Update the test database to the new format
yeganer Aug 10, 2017
9c6f6c7
Change ionization_data from DataFrame to Series
yeganer Aug 10, 2017
a1ac05a
[PEP8] Fixes in tardis/io/atomic.py
yeganer Aug 22, 2017
369986b
[PEP8] Fixes in tardis/io/atomic.py
yeganer Aug 22, 2017
3abc7f2
The AtomData now comes with indexes set
yeganer Aug 23, 2017
6bfbdeb
Fix several issues with indices
yeganer Aug 24, 2017
1e0a182
[PEP8] In file tardis/io/atomic.py
yeganer Aug 24, 2017
9ff3bf0
Remove some pd.DataFrame.copy()
yeganer Aug 24, 2017
61f4484
Remove unused parameter 'max_ion_number'
yeganer Aug 24, 2017
5caba15
Change default AtomData UUID
yeganer Aug 24, 2017
6738a58
Fix a bug in _main_nlte_calculation
yeganer Aug 24, 2017
2853fc1
Small changes to the plasma tests
yeganer Aug 24, 2017
e530118
fixup! Change default AtomData UUID
yeganer Aug 24, 2017
35312e8
Fix tests for io/atomic.py
yeganer Aug 24, 2017
a49c123
Add 'tardis_ref_data' and 'generate_reference' fixtures
yeganer Aug 25, 2017
81ccd4e
Rewrite tests_plasmas_full to use 'tardis-refdata'
yeganer Aug 25, 2017
46155ee
[IO] Open HDFStore only once during to_hdf
yeganer Aug 25, 2017
31186b2
Update tardis-refdata version to pull
yeganer Aug 25, 2017
9b91d79
Rewrite test_tardis_full
yeganer Aug 25, 2017
6dce3df
Rewrite test_simulation
yeganer Aug 25, 2017
0fb77ef
Rewrite test_plasmas_full
yeganer Aug 25, 2017
c0e034d
Add warning to test_complete_plasmas
yeganer Aug 25, 2017
acd4385
Remove old reference files
yeganer Aug 25, 2017
aa0b054
Fix a bug when calculating the 'block_references'
yeganer Aug 28, 2017
8ea67b6
Remove all occurences of 'plasma_array' in code
yeganer Aug 30, 2017
73f6ec2
Use np.zeros_like to initialize collision_matrix
yeganer Aug 30, 2017
d6da4b1
Add docstring to idfn in test_complete_plasmas.py
yeganer Aug 30, 2017
b04add2
Delete old test
yeganer Aug 30, 2017
1a200c7
Always overwrite Reference data when regenerating
yeganer Aug 30, 2017
7904fd6
Download chianti_He.h5 during travis
yeganer Aug 31, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@ before_install:
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs install --skip-smudge; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git clone $TARDIS_REF_DATA_URL $HOME/tardis-refdata; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $HOME/tardis-refdata; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/2/head:plasma-ref2; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git checkout plasma-ref2; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git fetch origin pull/3/head:carsus-ref; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git checkout carsus-ref; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="atom_data/chianti_He.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="plasma_reference/" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then git lfs pull --include="unit_test_data.h5" origin; fi
- if [[ $TEST_MODE == 'spectrum' ]]; then cd $TRAVIS_BUILD_DIR; fi

install:
- cd $TRAVIS_BUILD_DIR
- conda env create -f tardis_env27.yml
- source activate tardis

Expand Down
6 changes: 3 additions & 3 deletions docs/atomic/atomic_data_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
******************************
Atomic Data Format Description
******************************
.. currentmodule:: tardis.atomic
.. currentmodule:: tardis.io.atomic


The atomic data for tardis is stored in `hdf5 files <http://www.h5py.org/>`_. TARDIS ships with a
Expand Down Expand Up @@ -205,7 +205,7 @@ Macro Atom References
The Atom Data Class
-------------------

Atom Data is stored inside TARDIS in the :class:`AtomData`-class. The class method :func:`AtomData.from_hdf5` will
Atom Data is stored inside TARDIS in the :class:`AtomData`-class. The class method :func:`AtomData.from_hdf` will
instantiate a new `AtomData`-class from an HDF5 file. If none is given it will automatically
take the default HDF5-dataset shipped with TARDIS. A second function :func:`AtomData.prepare_atom_data`
will cut the levels and lines data to only the required atoms and ions. In addition, it will create the intricate system
Expand All @@ -225,4 +225,4 @@ TO BE BETTER DOCUMENTED ...



.. automodapi:: tardis.atomic
.. automodapi:: tardis.io.atomic
5 changes: 3 additions & 2 deletions docs/physics/plasma.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ setting `BasePlasma.beta_rad` to :math:`\frac{1}{k_\textrm{B}T_\textrm{rad}}`.
Here's an example how to instantiate a simple base plasma::


>>> from tardis import atomic, plasma
>>> atom_data = atomic.AtomData.from_hdf5()
>>> from tardis import plasma
>>> from tardis.io import atomic
>>> atom_data = atomic.AtomData.from_hdf()
>>> my_plasma = plasma.BasePlasma({'Fe':0.5, 'Ni':0.5}, 10000, 1e-13, atom_data)
>>> print my_plasma.abundances
atomic_number abundance_fraction number_density
Expand Down
14 changes: 10 additions & 4 deletions docs/physics/plasma/plasma_plots/lte_ionization_balance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
from matplotlib import pyplot as plt
from matplotlib import colors
from tardis import atomic, plasma_array, util
from tardis import util
from tardis.io import atomic
import numpy as np
import pandas as pd
from astropy import units as u
Expand All @@ -18,7 +19,7 @@
atom_fname = os.path.join(os.path.dirname(atomic.__file__), 'data', 'atom_data.h5')

# reading in the HDF5 File
atom_data = atomic.AtomData.from_hdf5(atom_fname)
atom_data = atomic.AtomData.from_hdf(atom_fname)

#The atom_data needs to be prepared to create indices. The Class needs to know which atomic numbers are needed for the
#calculation and what line interaction is needed (for "downbranch" and "macroatom" the code creates special tables)
Expand All @@ -27,7 +28,12 @@
#Initializing the NebularPlasma class using the from_abundance class method.
#This classmethod is normally only needed to test individual plasma classes
#Usually the plasma class just gets the number densities from the model class
lte_plasma = plasma_array.BasePlasmaArray.from_abundance({'Si':1.0}, 1e-14*u.g/u.cm**3, atom_data, 10*u.day)
assert True, (
'This script needs a proper rewrite and should use the new'
'"assemble_plasma" function.')
# TODO: Uncomment and fix the next line
# lte_plasma = assemble_plasma({'Si':1.0}, 1e-14*u.g/u.cm**3, atom_data, 10*u.day)
lte_plasma = None
lte_plasma.update_radiationfield([10000], [1.0])

#Initializing a dataframe to store the ion populations and level populations for the different temperatures
Expand Down Expand Up @@ -79,4 +85,4 @@
ax2.set_ylabel('Number Density Fraction')
cb.set_label('T [K]')

plt.show()
plt.show()
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os

from matplotlib import colors
from tardis import atomic, plasma_array, util
from tardis import util
from tardis.io import atomic
from matplotlib import pyplot as plt

import numpy as np
Expand All @@ -19,7 +20,7 @@
atom_fname = os.path.expanduser('~/.tardis/si_kurucz.h5')

# reading in the HDF5 File
atom_data = atomic.AtomData.from_hdf5(atom_fname)
atom_data = atomic.AtomData.from_hdf(atom_fname)

#The atom_data needs to be prepared to create indices. The Class needs to know which atomic numbers are needed for the
#calculation and what line interaction is needed (for "downbranch" and "macroatom" the code creates special tables)
Expand Down Expand Up @@ -109,4 +110,4 @@
ax2.set_ylabel('Number Density Fraction')
cb.set_label('T [K]')

plt.show()
plt.show()
Loading