Skip to content

Commit

Permalink
small tweak in _lin_interp
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb32 committed Nov 2, 2024
1 parent 0e95307 commit b4a754e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sup3r/utilities/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def get_level_masks(cls, lev_array, level):
def _lin_interp(cls, lev_samps, var_samps, level):
"""Linearly interpolate between levels."""
diff = lev_samps[1] - lev_samps[0]
alpha = (level - lev_samps[0]) / diff
alpha = da.where(diff == 0, 0, alpha)
alpha = da.where(diff == 0, 0, (level - lev_samps[0]) / diff)
return var_samps[0] * (1 - alpha) + var_samps[1] * alpha

@classmethod
Expand Down

0 comments on commit b4a754e

Please sign in to comment.