From: W. Trevor King Date: Fri, 20 Aug 2010 11:03:50 +0000 (-0400) Subject: Convert JPK deflection sign to follow Hooke convention. X-Git-Url: http://git.tremily.us/?p=hooke.git;a=commitdiff_plain;h=ed4b22024590cbd929bb60c56d7804ef3f1b48d6 Convert JPK deflection sign to follow Hooke convention. --- 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')