Skip to content

Commit 943cca3

Browse files
sichinagafandreuz
andauthored
Added Francesco feedback
Co-authored-by: Francesco Andreuzzi <[email protected]>
1 parent 7629921 commit 943cca3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydmd/havok.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ def compute_threshold(
564564
if isinstance(p, int):
565565
# Use Gaussian intersection.
566566
a = gauss - hy
567-
ind_signchange = np.where(np.sign(a[:-1]) - np.sign(a[1:]) != 0)[0]
567+
sgn = np.sign(a)
568+
ind_signchange = np.where(sgn(a[:-1]) * sgn(a[1:]) > 0)[0]
568569
thres_1 = np.abs(hx[ind_signchange])
569570
thres_2 = np.abs(hx[ind_signchange + 1])
570571
threshold_candidates = np.sort(0.5 * (thres_1 + thres_2))

0 commit comments

Comments
 (0)