Skip to content

Commit

Permalink
prevent float overflow when calculating He I population (#2522)
Browse files Browse the repository at this point in the history
* prevent float overflow when calculating He I population

* reverse the change and raise error on T_rad instead

* delete extra )

* update the error message

* removing extra comma in text

* change value error to warning instead

* changed warning to logging.warn

* change to critical and capitalize TARDIS
  • Loading branch information
DeerWhale authored Mar 8, 2024
1 parent e2d1c96 commit 39c128a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tardis/model/parse_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,13 @@ def parse_csvy_radiation_field_state(
geometry, packet_source
)

if np.any(t_radiative < 1000 * u.K):
logging.critical(
"Radiative temperature is too low in some of the shells, temperatures below 1000K "
f"(e.g., T_rad = {t_radiative[np.argmin(t_radiative)]} in shell {np.argmin(t_radiative)} in your model) "
"are not accurately handled by TARDIS.",
)

if hasattr(csvy_model_data, "columns") and (
"dilution_factor" in csvy_model_data.columns
):
Expand Down

0 comments on commit 39c128a

Please sign in to comment.