[Bugfix] Take into account different formats of input arguments iplot and fig.
This commit is contained in:
parent
f393585831
commit
537b7cb4a3
@ -976,6 +976,15 @@ def checkZ4S(X, pick, zfac, checkwin, iplot, fig=None):
|
|||||||
: type: int
|
: type: int
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
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)
|
assert isinstance(X, Stream), "%s is not a stream object" % str(X)
|
||||||
|
|
||||||
print("Check for spuriously picked S onset instead of P onset ...")
|
print("Check for spuriously picked S onset instead of P onset ...")
|
||||||
@ -1052,10 +1061,14 @@ 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],
|
t = np.arange(diff_dict[key], trace.stats.npts / trace.stats.sampling_rate + diff_dict[key],
|
||||||
trace.stats.delta)
|
trace.stats.delta)
|
||||||
if i == 0:
|
if i == 0:
|
||||||
|
if fig == None or fig == 'None':
|
||||||
|
fig = plt.figure() # self.iplot) ### WHY? MP MP
|
||||||
ax1 = fig.add_subplot(3, 1, i + 1)
|
ax1 = fig.add_subplot(3, 1, i + 1)
|
||||||
ax = ax1
|
ax = ax1
|
||||||
ax.set_title('CheckZ4S, Station %s' % zdat[0].stats.station)
|
ax.set_title('CheckZ4S, Station %s' % zdat[0].stats.station)
|
||||||
else:
|
else:
|
||||||
|
if fig == None or fig == 'None':
|
||||||
|
fig = plt.figure() # self.iplot) ### WHY? MP MP
|
||||||
ax = fig.add_subplot(3, 1, i + 1, sharex=ax1)
|
ax = fig.add_subplot(3, 1, i + 1, sharex=ax1)
|
||||||
ax.plot(t, abs(trace.data), color='b', label='abs')
|
ax.plot(t, abs(trace.data), color='b', label='abs')
|
||||||
ax.plot(t, trace.data, color='k')
|
ax.plot(t, trace.data, color='k')
|
||||||
|
Loading…
Reference in New Issue
Block a user