From 039f98a811cedad061478677a2966babeb1a75e1 Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 11 Aug 2017 15:01:32 +0200 Subject: [PATCH] [add] check for nsamples and negative slope of cf --- pylot/core/pick/autopick.py | 2 +- pylot/core/pick/picker.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 1c06bd7c..25a781b2 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -24,7 +24,7 @@ from pylot.core.util.utils import getPatternLine, gen_Pool, identifyPhase, loopI from obspy.taup import TauPyModel -def autopickevent(data, param, iplot=0, fig_dict=None, ncores=1, metadata=None, origin=None): +def autopickevent(data, param, iplot=0, fig_dict=None, ncores=0, metadata=None, origin=None): stations = [] all_onsets = {} input_tuples = [] diff --git a/pylot/core/pick/picker.py b/pylot/core/pick/picker.py index 67b114ce..f89d0036 100644 --- a/pylot/core/pick/picker.py +++ b/pylot/core/pick/picker.py @@ -397,8 +397,14 @@ class PragPicker(AutoPicker): # prominent trend: decrease aus # flat: use given aus cfdiff = np.diff(cfipick) + if len(cfdiff)<20: + print('PragPicker: Very few samples for CF. Check LTA window dimensions!') i0diff = np.where(cfdiff > 0) cfdiff = cfdiff[i0diff] + if len(cfdiff)<1: + print('PragPicker: Negative slope for CF. Check LTA window dimensions! STOP') + self.Pick = None + return minaus = min(cfdiff * (1 + self.aus)) aus1 = max([minaus, self.aus])