Skip to content

Commit

Permalink
replace extra condition with mask
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Oct 10, 2024
1 parent 8a145a3 commit 20f46d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tardis/plasma/properties/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,9 @@ def exp1_times_exp(x):
Output array.
"""
x = np.asarray(x)
f = exp1(x) * np.exp(x, where=x <= 500)
# Use Laurent series for large values to avoid infinite exponential
mask = x > 500
f = exp1(x) * np.exp(x * (~mask))
# Use Laurent series for large values to avoid infinite exponential
f[mask] = (x**-1 - x**-2 + 2 * x**-3 - 6 * x**-4)[mask]
return f

Expand Down

0 comments on commit 20f46d1

Please sign in to comment.