non adapting triggering with triggerSync.c
This commit is contained in:
@@ -138,14 +138,16 @@ class MAMainFrame(wx.Frame):
|
||||
idxTrigger=rec[:,4]
|
||||
doc.idxTrigger=idxTrigger=np.where(np.diff(idxTrigger)==1)[0]+1
|
||||
idxInPos=[] #first point at idx 0
|
||||
try:# find approximate distance of 2 points
|
||||
rng =idxTrigger[2]-idxTrigger[1]
|
||||
except IndexError:
|
||||
rng = int(lenRec / lenPts)
|
||||
idx=rng/2
|
||||
|
||||
#try:# find approximate distance of 2 points
|
||||
# rng =idxTrigger[2]-idxTrigger[1]
|
||||
#except IndexError:
|
||||
# rng = int(lenRec / lenPts)
|
||||
#idx=rng/2
|
||||
|
||||
idx=0
|
||||
for i in range(lenPts):
|
||||
l=rec[idx:idx+rng,(3,2)]-pts[i,:]
|
||||
l=rec[idx:,(3,2)]-pts[i,:]
|
||||
l2=l[:,0]**2+l[:,1]**2
|
||||
try:
|
||||
ofs=l2.argmin()
|
||||
@@ -153,7 +155,7 @@ class MAMainFrame(wx.Frame):
|
||||
break#print(l2[ofs])
|
||||
idx+=ofs
|
||||
idxInPos.append(idx)
|
||||
idx+=rng/2
|
||||
#idx+=rng/2
|
||||
|
||||
doc.idxInPos=idxInPos=np.array(idxInPos)
|
||||
idx=min(idxInPos.shape[0],idxTrigger.shape[0])-1
|
||||
|
||||
Reference in New Issue
Block a user