From: W. Trevor King Date: Wed, 8 Sep 2010 20:02:24 +0000 (-0400) Subject: Only pass curve params out to segments if they exist. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2db803a170da4792c4bcd11228da56038cb4261e;p=hooke.git Only pass curve params out to segments if they exist. --- 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):