We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7629921 commit 943cca3Copy full SHA for 943cca3
pydmd/havok.py
@@ -564,7 +564,8 @@ def compute_threshold(
564
if isinstance(p, int):
565
# Use Gaussian intersection.
566
a = gauss - hy
567
- ind_signchange = np.where(np.sign(a[:-1]) - np.sign(a[1:]) != 0)[0]
+ sgn = np.sign(a)
568
+ ind_signchange = np.where(sgn(a[:-1]) * sgn(a[1:]) > 0)[0]
569
thres_1 = np.abs(hx[ind_signchange])
570
thres_2 = np.abs(hx[ind_signchange + 1])
571
threshold_candidates = np.sort(0.5 * (thres_1 + thres_2))
0 commit comments