Update fit2.py

fit needs at least 3 points to work properly, this should not fail again in case of extremely slim peaks
This commit is contained in:
JakHolzer 2020-09-25 09:12:00 +02:00 committed by GitHub
parent e5e824eb4c
commit 52571a1aca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(