[bugfix] use identifyPhase instead of phase[0]

This commit is contained in:
2017-08-15 10:02:46 +02:00
parent ff1ab722df
commit 4bb616492c
3 changed files with 21 additions and 12 deletions

View File

@@ -1097,6 +1097,7 @@ def checkZ4S(X, pick, zfac, checkwin, iplot, fig=None):
plt.close(fig)
return returnflag
def getQualityfromUncertainty(uncertainty, Errors):
'''Script to transform uncertainty into quality classes 0-4
regarding adjusted time errors Errors.

View File

@@ -1712,10 +1712,12 @@ class PickDlg(QDialog):
return
# get quality classes
if phase[0] == 'P':
if self.getPhaseID(phase) == 'P':
quality = getQualityfromUncertainty(picks['spe'], self.parameter['timeerrorsP'])
elif phase[0] == 'S':
phaseID = 'P'
elif self.getPhaseID(phase) == 'S':
quality = getQualityfromUncertainty(picks['spe'], self.parameter['timeerrorsS'])
phaseID = 'S'
mpp = picks['mpp'] - self.getStartTime()
if picks['epp'] and picks['lpp'] and not textOnly:
@@ -1726,7 +1728,7 @@ class PickDlg(QDialog):
if picktype == 'manual':
if not textOnly:
linestyle_mpp, width_mpp = pick_linestyle_plt(picktype, 'mpp')
color = pick_color_plt(picktype, phase, quality)
color = pick_color_plt(picktype, phaseID, quality)
if picks['epp'] and picks['lpp']:
ax.fill_between([epp, lpp], ylims[0], ylims[1],
alpha=.25, color=color, label='EPP, LPP')
@@ -1744,7 +1746,7 @@ class PickDlg(QDialog):
# append phase text (if textOnly: draw with current ylims)
self.phaseText.append(ax.text(mpp, ylims[1], phase))
elif picktype == 'auto':
color = pick_color_plt(picktype, phase, quality)
color = pick_color_plt(picktype, phaseID, quality)
linestyle_mpp, width_mpp = pick_linestyle_plt(picktype, 'mpp')
if not textOnly:
ax.plot(mpp, ylims[1], color=color, marker='v')