"Return a Numpy dtype suitable for deflection bit values."
return self._deflection_channel().subdevice.get_dtype()
- def move_to_pos_or_def(self, axis_name, position, deflection, step,
- return_data=False, pre_move_steps=0):
+ def move_to_pos_or_def(self, axis_name, position=None, deflection=None,
+ step=1, return_data=False, pre_move_steps=0):
"""TODO
pre_move_steps : int
number of 'null' steps to take before moving (confirming a
stable input deflection).
"""
+ if position is None and deflection is None:
+ raise ValueError('must specify position, deflection, or both')
+
if return_data or _package_config['matplotlib']:
aquire_data = True
else:
elif step > 0 and position < self.last_output[axis_name]:
step = -step
+ if position is None:
+ # default to the extreme value in the step direction
+ if step > 0:
+ axis = self.axis_by_name(axis_name)
+ position = axis.channel.get_maxdata()
+ else:
+ position = 0
+ elif deflection is None:
+ # default to the extreme value
+ channel = self._deflection_channel(self)
+ deflection = channel.get_maxdata()
+
log_string = (
'move to position %d or deflection %g on axis %s in steps of %d'
% (position, deflection, axis_name, step))