From 2cc05329f92742615a571a7157acb3122f2d4a05 Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 10 Aug 2017 12:25:03 +0200 Subject: [PATCH] [bugfix] huge bug in slope calculation --- pylot/core/pick/picker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pylot/core/pick/picker.py b/pylot/core/pick/picker.py index c72f1f60..c7131bb5 100644 --- a/pylot/core/pick/picker.py +++ b/pylot/core/pick/picker.py @@ -241,7 +241,7 @@ class AICPicker(AutoPicker): # find maximum within slope determination window # 'cause slope should be calculated up to first local minimum only! imax = np.argmax(self.Data[0].data[islope]) - iislope = islope[0][0:imax] + iislope = islope[0][0:imax+1] if len(iislope) <= 2: # calculate slope from initial onset to maximum of AIC function print("AICPicker: Not enough data samples left for slope calculation!") @@ -269,7 +269,7 @@ class AICPicker(AutoPicker): raw_input() plt.close(fig) return - iislope = islope[0][0:imax] + iislope = islope[0][0:imax+1] dataslope = self.Data[0].data[iislope] # calculate slope as polynomal fit of order 1 xslope = np.arange(0, len(dataslope), 1) @@ -278,7 +278,7 @@ class AICPicker(AutoPicker): if datafit[0] >= datafit[len(datafit) - 1]: print('AICPicker: Negative slope, bad onset skipped!') return - self.slope = 1 / tslope * (datafit[len(dataslope) - 1] - datafit[0]) + self.slope = 1 / len(dataslope) * (datafit[len(dataslope) - 1] - datafit[0]) else: self.SNR = None