Convert JPK deflection sign to follow Hooke convention.
authorW. Trevor King <wking@drexel.edu>
Fri, 20 Aug 2010 11:03:50 +0000 (07:03 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 20 Aug 2010 11:03:50 +0000 (07:03 -0400)
hooke/driver/jpk.py

index 7b33c5b19bbce5b083703d50069222e513e221c6..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')