Otherwise, if position is not specified, step would always end up
being negative, and position would always end up as zero. Now
position will end up being the extreme in the initial step direction,
as advertised.
else:
aquire_data = False
- if step == 0:
- raise ValueError('must have non-zero step size')
- elif step < 0 and position > self.last_output[axis_name]:
- step = -step
- 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:
channel = self._deflection_channel(self)
deflection = channel.get_maxdata()
+ if step == 0:
+ raise ValueError('must have non-zero step size')
+ elif step < 0 and position > self.last_output[axis_name]:
+ step = -step
+ elif step > 0 and position < self.last_output[axis_name]:
+ step = -step
+
log_string = (
'move to position %d or deflection %g on axis %s in steps of %d'
% (position, deflection, axis_name, step))