From d7abd3bef98c7a5f64baa1d8f655937c3a1dcd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Wed, 31 May 2017 11:41:24 +0200 Subject: [PATCH] Stabilized slope determination. --- pylot/core/pick/picker.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pylot/core/pick/picker.py b/pylot/core/pick/picker.py index b2c34813..b268c7bb 100644 --- a/pylot/core/pick/picker.py +++ b/pylot/core/pick/picker.py @@ -240,7 +240,15 @@ class AICPicker(AutoPicker): ax.set_yticks([]) ax.set_title(self.Data[0].stats.station) return + islope = islope[0][0:imax] + if len(islope) < 2: + # get local maximum of AIC function to calculate properly slope + islope = np.where((self.Tcf <= min([self.Pick + tslope, len(self.Data[0].data)])) \ + & (self.Tcf >= self.Pick)) + imax = np.argmax(aicsmooth[islope]) + islope = islope[0][0:imax] + dataslope = self.Data[0].data[islope] # calculate slope as polynomal fit of order 1 xslope = np.arange(0, len(dataslope), 1)