From 533ccc7b5c383d4fd6139f2bc9b12e38d532444d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20K=C3=BCperkoch?= Date: Fri, 28 Aug 2015 11:29:00 +0200 Subject: [PATCH] Implemented new class wapp to calculate Wood-Anderson amplitudes for local magnitude calculation. Before calculating Wood-Anderson amplitude the certain traces are instrument corrected. --- pylot/core/pick/autopick.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 3c074a7d..7113d90a 100755 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -15,6 +15,8 @@ from pylot.core.pick.Picker import AICPicker, PragPicker from pylot.core.pick.CharFuns import HOScf, AICcf, ARZcf, ARHcf, AR3Ccf from pylot.core.pick.utils import checksignallength, checkZ4S, earllatepicker,\ getSNR, fmpicker, checkPonsets, wadaticheck +from pylot.core.read.data import Data +from pylot.core.analysis.magnitude import WApp def autopickevent(data, param): stations = [] @@ -109,6 +111,8 @@ def autopickstation(wfstream, pickparam): nfacsl = pickparam.getParam('noisefactor') # parameter to check for spuriously picked S onset zfac = pickparam.getParam('zfac') + # path to inventory-, dataless- or resp-files + invdir = pickparam.getParam('invdir') # initialize output Pweight = 4 # weight for P onset @@ -132,6 +136,7 @@ def autopickstation(wfstream, pickparam): Pflag = 0 Sflag = 0 Pmarker = [] + Ao = None # split components zdat = wfstream.select(component="Z") @@ -501,6 +506,20 @@ def autopickstation(wfstream, pickparam): print 'autopickstation: S-weight: %d, SNR: %f, SNR[dB]: %f' % ( Sweight, SNRS, SNRSdB) + ################################################################## + # get Wood-Anderson peak-to-peak amplitude + print "################################################" + # initialize Data object + data = Data() + # re-create stream object including both horizontal components + hdat = edat.copy() + hdat += ndat + h_copy = hdat.copy() + cordat = data.restituteWFData(invdir, h_copy) + # calculate WA-peak-to-peak amplitude + # using subclass WApp of superclass Magnitude + wapp = WApp(cordat, mpickS, 10, iplot) + Ao = wapp.getwapp() else: print 'Bad initial (AIC) S-pick, skipping this onset!' @@ -509,6 +528,21 @@ def autopickstation(wfstream, pickparam): print '(min. AIC-SNR=', minAICSSNR, ', min. AIC-Slope=', \ minAICSslope, 'counts/s)' + ############################################################ + # get Wood-Anderson peak-to-peak amplitude + print "################################################" + # initialize Data object + data = Data() + # re-create stream object including both horizontal components + hdat = edat.copy() + hdat += ndat + h_copy = hdat.copy() + cordat = data.restituteWFData(invdir, h_copy) + # calculate WA-peak-to-peak amplitude + # using subclass WApp of superclass Magnitude + wapp = WApp(cordat, mpickP, 20, iplot) + Ao = wapp.getwapp() + else: print 'autopickstation: No horizontal component data available or ' \ 'bad P onset, skipping S picking!' @@ -693,5 +727,7 @@ def autopickstation(wfstream, pickparam): phasepick = {'lpp': lpickS, 'epp': epickS, 'mpp': mpickS, 'spe': Serror, \ 'snr': SNRS, 'snrdb': SNRSdB, 'weight': Sweight, 'fm': None} picks[phase] = phasepick + # add Wood-Anderson amplitude + picks[phase]['Ao'] = Ao return picks