Modified checking of signal length, uses RMS trace of all components now (if available).

This commit is contained in:
Ludger Küperkoch 2015-09-04 11:13:52 +02:00
parent 0dc1091078
commit de608798b9

View File

@ -41,9 +41,9 @@ def autopickevent(data, param):
# quality control # quality control
# median check and jackknife on P-onset times # median check and jackknife on P-onset times
jk_checked_onsets = checkPonsets(all_onsets, mdttolerance, 2) jk_checked_onsets = checkPonsets(all_onsets, mdttolerance, iplot)
# check S-P times (Wadati) # check S-P times (Wadati)
return wadaticheck(jk_checked_onsets, wdttolerance, 2) return wadaticheck(jk_checked_onsets, wdttolerance, iplot)
def autopickstation(wfstream, pickparam): def autopickstation(wfstream, pickparam):
""" """
@ -196,10 +196,36 @@ def autopickstation(wfstream, pickparam):
############################################################## ##############################################################
if aicpick.getpick() is not None: if aicpick.getpick() is not None:
# check signal length to detect spuriously picked noise peaks # check signal length to detect spuriously picked noise peaks
# use all available components to avoid skipping correct picks
# on vertical traces with weak P coda
z_copy[0].data = tr_filt.data z_copy[0].data = tr_filt.data
Pflag = checksignallength(z_copy, aicpick.getpick(), tsnrz, zne = z_copy
minsiglength, \ if len(ndat) == 0 or len(edat) == 0:
nfacsl, minpercent, iplot) print ("One or more horizontal components missing!")
print ("Signal length only checked on vertical component!")
print ("Decreasing minsiglengh from %f to %f" \
% (minsiglength, minsiglength / 2))
Pflag = checksignallength(zne, aicpick.getpick(), tsnrz,
minsiglength / 2, \
nfacsl, minpercent, iplot)
else:
# filter and taper horizontal traces
trH1_filt = edat.copy()
trH2_filt = ndat.copy()
trH1_filt.filter('bandpass', freqmin=bph1[0],
freqmax=bph1[1], \
zerophase=False)
trH2_filt.filter('bandpass', freqmin=bph1[0],
freqmax=bph1[1], \
zerophase=False)
trH1_filt.taper(max_percentage=0.05, type='hann')
trH2_filt.taper(max_percentage=0.05, type='hann')
zne += trH1_filt
zne += trH2_filt
Pflag = checksignallength(zne, aicpick.getpick(), tsnrz,
minsiglength, \
nfacsl, minpercent, iplot)
if Pflag == 1: if Pflag == 1:
# check for spuriously picked S onset # check for spuriously picked S onset
# both horizontal traces needed # both horizontal traces needed
@ -207,20 +233,6 @@ def autopickstation(wfstream, pickparam):
print 'One or more horizontal components missing!' print 'One or more horizontal components missing!'
print 'Skipping control function checkZ4S.' print 'Skipping control function checkZ4S.'
else: else:
# filter and taper horizontal traces
trH1_filt = edat.copy()
trH2_filt = ndat.copy()
trH1_filt.filter('bandpass', freqmin=bph1[0],
freqmax=bph1[1], \
zerophase=False)
trH2_filt.filter('bandpass', freqmin=bph1[0],
freqmax=bph1[1], \
zerophase=False)
trH1_filt.taper(max_percentage=0.05, type='hann')
trH2_filt.taper(max_percentage=0.05, type='hann')
zne = z_copy
zne += trH1_filt
zne += trH2_filt
Pflag = checkZ4S(zne, aicpick.getpick(), zfac, \ Pflag = checkZ4S(zne, aicpick.getpick(), zfac, \
tsnrz[3], iplot) tsnrz[3], iplot)
if Pflag == 0: if Pflag == 0:
@ -515,18 +527,19 @@ def autopickstation(wfstream, pickparam):
hdat = edat.copy() hdat = edat.copy()
hdat += ndat hdat += ndat
h_copy = hdat.copy() h_copy = hdat.copy()
cordat = data.restituteWFData(invdir, h_copy) [cordat, restflag] = data.restituteWFData(invdir, h_copy)
# calculate WA-peak-to-peak amplitude # calculate WA-peak-to-peak amplitude
# using subclass WApp of superclass Magnitude # using subclass WApp of superclass Magnitude
if Sweight < 4: if restflag == 1:
wapp = WApp(cordat, mpickS, mpickP + sstop, iplot) if Sweight < 4:
else: wapp = WApp(cordat, mpickS, mpickP + sstop, iplot)
# use larger window for getting peak-to-peak amplitude else:
# as the S pick is quite unsure # use larger window for getting peak-to-peak amplitude
wapp = WApp(cordat, mpickP, mpickP + sstop + \ # as the S pick is quite unsure
(0.5 * (mpickP + sstop)), iplot) wapp = WApp(cordat, mpickP, mpickP + sstop + \
(0.5 * (mpickP + sstop)), iplot)
Ao = wapp.getwapp() Ao = wapp.getwapp()
else: else:
print 'Bad initial (AIC) S-pick, skipping this onset!' print 'Bad initial (AIC) S-pick, skipping this onset!'
@ -544,12 +557,13 @@ def autopickstation(wfstream, pickparam):
hdat = edat.copy() hdat = edat.copy()
hdat += ndat hdat += ndat
h_copy = hdat.copy() h_copy = hdat.copy()
cordat = data.restituteWFData(invdir, h_copy) [cordat, restflag] = data.restituteWFData(invdir, h_copy)
# calculate WA-peak-to-peak amplitude if restflag == 1:
# using subclass WApp of superclass Magnitude # calculate WA-peak-to-peak amplitude
wapp = WApp(cordat, mpickP, mpickP + sstop + (0.5 * (mpickP \ # using subclass WApp of superclass Magnitude
+ sstop)), iplot) wapp = WApp(cordat, mpickP, mpickP + sstop + (0.5 * (mpickP \
Ao = wapp.getwapp() + sstop)), iplot)
Ao = wapp.getwapp()
else: else:
print 'autopickstation: No horizontal component data available or ' \ print 'autopickstation: No horizontal component data available or ' \