From 6c2cc0725dfabd807d40c13f6adcbde3ff82af3c Mon Sep 17 00:00:00 2001 From: Marco Sertoli Date: Sat, 28 Oct 2023 02:11:58 +0100 Subject: [PATCH] Residuals must be residuals, with a sign --- indica/operators/spline_fit_easy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indica/operators/spline_fit_easy.py b/indica/operators/spline_fit_easy.py index d514abd3..a9e1520b 100644 --- a/indica/operators/spline_fit_easy.py +++ b/indica/operators/spline_fit_easy.py @@ -29,8 +29,7 @@ def residuals(yknots): bc_type=bc_type, ) bckc = np.interp(x, xspl, spline(xspl)) - residuals = np.sqrt((y - bckc) ** 2 / err**2) - return residuals + return (y - bckc) / err yspl = xr.DataArray( np.empty((len(xspl), len(ydata.t))),