forked from tardis-sn/tardis
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test_partition_function script
- Loading branch information
1 parent
f408073
commit d8dfd92
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import numpy as np | ||
|
||
from tardis.plasma.properties import LevelBoltzmannFactor, LTEPartitionFunction | ||
|
||
|
||
def test_level_boltzmann_factor1(standard_lte_plasma_he_db): | ||
level_boltzmann_factor_module = LevelBoltzmannFactor(None) | ||
levels = standard_lte_plasma_he_db.levels | ||
factor = level_boltzmann_factor_module.calculate(levels, standard_lte_plasma_he_db.beta_rad) | ||
assert np.allclose(factor.loc[2, 0, 0], levels.loc[2, 0, 0].g) | ||
assert np.allclose(factor.loc[2, 1, 0], levels.loc[2, 1, 0].g) | ||
assert np.allclose(factor.loc[2, 0, 10], 7.6218092841240705e-12) | ||
|
||
def test_lte_partition_function1(standard_lte_plasma_he_db): | ||
partition_function = LTEPartitionFunction.calculate( | ||
standard_lte_plasma_he_db.levels, | ||
standard_lte_plasma_he_db.level_boltzmann_factor) | ||
assert 0 |