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

added test cases test_atom_levels() and test_atom_lines() #19

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
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
22 changes: 20 additions & 2 deletions tardis/tests/test_atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,23 @@ def test_ionization_h5_readin():


def test_atom_levels():
atom_data = atomic.AtomData.from_hdf5()
raise Exception('test the atom_data thoroughly')
levels_data = atomic.AtomData.from_hdf5()._levels
level_idx = levels_data['level_number'] == 0
assert levels_data['energy'][level_idx] == 0.0


def test_atom_lines():
lines_data = atomic.AtomData.from_hdf5()._lines
assert min(abs(lines_data['wavelength']-6347.109)) == 0



# assert atom_data._lines['ion_number'][0] == 1
# f_ul = atom_data._lines['f_ul'][0]
# testing.assert_almost_equal(f_ul, 0.018532, decimal=4)
# f_lu = atom_data._lines['f_lu'][0]
# testing.assert_almost_equal(f_lu, 0.037065, decimal=4)
# assert atom_data._lines['level_id_lower'][0] == 0
# assert atom_data._lines['level_id_upper'][0] == 113