[bugfix] catch empty pickdics during comparison

Only the P phase might be picked by purpose, or the autopicker might not find any valid S onsets
This commit is contained in:
Darius Arnold 2017-09-15 13:17:40 +02:00
parent 00df77e723
commit c65d6b8376

View File

@ -1668,10 +1668,22 @@ class MainWindow(QMainWindow):
if event.pylot_picks and event.pylot_autopicks:
for station in event.pylot_picks:
if station in event.pylot_autopicks:
autopick_p = event.pylot_autopicks[station]['P']['spe']
manupick_p = event.pylot_picks[station]['P']['spe']
autopick_s = event.pylot_autopicks[station]['S']['spe']
manupick_s = event.pylot_picks[station]['S']['spe']
try:
autopick_p = event.pylot_autopicks[station]['P']['spe']
except KeyError:
autopick_p = None
try:
manupick_p = event.pylot_picks[station]['P']['spe']
except KeyError:
manupick_p = None
try:
autopick_s = event.pylot_autopicks[station]['S']['spe']
except KeyError:
autopick_s = None
try:
manupick_s = event.pylot_picks[station]['S']['spe']
except KeyError:
manupick_s = None
if autopick_p and manupick_p:
return True
elif autopick_s and manupick_s: