[bugfix] check type(picks) in dict/Attribdict

This commit is contained in:
Marcel Paffrath 2017-08-30 14:45:20 +02:00
parent aea58b3c11
commit ca5167cb04

View File

@ -9,6 +9,7 @@ import subprocess
import numpy as np import numpy as np
from obspy import UTCDateTime, read from obspy import UTCDateTime, read
from obspy.core import AttribDict
from obspy.signal.rotate import rotate2zne from obspy.signal.rotate import rotate2zne
from obspy.io.xseed.utils import SEEDParserException from obspy.io.xseed.utils import SEEDParserException
@ -95,6 +96,8 @@ def excludeQualityClasses(picks, qClasses, timeerrorsP, timeerrorsS):
for station, phases in picks.items(): for station, phases in picks.items():
for phase, pick in phases.items(): for phase, pick in phases.items():
if not type(pick) in [AttribDict, dict]:
continue
pickerror = phaseError[identifyPhaseID(phase)] pickerror = phaseError[identifyPhaseID(phase)]
quality = getQualityFromUncertainty(pick['spe'], pickerror) quality = getQualityFromUncertainty(pick['spe'], pickerror)
if not quality in qClasses: if not quality in qClasses: