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')