From 8ce4f05a058bd0eb711f36370691663411f8560f Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 15 Aug 2017 13:46:05 +0200 Subject: [PATCH 1/5] [bugfix] manual phase text not shown --- pylot/core/util/widgets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 2e7c4493..761dbdfc 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1743,8 +1743,8 @@ class PickDlg(QDialog): else: ax.plot([mpp, mpp], ylims, color=color, linestyle=linestyle_mpp, linewidth=width_mpp, label='{}-Pick (NO PICKERROR)'.format(phase), picker=5) - # append phase text (if textOnly: draw with current ylims) - self.phaseText.append(ax.text(mpp, ylims[1], phase)) + # 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, phaseID, quality) linestyle_mpp, width_mpp = pick_linestyle_plt(picktype, 'mpp') From 67b3f4f36377bdb157ed8dc4c77e8d43550716b4 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 15 Aug 2017 13:52:26 +0200 Subject: [PATCH 2/5] [bugfix] TypeError has no attr. 'message' --- pylot/core/io/phases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index c85d2727..6f9bfc77 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -222,7 +222,7 @@ def picksdict_from_picks(evt): lpp = mpp + pick.time_errors.upper_uncertainty epp = mpp - pick.time_errors.lower_uncertainty except TypeError as e: - msg = e.message + ',\n falling back to symmetric uncertainties' + msg = e + ',\n falling back to symmetric uncertainties' warnings.warn(msg) lpp = mpp + spe epp = mpp - spe From c45b997aecc3f70230df5ad94cb0c2f67e5808f8 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 15 Aug 2017 14:00:16 +0200 Subject: [PATCH 3/5] [add] phase text color sync to phase marker color --- pylot/core/util/widgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 761dbdfc..35ba0949 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1726,9 +1726,9 @@ class PickDlg(QDialog): spe = picks['spe'] if picktype == 'manual': + color = pick_color_plt(picktype, phaseID, quality) if not textOnly: linestyle_mpp, width_mpp = pick_linestyle_plt(picktype, 'mpp') - 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 +1744,7 @@ class PickDlg(QDialog): ax.plot([mpp, mpp], ylims, color=color, linestyle=linestyle_mpp, linewidth=width_mpp, label='{}-Pick (NO PICKERROR)'.format(phase), picker=5) # append phase text (if textOnly: draw with current ylims) - self.phaseText.append(ax.text(mpp, ylims[1], phase)) + self.phaseText.append(ax.text(mpp, ylims[1], phase, color=color)) elif picktype == 'auto': color = pick_color_plt(picktype, phaseID, quality) linestyle_mpp, width_mpp = pick_linestyle_plt(picktype, 'mpp') @@ -1754,7 +1754,7 @@ class PickDlg(QDialog): ax.vlines(mpp, ylims[0], ylims[1], color=color, linestyle=linestyle_mpp, linewidth=width_mpp, picker=5, label='{}-Autopick (quality: {})'.format(phase, quality)) # append phase text (if textOnly: draw with current ylims) - self.phaseText.append(ax.text(mpp, ylims[1], phase)) + self.phaseText.append(ax.text(mpp, ylims[1], phase, color=color)) else: raise TypeError('Unknown picktype {0}'.format(picktype)) From 604edea95a5a2af45762aea2601ad49a0dad761c Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 15 Aug 2017 14:14:39 +0200 Subject: [PATCH 4/5] [change] pick plot style (spe->fill_between) --- pylot/core/util/widgets.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 35ba0949..7162c874 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1729,20 +1729,22 @@ class PickDlg(QDialog): color = pick_color_plt(picktype, phaseID, quality) if not textOnly: linestyle_mpp, width_mpp = pick_linestyle_plt(picktype, 'mpp') - if picks['epp'] and picks['lpp']: - ax.fill_between([epp, lpp], ylims[0], ylims[1], - alpha=.25, color=color, label='EPP, LPP') + ax.plot([mpp, mpp], ylims, color=color, linestyle=linestyle_mpp, linewidth=width_mpp, + label='{}-Pick (quality: {})'.format(phase, quality), picker=5) if spe: - linestyle_spe, width_spe = pick_linestyle_plt(picktype, 'spe') - ax.plot([mpp - spe, mpp - spe], ylims, color=color, linestyle=linestyle_spe, - linewidth=width_spe, label='{}-SPE'.format(phase)) - ax.plot([mpp + spe, mpp + spe], ylims, color=color, linestyle=linestyle_spe, - linewidth=width_spe) - ax.plot([mpp, mpp], ylims, color=color, linestyle=linestyle_mpp, linewidth=width_mpp, - label='{}-Pick (quality: {})'.format(phase, quality), picker=5) - else: - ax.plot([mpp, mpp], ylims, color=color, linestyle=linestyle_mpp, linewidth=width_mpp, - label='{}-Pick (NO PICKERROR)'.format(phase), picker=5) + ax.fill_between([mpp-spe, mpp+spe], ylims[0], ylims[1], + alpha=.25, color=color, label='{}-SPE'.format(phase)) + if epp: + linestyle_epp, width_epp = pick_linestyle_plt(picktype, 'epp') + ax.plot([epp, epp], ylims, color=color, linestyle=linestyle_epp, + linewidth=width_epp, label='{}-EPP'.format(phase)) + if lpp: + linestyle_lpp, width_lpp = pick_linestyle_plt(picktype, 'lpp') + ax.plot([lpp, lpp], ylims, color=color, linestyle=linestyle_lpp, + linewidth=width_lpp, label='{}-LPP'.format(phase)) + # else: + # ax.plot([mpp, mpp], ylims, color=color, linestyle=linestyle_mpp, linewidth=width_mpp, + # label='{}-Pick (NO PICKERROR)'.format(phase), picker=5) # append phase text (if textOnly: draw with current ylims) self.phaseText.append(ax.text(mpp, ylims[1], phase, color=color)) elif picktype == 'auto': From c7e4cd0c8bb6ce2c86347a07622f9594c03676c8 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 15 Aug 2017 14:16:34 +0200 Subject: [PATCH 5/5] [bugfix] savepath might be None as well! --- autoPyLoT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoPyLoT.py b/autoPyLoT.py index 2c26c46d..cadf9eb8 100755 --- a/autoPyLoT.py +++ b/autoPyLoT.py @@ -411,7 +411,7 @@ def autoPyLoT(input_dict=None, parameter=None, inputfile=None, fnames=None, even data.applyEVTData(evt, 'event') data.applyEVTData(picks) if savexml: - if savepath == 'None': + if savepath == 'None' or savepath == None: savepath = eventpath fnqml = '%s/PyLoT_%s' % (savepath, evID) data.exportEvent(fnqml, fnext='.xml', fcheck=['auto', 'magnitude', 'origin'])