[bugfix] a lot of different bugfixes
This commit is contained in:
parent
039f98a811
commit
2554534759
@ -68,6 +68,7 @@ def autopickevent(data, param, iplot=0, fig_dict=None, ncores=0, metadata=None,
|
||||
pool.close()
|
||||
|
||||
for pick in result:
|
||||
if pick:
|
||||
station = pick['station']
|
||||
pick.pop('station')
|
||||
all_onsets[station] = pick
|
||||
@ -206,13 +207,14 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
||||
if len(ndat) == 0: # check for other components
|
||||
ndat = wfstream.select(component="1")
|
||||
|
||||
|
||||
wfstart, wfend = full_range(wfstream)
|
||||
if not zdat:
|
||||
print('No z-component found for station {}. STOP'.format(wfstream[0].stats.station))
|
||||
return
|
||||
|
||||
if algoP == 'HOS' or algoP == 'ARZ' and zdat is not None:
|
||||
msg = '##################################################\nautopickstation:' \
|
||||
' Working on P onset of station {station}\nFiltering vertical ' \
|
||||
'trace ...\n{data}'.format(station=zdat[0].stats.station,
|
||||
'trace ...\n{data}'.format(station=wfstream[0].stats.station,
|
||||
data=str(zdat))
|
||||
if verbose: print(msg)
|
||||
z_copy = zdat.copy()
|
||||
@ -972,14 +974,16 @@ def autopickstation(wfstream, pickparam, verbose=False,
|
||||
else:
|
||||
# dummy values (start of seismic trace) in order to derive
|
||||
# theoretical onset times for iteratve picking
|
||||
try:
|
||||
if edat:
|
||||
lpickS = edat[0].stats.starttime + timeerrorsS[3]
|
||||
epickS = edat[0].stats.starttime - timeerrorsS[3]
|
||||
mpickS = edat[0].stats.starttime
|
||||
except:
|
||||
elif ndat:
|
||||
lpickS = ndat[0].stats.starttime + timeerrorsS[3]
|
||||
epickS = ndat[0].stats.starttime - timeerrorsS[3]
|
||||
mpickS = ndat[0].stats.starttime
|
||||
else:
|
||||
return
|
||||
|
||||
# create dictionary
|
||||
# for P phase
|
||||
|
@ -244,7 +244,11 @@ class AICPicker(AutoPicker):
|
||||
& (self.Tcf >= self.Pick))
|
||||
# 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[0][0]:islope[0][len(islope[0])-1]])
|
||||
dataslope = self.Data[0].data[islope[0][0]:islope[0][len(islope[0]) - 1]]
|
||||
if len(dataslope) < 1:
|
||||
print('No data in slope window found!')
|
||||
return
|
||||
imax = np.argmax(dataslope)
|
||||
iislope = islope[0][0:imax+1]
|
||||
if len(iislope) <= 2:
|
||||
# calculate slope from initial onset to maximum of AIC function
|
||||
|
@ -228,6 +228,10 @@ def fmpicker(Xraw, Xfilt, pickwin, Pick, iplot=0, fig=None):
|
||||
if len(zc1) == 3:
|
||||
break
|
||||
|
||||
if len(zc1) < 3:
|
||||
print('fmpicker: Could not determine zero crossings!')
|
||||
return
|
||||
|
||||
# if time difference betweeen 1st and 2cnd zero crossing
|
||||
# is too short, get time difference between 1st and 3rd
|
||||
# to derive maximum
|
||||
|
Loading…
Reference in New Issue
Block a user