-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #514 from HajimeKawahara/test_gQT
unit test to check line strengths
- Loading branch information
Showing
1 changed file
with
34 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,34 @@ | ||
from exojax.test.emulate_mdb import mock_mdbHitemp, mock_mdbExomol | ||
import numpy as np | ||
import pytest | ||
|
||
|
||
def test_line_strength_exomol(): | ||
mdb = mock_mdbExomol() | ||
assert pytest.approx(np.sum(mdb.line_strength_ref)) == 3.260386610389642e-22 | ||
|
||
|
||
def test_line_strength_exomol_t(): | ||
mdb = mock_mdbExomol() | ||
mdb.change_reference_temperature(1200.0) | ||
mask = np.isfinite(mdb.line_strength_ref) | ||
val = np.sum(mdb.line_strength_ref[mask]) | ||
assert pytest.approx(val) == 1.2823972e-20 | ||
|
||
|
||
def test_line_strength_hitemp(): | ||
mdb = mock_mdbHitemp() | ||
assert pytest.approx(np.sum(mdb.line_strength_ref)) == 3.2168443e-22 | ||
|
||
|
||
def test_line_strength_hitemp_t(): | ||
mdb = mock_mdbHitemp() | ||
mdb.change_reference_temperature(1200.0) | ||
mask = np.isfinite(mdb.line_strength_ref) | ||
val = np.sum(mdb.line_strength_ref[mask]) | ||
assert pytest.approx(val) == 1.2651083e-20 | ||
|
||
|
||
if __name__ == "__main__": | ||
test_line_strength_exomol_t() | ||
test_line_strength_hitemp_t() |