From 55e48965fa90f639142288f626435ba7fe192e6b Mon Sep 17 00:00:00 2001 From: mer0m Date: Mon, 13 Feb 2017 11:26:15 +0100 Subject: [PATCH] abs --- fit_waist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fit_waist.py b/fit_waist.py index a7d7df9..6206f00 100644 --- a/fit_waist.py +++ b/fit_waist.py @@ -24,7 +24,7 @@ for f in files: '''optimization with non-linear least squares method''' Ppopt, Pcov = curve_fit(P, xmes, Pmes) - data_waist.append([int(f[-7:-4]), Ppopt[3]]) + data_waist.append([int(f[-7:-4]), abs(Ppopt[3])]) '''plot''' p[0].plot(xmes, Pmes, 'o') @@ -49,4 +49,4 @@ p[1].plot(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), W(numpy.linspa p[1].plot(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), -W(numpy.linspace(data_waist[0,0], data_waist[-1,0], 100), *popt), 'r') p[1].grid() -plt.show() \ No newline at end of file +plt.show() -- 2.16.4