From 9e5b3f69165a9b4848fdedaf60fdcfdf6809b5be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Thu, 27 Oct 2016 16:06:45 +0200 Subject: [PATCH] Bugfix in fitSourceModel: Be sure, to set trial window aroun initial corner frequency within available data. --- pylot/core/analysis/magnitude.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylot/core/analysis/magnitude.py b/pylot/core/analysis/magnitude.py index d0fdbac1..f0c5cff1 100644 --- a/pylot/core/analysis/magnitude.py +++ b/pylot/core/analysis/magnitude.py @@ -628,12 +628,13 @@ def fitSourceModel(f, S, fc0, iplot, verbosity=False): STD = [] # get window around initial corner frequency for trials # left side of initial corner frequency - fcstopl = fc0 - max(1, fc0 / 2) + fcstopl = max(f[0], fc0 - max(1, fc0 / 2)) il = np.where(f <= fcstopl) il = il[0][np.size(il) - 1] # right side of initial corner frequency - fcstopr = fc0 + (fc0 / 2) + fcstopr = min(fc0 + (fc0 / 2), f[len(f) - 1]) ir = np.where(f >= fcstopr) + print fcstopl, fcstopr # check, if fcstopr is available if np.size(ir) == 0: fcstopr = fc0