While setting some experiments I realized that the stage was not waiting until the next move.
I think I fixed this and I also tried to remove some redundancy in the code managing the moves and the waiting for the stage to idle.
This is all in my branch here. @iandobbie can you check this? You can use this code to test with a tiling array. In my case it was drawing little circles no matter the size of the tile. now it seems to work. Simultaneous move in x and y is kept.
PORT=Nonebaudrate=9600frommicroscope.controllers.asiimportASIMS2000controller=ASIMS2000(port=PORT, baudrate=baudrate)
stage=controller.devices["stage"]
stage.enable()
x_tile_size=1000y_tile_size=1000array_size=5pre_experiment_position=stage.positiondefspiral(n):
x=y=0dx=0dy=-1foriinrange(n**2):
if (-n/2<x<=n/2) and (-n/2<y<=n/2):
yield (pre_experiment_position["X"] + (x*x_tile_size) , pre_experiment_position["Y"] + (y*y_tile_size))
ifx==yor (x<0andx==-y) or (x>0andx==1-y):
dx, dy=-dy, dxx, y=x+dx, y+dyforpos_x, pos_yinspiral(array_size):
stage.move_to({"X": pos_x, "Y": pos_y})
stage.move_to(pre_experiment_position)
While setting some experiments I realized that the stage was not waiting until the next move.
I think I fixed this and I also tried to remove some redundancy in the code managing the moves and the waiting for the stage to idle.
This is all in my branch here. @iandobbie can you check this? You can use this code to test with a tiling array. In my case it was drawing little circles no matter the size of the tile. now it seems to work. Simultaneous move in x and y is kept.