Skip to content

Commit

Permalink
reverse the change and raise error on T_rad instead
Browse files Browse the repository at this point in the history
  • Loading branch information
DeerWhale committed Feb 21, 2024
1 parent 178d15b commit f912b4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions tardis/model/parse_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,11 @@ def parse_csvy_radiation_field_state(
geometry, packet_source
)

if np.any(t_radiative < 1000 * u.K):
raise ValueError(
f"Radiative temperature is too low in shell {np.argmin(t_radiative)} (T_rad = {t_radiative[np.argmin(t_radiative)]})"
)

if hasattr(csvy_model_data, "columns") and (
"dilution_factor" in csvy_model_data.columns
):
Expand Down
6 changes: 2 additions & 4 deletions tardis/plasma/properties/helium_nlte.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ def calculate_helium_one(
* (1.0 / (2 * float(g.loc[2, 1, 0])))
* (1 / g_electron)
* (1 / (w**2.0))
* np.minimum(
np.exp(ionization_data.loc[2, 1] * beta_rad),
np.finfo(np.float64).max,
) # Prevents overflow
* np.exp(ionization_data.loc[2, 1] * beta_rad)
)
)

@staticmethod
Expand Down

0 comments on commit f912b4d

Please sign in to comment.