diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index bdf76c5b..dc22eb90 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -863,7 +863,7 @@ def autopickstation(wfstream, pickparam, verbose=False, if Pweight < 4: ax2.plot(arhcf1.getTimeArray(), arhcf1.getCF() / max(arhcf1.getCF()), 'b', label='CF1') - if aicSflag == 1: + if aicSflag == 1 and Sweight < 4: ax2.plot(arhcf2.getTimeArray(), arhcf2.getCF() / max(arhcf2.getCF()), 'm', label='CF2') ax2.plot( diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index 41e6f5d0..947520e4 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -979,6 +979,16 @@ def checkZ4S(X, pick, zfac, checkwin, iplot, fig=None): are shown : type: int ''' + + plt_flag = 0 + try: + iplot = int(iplot) + except: + if iplot == True or iplot == 'True': + iplot = 2 + else: + iplot = 0 + assert isinstance(X, Stream), "%s is not a stream object" % str(X) @@ -1056,10 +1066,16 @@ def checkZ4S(X, pick, zfac, checkwin, iplot, fig=None): t = np.arange(diff_dict[key], trace.stats.npts / trace.stats.sampling_rate + diff_dict[key], trace.stats.delta) if i == 0: + if fig == None or fig == 'None': + fig = plt.figure() # self.iplot) ### WHY? MP MP + plt_flag = 1 ax1 = fig.add_subplot(3, 1, i + 1) ax = ax1 ax.set_title('CheckZ4S, Station %s' % zdat[0].stats.station) else: + if fig == None or fig == 'None': + fig = plt.figure() # self.iplot) ### WHY? MP MP + plt_flag = 1 ax = fig.add_subplot(3, 1, i + 1, sharex=ax1) ax.plot(t, abs(trace.data), color='b', label='abs') ax.plot(t, trace.data, color='k') @@ -1071,6 +1087,10 @@ def checkZ4S(X, pick, zfac, checkwin, iplot, fig=None): lw=0) ax.legend() ax.set_xlabel('Time [s] since %s' % zdat[0].stats.starttime) + if plt_flag == 1: + fig.show() + raw_input() + plt.close(fig) return returnflag def getQualityfromUncertainty(uncertainty, Errors):