We need to know where we are before we can move somewhere
smoothly.
- >>> pos = _base.convert_volts_to_bits(p.config.select_config(
- ... 'axes', 'z', get_attribute=_base.get_axis_name)['channel'], 0)
- >>> p.jump('z', pos)
+ >>> zeros = p.zero(axis_names=['z'])
+ >>> pos = zeros[0]
Usually `.move_to_pos_or_def` is used to approach the surface, but
for testing we assume the z output channel is connected directly
for i,name in enumerate(input_names):
ret[name] = input_data[:,i]
return ret
+
+ def zero(self, axis_names=None, **kwargs):
+ zeros = []
+ if axis_names is None:
+ axis_names = [axis.name for axis in self.axes]
+ for axis_name in axis_names:
+ axis = self.axis_by_name(axis_name)
+ config = self.config.select_config(
+ 'axes', axis_name, get_attribute=get_axis_name)['channel']
+ zero = convert_volts_to_bits(config, 0)
+ zeros.append(zero)
+ self.jump(axis_name, zero)
+ return zeros