Update config arguments to bit/volt/meter conversion functions.
authorW. Trevor King <wking@drexel.edu>
Tue, 27 Sep 2011 20:22:58 +0000 (16:22 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 27 Sep 2011 20:22:58 +0000 (16:22 -0400)
pyafm/afm.py

index 8ae61fa524e76e068091f90fdfd014eecba8d95d..b03ad05b2c0b4f99f75dedd6acd1891eafdb4f47 100644 (file)
@@ -81,8 +81,8 @@ class AFM (object):
 
         axis = self.piezo.axis_by_name(self.axis_name)
 
-        zero = _convert_volts_to_bits(axis.axis_channel_config, 0)
-        target_def = _convert_volts_to_bits(axis.axis_channel_config, setpoint)
+        zero = _convert_volts_to_bits(axis.config['channel'], 0)
+        target_def = _convert_volts_to_bits(axis.config['channel'], setpoint)
 
         _LOG.debug('zero the %s piezo output' % self.axis_name)
         self.piezo.jump(axis_name=self.axis_name, position=zero)
@@ -100,8 +100,7 @@ class AFM (object):
             pos = self._stepper_approach_again(
                 target_deflection=target_def, far=far)
 
-        pos_m = _convert_bits_to_meters(
-            axis.axis_channel_config, axis.axis_config, pos)
+        pos_m = _convert_bits_to_meters(axis.config, pos)
         _LOG.debug('located surface at stepper %d, piezo %d (%g m)'
                   % (self.stepper.position, pos, pos_m))
 
@@ -115,8 +114,7 @@ class AFM (object):
             except _FlatFit, e:
                 _LOG.debug(e)
                 continue
-            pos_m = _convert_bits_to_meters(
-                axis.axis_channel_config, axis.axis_config, pos)
+            pos_m = _convert_bits_to_meters(axis.config, pos)
             _LOG.debug('located surface at stepper %d, piezo %d (%g m)'
                       % (self.stepper.position, pos, pos_m))
         while pos_m > stepper_tolerance:  # step forward if we need to
@@ -128,16 +126,14 @@ class AFM (object):
             except _FlatFit, e:
                 _LOG.debug(e)
                 continue
-            pos_m = _convert_bits_to_meters(
-                axis.axis_channel_config, axis.axis_config, pos)
+            pos_m = _convert_bits_to_meters(axis.config, pos)
             _LOG.debug('located surface at stepper %d, piezo %d (%g m)'
                       % (self.stepper.position, pos, pos_m))
 
         _LOG.debug('adjust the %s piezo to place us just onto the surface'
                   % self.axis_name)
         target_m = pos_m + depth
-        target = _convert_meters_to_bits(
-            axis.axis_channel_config, axis.axis_config, target_m)
+        target = _convert_meters_to_bits(axis.config, target_m)
         self.piezo.jump(self.axis_name, target)
 
         _LOG.debug(