Only pass curve params out to segments if they exist.
authorW. Trevor King <wking@drexel.edu>
Wed, 8 Sep 2010 20:02:24 +0000 (16:02 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 8 Sep 2010 20:02:24 +0000 (16:02 -0400)
hooke/driver/jpk.py

index 39dea4f1f17fe93d20bfb27763e6e8661bf10a0f..92c9a8da63c6ae21fd63bd9aa4abd834cbb93b4b 100644 (file)
@@ -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):