>>> axis_config = config.AxisConfig()
>>> axis_config.update(
- ... {'name': 'z', 'gain':20, 'sensitivity':8e-9, 'minimum':-9})
+ ... {'gain':20, 'sensitivity':8e-9, 'minimum':-9})
>>> axis_config['channel'] = config.OutputChannelConfig()
+ >>> axis_config['channel']['name'] = 'z'
>>> input_config = config.InputChannelConfig()
>>> input_config['name'] = 'deflection'
>>> c = _base.InputChannel(config=input_config, channel=input_channel)
>>> c.setup_config()
- >>> p = AFMPiezo(axes=[a], input_channels=[c], name='Molly')
+ >>> p = AFMPiezo(axes=[a], inputs=[c], name='Molly')
>>> deflection = p.read_deflection()
>>> deflection # doctest: +SKIP
We need to know where we are before we can move somewhere
smoothly.
- >>> pos = _base.convert_volts_to_bits(p.config['axes'][0]['channel'], 0)
+ >>> pos = _base.convert_volts_to_bits(p.config.select_config(
+ ... 'axes', 'z', get_attribute=_base.get_axis_name)['channel'], 0)
>>> p.jump('z', pos)
Usually `.move_to_pos_or_def` is used to approach the surface, but
into the deflection input channel.
>>> target_pos = _base.convert_volts_to_bits(
- ... p.config['axes'][0]['channel'], 2)
+ ... p.config.select_config('axes', 'z',
+ ... get_attribute=_base.get_axis_name)['channel'], 2)
>>> step = int((target_pos - pos)/5)
- >>> target_def = _base.convert_volts_to_bits(p.config['inputs'][0], 3)
+ >>> target_def = _base.convert_volts_to_bits(
+ ... p.config.select_config('inputs', 'deflection'), 3)
>>> data = p.move_to_pos_or_def('z', target_pos, target_def, step=step,
... return_data=True)
>>> p.last_output == {'z': int(target_pos)}
>>> p.jump('z', pos)
>>> target_def = _base.convert_volts_to_bits(
- ... p.config['inputs'][0]['channel'], 1)
+ ... p.config.select_config('inputs', 'deflection'), 1)
>>> data = p.move_to_pos_or_def('z', target_pos, target_def, step=step,
... return_data=True)
>>> print (p.last_output['z'] < int(target_pos))