Debugging.

This commit is contained in:
Ludger Küperkoch 2015-06-23 16:22:21 +02:00
parent 2c9ad97a4a
commit 54fd3004b4

View File

@ -23,7 +23,7 @@ import matplotlib.pyplot as plt
from pylot.core.pick.utils import * from pylot.core.pick.utils import *
from pylot.core.pick.CharFuns import CharacteristicFunction from pylot.core.pick.CharFuns import CharacteristicFunction
import warnings import warnings
import pdb
class AutoPicking(object): class AutoPicking(object):
''' '''
Superclass of different, automated picking algorithms applied on a CF determined Superclass of different, automated picking algorithms applied on a CF determined
@ -327,7 +327,8 @@ class PragPicker(AutoPicking):
#at first we look to the right until the end of the pick window is reached #at first we look to the right until the end of the pick window is reached
flagpick_r = 0 flagpick_r = 0
flagpick_l = 0 flagpick_l = 0
flagpick = 0 cfpick_r = 0
cfpick_l = 0
lpickwindow = int(round(self.PickWindow / self.dt)) lpickwindow = int(round(self.PickWindow / self.dt))
for i in range(max(np.insert(ipick, 0, 2)), min([ipick1 + lpickwindow + 1, len(self.cf) - 1])): for i in range(max(np.insert(ipick, 0, 2)), min([ipick1 + lpickwindow + 1, len(self.cf) - 1])):
if self.cf[i + 1] > self.cf[i] and self.cf[i - 1] >= self.cf[i]: if self.cf[i + 1] > self.cf[i] and self.cf[i - 1] >= self.cf[i]:
@ -339,7 +340,7 @@ class PragPicker(AutoPicking):
cfpick_r = self.cf[i] cfpick_r = self.cf[i]
break break
#now we look to the left # now we look to the left
for i in range(ipick1, max([ipick1 - lpickwindow + 1, 2]), -1): for i in range(ipick1, max([ipick1 - lpickwindow + 1, 2]), -1):
if self.cf[i + 1] > self.cf[i] and self.cf[i - 1] >= self.cf[i]: if self.cf[i + 1] > self.cf[i] and self.cf[i - 1] >= self.cf[i]:
if cfsmooth[i - 1] * (1 + aus1) >= cfsmooth[i]: if cfsmooth[i - 1] * (1 + aus1) >= cfsmooth[i]:
@ -350,13 +351,16 @@ class PragPicker(AutoPicking):
cfpick_l = self.cf[i] cfpick_l = self.cf[i]
break break
#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 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 pickflag = 1
elif flagpick_l == 0 and flagpick_r > 0 and cfpick_l >= cfpick_r:
self.Pick = pick_l
pickflag = 1
else: else:
print 'PragPicker: Could not find reliable onset!' print 'PragPicker: Could not find reliable onset!'
self.Pick = None self.Pick = None