adding Q1 for triggering status

This commit is contained in:
2018-11-29 15:56:05 +01:00
parent d16249d863
commit 38a8c8484b
6 changed files with 122 additions and 29 deletions

View File

@@ -113,14 +113,14 @@ class ShapePath(MotionBase):
pts=np.random.rand(n,2)*scale
self.points=pts
def gen_grid_points(self,w=10,h=10,pitch=100,rnd=.2):
def gen_grid_points(self,w=10,h=10,pitch=100,rnd=.2,ofs=(0,0)):
'generates points in a grid with a given pitch and a bit randomness'
np.random.seed(0)
xx,yy=np.meshgrid(range(w), range(h))
pts=np.array([xx.reshape(-1),yy.reshape(-1)],dtype=np.float).transpose()*pitch
if rnd != 0:
pts+=(np.random.rand(pts.shape[0],2)*(rnd*pitch))
pts[:,0]+=500
pts+=ofs
self.points=pts
def opt_pts(self,fn):
@@ -277,6 +277,7 @@ class ShapePath(MotionBase):
prg.append('dwell 1000')
if sync_frq is not None:
prg.append('Coord[1].Q[0]=-1')
prg.append('Coord[1].Q[1]=0')
prg.append('Gather.Enable=0')
elif mode==2: #### spline motion
try:
@@ -636,15 +637,21 @@ if __name__=='__main__':
#sp.gen_grid_points(w=2,h=2,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
#sp.gen_swissmx_points(width=1000,ofs=(-500,0));sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40,acq_per=1)
#sp.gen_grid_points(w=30,h=30,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
#sp.gen_grid_points(w=200,h=200,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
#sp.gen_grid_points(w=2,h=20,pitch=50,rnd=0);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
#sp.gen_rand_points(n=500, scale=1000);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
sp.gen_grid_points(w=30,h=30,pitch=50,rnd=0.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
#sp.gen_grid_points(w=30,h=30,pitch=50,rnd=0.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
#sp.gen_rand_points(n=400, scale=1000);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10)
#sp.gen_swissmx_points(width=500,flipx=True,flipy=True,ofs=(-380,3980));sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40,acq_per=1)
#sp.gen_grid_points(w=20,h=20,pitch=20,rnd=0,ofs=(-464,1754));sp.sort_points(True);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
sp.gen_grid_points(w=20,h=20,pitch=20,rnd=0,ofs=(-160,3700));sp.sort_points(False);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
#>>>setup gather and sync<<<
#sp.setup_gather()
#sp.setup_sync()
@@ -653,6 +660,7 @@ if __name__=='__main__':
#sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
#>>>run gather and plot trajectory<<<
#return
sp.run()
trigger(0.5)
sp.gather_upload(fnRec=fn+'.npz')