From 1ed4f73e5cff054e69170f634bc695ab3e4ce753 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Thu, 10 Aug 2017 11:04:46 +0200 Subject: [PATCH 1/3] [bugfix] darius: comparison of P-pick slope to minAIC-S-slope instead of S-pick slope --- pylot/core/pick/autopick.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 485cc664..7162bcd0 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -580,7 +580,7 @@ def autopickstation(wfstream, pickparam, verbose=False, aictsmoothS, fig=fig) ############################################################### # go on with processing if AIC onset passes quality control - slope = aicpick.getSlope() + slope = aicarhpick.getSlope() if not slope: slope = 0 if (slope >= minAICSslope and From 8a80af78cfa3e9924bac80bbc260c284e2a56b43 Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 10 Aug 2017 12:00:43 +0200 Subject: [PATCH 2/3] [bugfix] use z-trace starttime instead of full_range --- pylot/core/pick/autopick.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 40b8a39d..6c4da6e3 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -244,12 +244,15 @@ def autopickstation(wfstream, pickparam, verbose=False, # get first P and S onsets from arrivals list arrP, estFirstP = min([(arr, arr.time) for arr in phases['P']], key = lambda t: t[1]) arrS, estFirstS = min([(arr, arr.time) for arr in phases['S']], key = lambda t: t[1]) - print('autopick: estimated first arrivals for P: {}, S:{} using TauPy'.format(estFirstP, estFirstS)) + print('autopick: estimated first arrivals for P: {} s, S:{} s after event' + ' origin time using TauPy'.format(estFirstP, estFirstS)) # modifiy pstart and pstop relative to estimated first P arrival (relative to station time axis) - pstart += (source_origin.time + estFirstP) - wfstart - pstop += (source_origin.time + estFirstP) - wfstart + pstart += (source_origin.time + estFirstP) - zdat[0].stats.starttime + pstop += (source_origin.time + estFirstP) - zdat[0].stats.starttime Lc = pstop - pstart + print('autopick: CF calculation times respectively:' + ' pstart: {} s, pstop: {} s'.format(pstart, pstop)) else: print('No source origins given!') From 2cc05329f92742615a571a7157acb3122f2d4a05 Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 10 Aug 2017 12:25:03 +0200 Subject: [PATCH 3/3] [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