39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
#ascan ([manip_x,manip_y],machine_cur, [-950,900], [-960,910], [5.0,5.0], latency=1.0,zigzag=True, save=False)
|
|
|
|
RANGE_V = [-500, 500]
|
|
RANGE_H = [-500, 500]
|
|
STEP_V = 100.0
|
|
STEP_H = 100.0
|
|
SETTLING_TIME = 1.0
|
|
|
|
|
|
class LeemRoiIntensity (ImageMeasurement):
|
|
def __init__(self, x,y,w,h):
|
|
ImageMeasurement.__init__(self, image2, "roi"+ str([x,y,w,h]))
|
|
self.x, self.y, self.w, self.h, = x,y,w,h
|
|
def calc(self, data):
|
|
return data.getRoi(Rectangle(self.x, self.y, self.w, self.h)).integrate(False)
|
|
|
|
|
|
microscope.move_timeout=240000
|
|
|
|
#We start at 0,0 absolute position
|
|
tilt_vertical.initialize()
|
|
tilt_horizontal.initialize()
|
|
|
|
roi_intensity = LeemRoiIntensity(550,420, 150, 150)
|
|
set_device_alias(image2.intensity, "CameraIntensity")
|
|
set_device_alias(roi_intensity, "ROI_Intensity")
|
|
sensors = [machine_cur, image2.intensity, roi_intensity]
|
|
|
|
def before_read(pos,scan):
|
|
image2.update()
|
|
|
|
try:
|
|
ascan ( [tilt_horizontal, tilt_vertical], sensors, \
|
|
[RANGE_H[0], RANGE_V[0]], [RANGE_H[1], RANGE_V[1]], [float(STEP_H), float(STEP_V)], \
|
|
latency=SETTLING_TIME,zigzag=True, save=True, before_read=before_read)
|
|
|
|
finally:
|
|
tilt_vertical.write(0)
|
|
tilt_horizontal.write(0) |