baseline method crashes if input array is all negative

Issue #23 resolved
Former user created an issue

I've found that when I run peakutils.baseline(df) on a df with all values negative, I get a math error:

/Users/jmason86/anaconda/envs/py36/lib/python3.6/site-packages/PeakUtils-1.1.0-py3.6.egg/peakutils/baseline.py in baseline(y, deg, max_it, tol) 44 45 # try to avoid numerical issues ---> 46 cond = math.pow(y.max(), 1. / order) 47 x = np.linspace(0., cond, y.size) 48 base = y.copy()

ValueError: math domain error

If I arbitrarily make one of the values in df positive 1, the error goes away.

Comments (1)

  1. Log in to comment