From ed4b22024590cbd929bb60c56d7804ef3f1b48d6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 20 Aug 2010 07:03:50 -0400 Subject: [PATCH] Convert JPK deflection sign to follow Hooke convention. --- hooke/driver/jpk.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hooke/driver/jpk.py b/hooke/driver/jpk.py index 7b33c5b..39717ef 100644 --- a/hooke/driver/jpk.py +++ b/hooke/driver/jpk.py @@ -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') -- 2.26.2