From 52571a1aca48b4b4f5cf7e5b5ed6e2b39388dbdc Mon Sep 17 00:00:00 2001 From: JakHolzer <53743814+JakHolzer@users.noreply.github.com> Date: Fri, 25 Sep 2020 09:12:00 +0200 Subject: [PATCH] Update fit2.py fit needs at least 3 points to work properly, this should not fail again in case of extremely slim peaks --- pyzebra/fit2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyzebra/fit2.py b/pyzebra/fit2.py index 51ed99d..fd55659 100644 --- a/pyzebra/fit2.py +++ b/pyzebra/fit2.py @@ -158,7 +158,7 @@ def fitccl( numfit_max = gauss_3sigmamax if numfit_max is None else find_nearest(x, numfit_max) it = -1 - while numfit_max == numfit_min: + while abs(numfit_max - numfit_min) < 3: # in the case the peak is very thin and numerical integration would be on zero omega difference, finds closes values it = it + 1 numfit_min = find_nearest(