Skip to content

Commit

Permalink
add warning for nan or inf alphas
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshields committed Nov 1, 2023
1 parent 46972eb commit a1f40c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions stardis/plasma/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,10 @@ def calculate(
ALPHA_COEFFICIENT * n_lower * linelist.f_lu.values * emission_correction.T
)

###TODO - include warning for missing values.
# if np.any(np.isnan(alpha)) or np.any(np.isinf(np.abs(alpha))):
# raise ValueError(
# "Some alpha_line are nan, inf, -inf " " Something went wrong!"
# )
if np.any(np.isnan(alpha)) or np.any(np.isinf(np.abs(alpha))):
raise ValueError(
"Some alpha_line from vald are nan, inf, -inf " " Something went wrong!"
)

df = pd.DataFrame(
alpha.T,
Expand Down

0 comments on commit a1f40c8

Please sign in to comment.