From 31d56cb28773506758c03efb69a18671a9565f7f Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Wed, 23 Mar 2016 11:48:58 +0100 Subject: [PATCH] [edit] introducing picker tag New tag introduced to distinguish between pickers (either person's or programs name) --- pylot/core/pick/autopick.py | 22 ++++++++-------------- pylot/core/read/data.py | 2 ++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 396e4232..a1f9fd28 100755 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -144,6 +144,7 @@ def autopickstation(wfstream, pickparam, verbose=False): Sflag = 0 Pmarker = [] Ao = None # Wood-Anderson peak-to-peak amplitude + picker = 'autoPyLoT' # name of the picking programm # split components zdat = wfstream.select(component="Z") @@ -796,21 +797,14 @@ def autopickstation(wfstream, pickparam, verbose=False): # create dictionary # for P phase - phase = 'P' - phasepick = {'lpp': lpickP, 'epp': epickP, 'mpp': mpickP, 'spe': Perror, - 'snr': SNRP, 'snrdb': SNRPdB, 'weight': Pweight, 'fm': FM, - 'w0': None, 'fc': None, 'Mo': None, 'Mw': None} - picks = {phase: phasepick} - # add P marker - picks[phase]['marked'] = Pmarker + ppick = dict(lpp=lpickP, epp=epickP, mpp=mpickP, spe=Perror, snr=SNRP, + snrdb=SNRPdB, weight=Pweight, fm=FM, w0=None, fc=None, Mo=None, + Mw=None, picker=picker, marked=Pmarker) # add S phase - phase = 'S' - 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 - + spick = dict(lpp=lpickS, epp=epickS, mpp=mpickS, spe=Serror, snr=SNRS, + snrdb=SNRSdB, weight=Sweight, fm=None, picker=picker, Ao=Ao) + # merge picks into returning dictionary + picks = dict(P=ppick, S=spick) return picks diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index f48edf0d..fcbc3565 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -421,12 +421,14 @@ class Data(object): epp = phase['epp'] lpp = phase['lpp'] error = phase['spe'] + picker = phase['picker'] pick = Pick() pick.time = onset pick.time_errors.lower_uncertainty = onset - epp pick.time_errors.upper_uncertainty = lpp - onset pick.time_errors.uncertainty = error pick.phase_hint = label + pick.method_id = ResourceIdentifier(id=picker) pick.waveform_id = WaveformStreamID(station_code=station) self.getEvtData().picks.append(pick) try: