Skip to content

Commit

Permalink
Fix paths to spectral model files in temperature response (#162)
Browse files Browse the repository at this point in the history
* Fix paths to spectral model files in temperature response

The path to the model for hybrid abundances and photospheric abundances were switched.

* Fix atol in test_temperature_response_coronal.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol in test_temperature_response_hybrid.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol in test_temperature_response_photospheric.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol in test_temperature_response.py

Made atol scaled to temperature response to provide a more stringent test.

* Fix atol, rtol values in test_temperature_response.py

Use atol and rtol values that should lead to passing all tests.

* Fix atol, rtol values in test_temperature_response_coronal.py

Use atol, rtol values that should lead to passing all tests.

* Fix atol, rtol values in test_temperature_response_hybrid.py

Use atol, rtol values that should lead to passing all tests.

* Fix atol, rtol values in test_temperature_response_photospheric.py

Use atol, rtol values that should lead to passing all tests.

* Another fix to test_temperature_response_hybrid.py

needed to scale atol to max value of temperature response

* Another fix to test_temperature_response_coronal.py

need to scale atol to the max value of temperature response

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jslavin and pre-commit-ci[bot] authored Jun 6, 2023
1 parent 7229e9f commit 0c53725
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions xrtpy/response/temperature_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
/ "XRT_emiss_model.default_CHIANTI.geny",
"hybrid_abundance_path": Path(__file__).parent.absolute()
/ "data/chianti_emission_models"
/ "XRT_emiss_model.default_CHIANTI_photospheric.geny",
/ "XRT_emiss_model.default_CHIANTI_hybrid.geny",
"photospheric_abundance_path": Path(__file__).parent.absolute()
/ "data/chianti_emission_models"
/ "XRT_emiss_model.default_CHIANTI_hybrid.geny",
/ "XRT_emiss_model.default_CHIANTI_photospheric.geny",
}

_abundance_model_data = {
Expand Down
7 changes: 5 additions & 2 deletions xrtpy/response/tests/test_temperature_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def test_temperature_response(filename, allclose):
filter_name, filter_obs_date, abundance_model="coronal"
)
actual_temperature_response = instance.temperature_response()

atol = actual_temperature_response.value.max() * 0.013
assert allclose(
actual_temperature_response.value, IDL_temperature_response, rtol=1e-6
actual_temperature_response.value,
IDL_temperature_response,
rtol=0.028,
atol=atol,
)
7 changes: 5 additions & 2 deletions xrtpy/response/tests/test_temperature_response_coronal.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def test_temperature_response(filename, allclose):
filter_name, filter_obs_date, abundance_model="coronal"
)
actual_temperature_response = instance.temperature_response()

atol = actual_temperature_response.value.max() * 0.013
assert allclose(
actual_temperature_response.value, IDL_temperature_response, rtol=1e-6
actual_temperature_response.value,
IDL_temperature_response,
rtol=0.028,
atol=atol,
)
7 changes: 5 additions & 2 deletions xrtpy/response/tests/test_temperature_response_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def test_temperature_response(filename, allclose):
filter_name, filter_obs_date, abundance_model="hybrid"
)
actual_temperature_response = instance.temperature_response()

atol = actual_temperature_response.value.max() * 0.013
assert allclose(
actual_temperature_response.value, IDL_temperature_response, rtol=1e-6
actual_temperature_response.value,
IDL_temperature_response,
rtol=0.028,
atol=atol,
)
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def test_temperature_response(filename, allclose):
filter_name, filter_obs_date, abundance_model="photospheric"
)
actual_temperature_response = instance.temperature_response()

atol = actual_temperature_response.value.max() * 0.013
assert allclose(
actual_temperature_response.value, IDL_temperature_response, rtol=1e-6
actual_temperature_response.value,
IDL_temperature_response,
rtol=0.028,
atol=atol,
)

0 comments on commit 0c53725

Please sign in to comment.