From f808f4392a5680ed0808eeae115f3708c4f6745f Mon Sep 17 00:00:00 2001 From: bma Date: Thu, 8 Feb 2018 07:14:33 +0100 Subject: [PATCH] use more robust trf method instead lms --- fit_waist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fit_waist.py b/fit_waist.py index e708bbd..b099e2d 100755 --- a/fit_waist.py +++ b/fit_waist.py @@ -23,8 +23,8 @@ for f in files: Pmes = data[:,1] '''optimization with non-linear least squares method''' - Ppopt, Pcov = curve_fit(P, xmes, Pmes) - data_waist.append([int(f[-7:-4]), abs(Ppopt[3])]) + Ppopt, Pcov = curve_fit(P, xmes, Pmes, method = 'trf') + data_waist.append([int(f[-7:-4]), Ppopt[3]]) '''plot''' p[0].plot(xmes, Pmes, 'o') -- 2.16.4