diff --git a/src/diffpy/srmise/baselines/polynomial.py b/src/diffpy/srmise/baselines/polynomial.py index 0f4f877..6ec155e 100644 --- a/src/diffpy/srmise/baselines/polynomial.py +++ b/src/diffpy/srmise/baselines/polynomial.py @@ -105,7 +105,7 @@ def estimate_parameters(self, r, y): import numpy.linalg as la a = np.array([r[cut_idx]]).T - slope = la.lstsq(a, y[cut_idx])[0][0] + slope = la.lstsq(a, y[cut_idx], rcond=-1)[0][0] return np.array([slope, 0.0]) except Exception as e: emsg = "Error during estimation -- " + str(e) @@ -256,4 +256,5 @@ def getmodule(self): y = -r + 10 * np.exp(-((r - 5) ** 2)) + np.random.rand(len(r)) est = f.estimate_parameters(r, y) print("Actual baseline: ", np.array([-1, 0.0])) + # TODO: Make test est baseline in ways of tolerance function print("Estimated baseline: ", est)