[bugfix] missing network code in picksdict_from_picks triggered silent Exception using picks generated by picks_from_picksdict

This commit is contained in:
Marcel Paffrath 2017-06-26 13:58:26 +02:00
parent b10b79ea79
commit 581a85b81f
2 changed files with 3 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class Data(object):
else: else:
raise e raise e
else: # create an empty Event object else: # create an empty Event object
self.setNew() #self.setNew()
evtdata = ObsPyEvent() evtdata = ObsPyEvent()
evtdata.picks = [] evtdata.picks = []
self.evtdata = evtdata self.evtdata = evtdata

View File

@ -196,6 +196,7 @@ def picksdict_from_picks(evt):
phase = {} phase = {}
station = pick.waveform_id.station_code station = pick.waveform_id.station_code
channel = pick.waveform_id.channel_code channel = pick.waveform_id.channel_code
network = pick.waveform_id.network_code
try: try:
onsets = picks[station] onsets = picks[station]
except KeyError as e: except KeyError as e:
@ -216,6 +217,7 @@ def picksdict_from_picks(evt):
phase['lpp'] = lpp phase['lpp'] = lpp
phase['spe'] = spe phase['spe'] = spe
phase['channel'] = channel phase['channel'] = channel
phase['network'] = network
try: try:
picker = str(pick.method_id) picker = str(pick.method_id)
if picker.startswith('smi:local/'): if picker.startswith('smi:local/'):