Debugging.
This commit is contained in:
parent
833b29a488
commit
d25e791bb8
@ -292,6 +292,7 @@ class PragPicker(AutoPicking):
|
|||||||
self.Pick = None
|
self.Pick = None
|
||||||
self.SNR = None
|
self.SNR = None
|
||||||
self.slope = None
|
self.slope = None
|
||||||
|
pickflag = 0
|
||||||
#smooth CF
|
#smooth CF
|
||||||
ismooth = int(round(self.Tsmooth / self.dt))
|
ismooth = int(round(self.Tsmooth / self.dt))
|
||||||
cfsmooth = np.zeros(len(self.cf))
|
cfsmooth = np.zeros(len(self.cf))
|
||||||
@ -354,13 +355,20 @@ class PragPicker(AutoPicking):
|
|||||||
#now decide which pick: left or right?
|
#now decide which pick: left or right?
|
||||||
if flagpick_l > 0 and flagpick_r > 0 and cfpick_l <= cfpick_r:
|
if flagpick_l > 0 and flagpick_r > 0 and cfpick_l <= cfpick_r:
|
||||||
self.Pick = pick_l
|
self.Pick = pick_l
|
||||||
|
pickflag = 1
|
||||||
elif flagpick_l > 0 and flagpick_r > 0 and cfpick_l >= cfpick_r:
|
elif flagpick_l > 0 and flagpick_r > 0 and cfpick_l >= cfpick_r:
|
||||||
self.Pick = pick_r
|
self.Pick = pick_r
|
||||||
|
pickflag = 1
|
||||||
|
else:
|
||||||
|
print 'PragPicker: Could not find reliable onset!'
|
||||||
|
self.Pick = None
|
||||||
|
pickflag = 0
|
||||||
|
|
||||||
if self.getiplot() > 1:
|
if self.getiplot() > 1:
|
||||||
p = plt.figure(self.getiplot())
|
p = plt.figure(self.getiplot())
|
||||||
p1, = plt.plot(Tcfpick,cfipick, 'k')
|
p1, = plt.plot(Tcfpick,cfipick, 'k')
|
||||||
p2, = plt.plot(Tcfpick,cfsmoothipick, 'r')
|
p2, = plt.plot(Tcfpick,cfsmoothipick, 'r')
|
||||||
|
if pickflag > 0:
|
||||||
p3, = plt.plot([self.Pick, self.Pick], [min(cfipick), max(cfipick)], 'b', linewidth=2)
|
p3, = plt.plot([self.Pick, self.Pick], [min(cfipick), max(cfipick)], 'b', linewidth=2)
|
||||||
plt.legend([p1, p2, p3], ['CF', 'Smoothed CF', 'Pick'])
|
plt.legend([p1, p2, p3], ['CF', 'Smoothed CF', 'Pick'])
|
||||||
plt.xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
|
plt.xlabel('Time [s] since %s' % self.Data[0].stats.starttime)
|
||||||
@ -371,6 +379,6 @@ class PragPicker(AutoPicking):
|
|||||||
plt.close(p)
|
plt.close(p)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.Pick = None
|
|
||||||
print 'PragPicker: No initial onset time given! Check input!'
|
print 'PragPicker: No initial onset time given! Check input!'
|
||||||
|
self.Pick = None
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user