Merge branch 'develop' of ariadne.geophysik.rub.de:/data/git/pylot into develop

This commit is contained in:
Ludger Küperkoch 2017-08-10 12:47:08 +02:00
commit 726c823646
2 changed files with 10 additions and 7 deletions

View File

@ -244,12 +244,15 @@ def autopickstation(wfstream, pickparam, verbose=False,
# get first P and S onsets from arrivals list # 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]) 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]) 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) # modifiy pstart and pstop relative to estimated first P arrival (relative to station time axis)
pstart += (source_origin.time + estFirstP) - wfstart pstart += (source_origin.time + estFirstP) - zdat[0].stats.starttime
pstop += (source_origin.time + estFirstP) - wfstart pstop += (source_origin.time + estFirstP) - zdat[0].stats.starttime
Lc = pstop - pstart Lc = pstop - pstart
print('autopick: CF calculation times respectively:'
' pstart: {} s, pstop: {} s'.format(pstart, pstop))
else: else:
print('No source origins given!') print('No source origins given!')
@ -580,7 +583,7 @@ def autopickstation(wfstream, pickparam, verbose=False,
aictsmoothS, fig=fig) aictsmoothS, fig=fig)
############################################################### ###############################################################
# go on with processing if AIC onset passes quality control # go on with processing if AIC onset passes quality control
slope = aicpick.getSlope() slope = aicarhpick.getSlope()
if not slope: if not slope:
slope = 0 slope = 0
if (slope >= minAICSslope and if (slope >= minAICSslope and

View File

@ -243,7 +243,7 @@ class AICPicker(AutoPicker):
# find maximum within slope determination window # find maximum within slope determination window
# 'cause slope should be calculated up to first local minimum only! # 'cause slope should be calculated up to first local minimum only!
imax = np.argmax(self.Data[0].data[islope]) imax = np.argmax(self.Data[0].data[islope])
iislope = islope[0][0:imax] iislope = islope[0][0:imax+1]
if len(iislope) <= 2: if len(iislope) <= 2:
# calculate slope from initial onset to maximum of AIC function # calculate slope from initial onset to maximum of AIC function
print("AICPicker: Not enough data samples left for slope calculation!") print("AICPicker: Not enough data samples left for slope calculation!")
@ -271,7 +271,7 @@ class AICPicker(AutoPicker):
raw_input() raw_input()
plt.close(fig) plt.close(fig)
return return
iislope = islope[0][0:imax] iislope = islope[0][0:imax+1]
dataslope = self.Data[0].data[iislope] dataslope = self.Data[0].data[iislope]
# calculate slope as polynomal fit of order 1 # calculate slope as polynomal fit of order 1
xslope = np.arange(0, len(dataslope), 1) xslope = np.arange(0, len(dataslope), 1)
@ -280,7 +280,7 @@ class AICPicker(AutoPicker):
if datafit[0] >= datafit[len(datafit) - 1]: if datafit[0] >= datafit[len(datafit) - 1]:
print('AICPicker: Negative slope, bad onset skipped!') print('AICPicker: Negative slope, bad onset skipped!')
return return
self.slope = 1 / tslope * (datafit[len(dataslope) - 1] - datafit[0]) self.slope = 1 / len(dataslope) * (datafit[len(dataslope) - 1] - datafit[0])
else: else:
self.SNR = None self.SNR = None