From 2db803a170da4792c4bcd11228da56038cb4261e Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 8 Sep 2010 16:02:24 -0400 Subject: [PATCH] Only pass curve params out to segments if they exist. --- hooke/driver/jpk.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hooke/driver/jpk.py b/hooke/driver/jpk.py index 39dea4f..92c9a8d 100644 --- a/hooke/driver/jpk.py +++ b/hooke/driver/jpk.py @@ -85,8 +85,12 @@ class JPKDriver (Driver): curve_info = self._zip_translate_params( zip_info, segments[0].info['raw info'], version) for segment in segments: # HACK, should use curve-level spring constant - segment.info['spring constant (N/m)'] = \ - curve_info['spring constant (N/m)'] + for key in ['spring constant (N/m)', + 'z piezo sensitivity (m/V)']: + if key in curve_info: + segment.info['spring constant (N/m)'] = \ + curve_info['spring constant (N/m)'] + return (segments, curve_info) def _zip_info(self, zipfile): -- 2.26.2