Tilt homing
This commit is contained in:
@@ -11,7 +11,8 @@ class LEEM2000(TcpDevice):
|
||||
self.debug = False
|
||||
self.retries = 1
|
||||
self.timeout = 1000
|
||||
self.move_timeout = 30000
|
||||
self.move_timeout = 30000 #30s
|
||||
self.homing_timeout = 300000 #5min
|
||||
|
||||
def doInitialize(self):
|
||||
super(LEEM2000, self).doInitialize()
|
||||
@@ -153,6 +154,15 @@ class LEEM2000(TcpDevice):
|
||||
if ret != '0':
|
||||
raise Exception("Error moving tilt %s to %s: %s" % (str(cmd), dist_us, ret))
|
||||
|
||||
#Direction H or V
|
||||
def home_tilt(self, direction, timeout = None, retries = None):
|
||||
if timeout is None:
|
||||
timeout = self.homing_timeout
|
||||
cmd = "tlt " + str(direction)
|
||||
ret = self.send_receive(cmd, timeout, retries)
|
||||
if ret != '0':
|
||||
raise Exception("Error homing tilt %s: %s" % (str(cmd), ret))
|
||||
|
||||
#motor_id = 11 (X) or 10(Y)
|
||||
def move_motor_rel_async(self, motor_id, dist_us, timeout = None, retries = None):
|
||||
cmd = "mmd " + str(motor_id) + " " + str(dist_us)
|
||||
@@ -258,6 +268,7 @@ add_device (microscope.get_tilt('D','U', "tilt_v"), True)
|
||||
add_device (microscope.get_child("MOBJ","objective"), True)
|
||||
add_device (microscope.get_child("OSTIGA","obj_stig_a"), True)
|
||||
add_device (microscope.get_child("OSTIGB","obj_stig_b"), True)
|
||||
add_device (microscope.get_child("MDRIVE","azimuth_rot"), True)
|
||||
|
||||
microscope.setPolling(5000)
|
||||
|
||||
@@ -280,14 +291,29 @@ class TiltMotor(RegisterBase):
|
||||
self.tilt_motor.write(offset)
|
||||
self.position = pos
|
||||
|
||||
class Fov(ReadonlyRegisterBase):
|
||||
def __init__(self, name, mic):
|
||||
ReadonlyRegisterBase.__init__(self, name)
|
||||
self.mic=mic
|
||||
|
||||
def doInitialize(self):
|
||||
self.position = 0
|
||||
|
||||
def doRead(self):
|
||||
return self.mic.get_preset_label()
|
||||
|
||||
|
||||
|
||||
def init_tilt():
|
||||
tilt_vertical.initialize()
|
||||
tilt_horizontal.initialize()
|
||||
|
||||
add_device(TiltMotor("tilt_vertical", tilt_v), True)
|
||||
add_device(TiltMotor("tilt_horizontal", tilt_h), True)
|
||||
add_device(Fov("fov", microscope), True)
|
||||
tilt_vertical.polling=500
|
||||
tilt_horizontal.polling=500
|
||||
fov.polling=5000
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ def _save_as_tiff(data, filename, check=False, show = False, metadata={}):
|
||||
data = get_ip_array(ip)
|
||||
import java.util.Arrays as Arrays
|
||||
ip=open_image(filename)
|
||||
read = get_ip_array(ip)
|
||||
read = get_ip_array(ip)
|
||||
#print (" ------> Error reading array: " + str(filename))
|
||||
#TODO: Original checkcode was deleted!
|
||||
|
||||
@@ -393,8 +393,6 @@ def get_outliers_mask(data_type='f'):
|
||||
pass
|
||||
return _outliers_mask
|
||||
|
||||
eiger.setDataType(DataType.Float32)
|
||||
eiger.getDataArray().monitored=True
|
||||
|
||||
class ProcImage(Filter):
|
||||
def __init__(self):
|
||||
@@ -427,7 +425,10 @@ raw.addListener(proc_image)
|
||||
|
||||
|
||||
add_device(proc_image, True)
|
||||
image.refresh()
|
||||
image.refresh()
|
||||
|
||||
eiger.setDataType(DataType.Float32)
|
||||
eiger.getDataArray().monitored=True
|
||||
|
||||
if False:
|
||||
integrate_roi(image, 10, 5, 20, 10)
|
||||
|
||||
Reference in New Issue
Block a user