Skip to content

Commit

Permalink
fix(analysis.image): dtype safety of cfunc
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Apr 8, 2024
1 parent a8df0f3 commit b4f9b17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/erlab/analysis/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def minimum_gradient(
dx = xvals[1] - xvals[0]
dy = yvals[1] - yvals[0]

grad = gradient_magnitude(darr.values, dx, dy, mode=mode, cval=cval)
grad = gradient_magnitude(
darr.values.astype(np.float64), dx, dy, mode=mode, cval=cval
)
grad[grad == 0] = np.nan
return darr / grad

0 comments on commit b4f9b17

Please sign in to comment.