Copy spring constant into block info in JPK driver.
authorW. Trevor King <wking@drexel.edu>
Thu, 19 Aug 2010 11:56:41 +0000 (07:56 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 19 Aug 2010 11:56:41 +0000 (07:56 -0400)
Although JPK's curve-level spring constant makes more sense.  Perhaps
I will convert all drivers to store it there in the future.

hooke/driver/jpk.py

index 30fabdf0c0817a162687fcc32e3489b5110f249b..800f78e13ba70835145634a92c0affb467ce63a0 100644 (file)
@@ -83,9 +83,12 @@ class JPKDriver (Driver):
                 raise ValueError(
                     'No segment for %s in %s, only %s'
                     % (name, path, [s.info['name'] for s in segments]))
-        return (segments,
-                self._zip_translate_params(zip_info,
-                                           segments[0].info['raw info']))
+        curve_info = self._zip_translate_params(zip_info,
+                                                segments[0].info['raw info'])
+        for segment in segments:
+            segment.info['spring constant (N/m)'] = \
+                curve_info['spring constant (N/m)']
+        return (segments,curve_info)
 
     def _zip_info(self, zipfile):
         with Closing(zipfile.open('header.properties')) as f: