Convert JPK deflection sign to follow Hooke convention.
[hooke.git] / hooke / driver / jpk.py
index 9ba649cf87f287a72145e586104bb797d60de0dd..39717efc15ec08fa0609d80c0e462e97b2eba325 100644 (file)
@@ -201,6 +201,11 @@ class JPKDriver (Driver):
             if name == 'vDeflection':
                 assert unit == 'm', segment.info['columns'][i]
                 segment.info['columns'][i] = join_data_label('deflection', 'm')
+                # Invert because deflection voltage increases as the
+                # tip moves away from the surface, but it makes more
+                # sense to me to have it increase as it moves toward
+                # the surface (positive tension on the protein chain).
+                segment[:,i] *= -1
             elif name == 'height':
                 assert unit == 'm', segment.info['columns'][i]
                 segment.info['columns'][i] = join_data_label('z piezo', 'm')
@@ -222,7 +227,6 @@ class JPKDriver (Driver):
                 channel_name, 'V')
             return segment
         conversion_info = conversion_set['conversion'][conversion]
-        print channel_name, conversion_info.keys()
         if conversion_info['base-calibration-slot'] \
                 != conversion_set['conversions']['base']:
             # Our conversion is stacked on a previous conversion.  Do