Describe the bug
ts.minima() argument "threshold" does not work as intended for negative thresholds
To Reproduce
Steps to reproduce the behavior:
from qats import TimeSeries
import numpy as np
t = np.array(range(2000))/2
x = np.cos(t/35*np.pi+0.1)*15 + np.cos(t/100*np.pi)*20 + np.cos(t/178*np.pi)*20 - 8
ts = TimeSeries('test', t, x)
print('Count all minima: ', len(ts.minima()))
print('Count all minima below -40: ', len(ts.minima(threshold=-40.)))
print('Count all minima below +40: ', len(ts.minima(threshold=40.)))
out:
Count all minima: 8
Count all minima below -40: 8
Count all minima below +40: 3
Expected behavior
threshold=-40. should give 3, threshold=40. should give 8
Describe the bug ts.minima() argument "threshold" does not work as intended for negative thresholds
To Reproduce Steps to reproduce the behavior:
out:
Expected behavior threshold=-40. should give 3, threshold=40. should give 8