From 62625d6941b3d92693c1758b79eff45384fd1b51 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Fri, 15 Sep 2017 18:28:33 +0200 Subject: [PATCH 1/2] improved wadati plot added names of stations, added lines indicating wadati tolerance --- pylot/core/pick/utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index ff67055f..a5e72cd8 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -589,6 +589,7 @@ def wadaticheck(pickdic, dttolerance, iplot=0, fig_dict=None): Ppicks = [] Spicks = [] SPtimes = [] + stations = [] for key in list(pickdic.keys()): if pickdic[key]['P']['weight'] < 4 and pickdic[key]['S']['weight'] < 4: # calculate S-P time @@ -622,6 +623,7 @@ def wadaticheck(pickdic, dttolerance, iplot=0, fig_dict=None): ibad = 0 for key in list(pickdic.keys()): if 'SPt' in pickdic[key]: + stations.append(key) wddiff = abs(pickdic[key]['SPt'] - wdfit[ii]) ii += 1 # check, if deviation is larger than adjusted @@ -682,12 +684,18 @@ def wadaticheck(pickdic, dttolerance, iplot=0, fig_dict=None): linecolor = 'k' plt_flag = 1 ax = fig.add_subplot(111) - ax.plot(Ppicks, SPtimes, 'ro', label='Skipped S-Picks') + if ibad > 0: + ax.plot(Ppicks, SPtimes, 'ro', label='Skipped S-Picks') if wfitflag == 0: ax.plot(Ppicks, wdfit, color=linecolor, linewidth=0.7, label='Wadati 1') + ax.plot(Ppicks, wdfit+dttolerance, color='0.9', linewidth=0.5, label='Wadati 1 Tolerance') + ax.plot(Ppicks, wdfit-dttolerance, color='0.9', linewidth=0.5) + ax.plot(checkedPpicks, wdfit2, 'g', label='Wadati 2') ax.plot(checkedPpicks, checkedSPtimes, color=linecolor, linewidth=0, marker='o', label='Reliable S-Picks') - ax.plot(checkedPpicks, wdfit2, 'g', label='Wadati 2') + for Ppick, SPtime, station in zip(Ppicks, SPtimes, stations): + ax.text(Ppick, SPtime + 0.01, '{0}'.format(station)) + ax.set_title('Wadati-Diagram, %d S-P Times, Vp/Vs(raw)=%5.2f,' \ 'Vp/Vs(checked)=%5.2f' % (len(SPtimes), vpvsr, cvpvsr)) ax.legend(loc=1, numpoints=1) From 27a6af663661ae81f5a44499a41beb91a9482546 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Fri, 15 Sep 2017 18:31:20 +0200 Subject: [PATCH 2/2] improved jackknife/median plot added different colors to markers for accepted picks, jackknife reject picks and median rejected picks, added lines indicating median tolerance --- pylot/core/pick/utils.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index a5e72cd8..359059ac 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -917,16 +917,19 @@ def checkPonsets(pickdic, dttolerance, jackfactor=5, iplot=0, fig_dict=None): plt_flag = 1 ax = fig.add_subplot(111) - ax.plot(np.arange(0, len(Ppicks)), Ppicks, 'ro', markersize=14) - if len(badstations) < 1 and len(badjkstations) < 1: - ax.plot(np.arange(0, len(Ppicks)), Ppicks, 'go', markersize=14, label='Skipped P Picks') - else: - ax.plot(igood, np.array(Ppicks)[igood], 'go', markersize=14, label='Good P Picks') - ax.plot([0, len(Ppicks) - 1], [pmedian, pmedian], 'g', - linewidth=2, label='Median') - for i in range(0, len(Ppicks)): - ax.text(i, Ppicks[i] + 0.01, '{0}'.format(stations[i])) - + if len(badstations) > 0: + ax.plot(ibad, np.array(Ppicks)[ibad], marker ='o', markerfacecolor='orange', markersize=14, + linestyle='None', label='Median Skipped P Picks') + if len(badjkstations) > 0: + ax.plot(badjk[0], np.array(Ppicks)[badjk], 'ro', markersize=14, label='Jackknife Skipped P Picks') + ax.plot(igood, np.array(Ppicks)[igood], 'go', markersize=14, label='Good P Picks') + ax.plot([0, len(Ppicks) - 1], [pmedian, pmedian], 'g', linewidth=2, label='Median') + ax.plot([0, len(Ppicks) - 1], [pmedian + dttolerance, pmedian + dttolerance], 'g--', linewidth=1.2, + dashes=[25, 25], label='Median Tolerance') + ax.plot([0, len(Ppicks) - 1], [pmedian - dttolerance, pmedian - dttolerance], 'g--', linewidth=1.2, + dashes=[25, 25]) + for index, pick in enumerate(Ppicks): + ax.text(index, pick + 0.01, '{0}'.format(stations[i])) ax.set_xlabel('Number of P Picks') ax.set_ylabel('Onset Time [s] from 1.1.1970') ax.legend(loc=1, numpoints=1)