Set filetype and experiment fields in JPK driver.
authorW. Trevor King <wking@drexel.edu>
Fri, 20 Aug 2010 08:13:26 +0000 (04:13 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 20 Aug 2010 08:13:26 +0000 (04:13 -0400)
hooke/driver/jpk.py

index 800f78e13ba70835145634a92c0affb467ce63a0..1330713f4ac929eb60ef6605178b34bb0100e0a7 100644 (file)
@@ -88,7 +88,7 @@ class JPKDriver (Driver):
         for segment in segments:
             segment.info['spring constant (N/m)'] = \
                 curve_info['spring constant (N/m)']
-        return (segments,curve_info)
+        return (segments, curve_info)
 
     def _zip_info(self, zipfile):
         with Closing(zipfile.open('header.properties')) as f:
@@ -144,8 +144,16 @@ class JPKDriver (Driver):
     def _zip_translate_params(self, params, chan_info):
         info = {
             'raw info':params,
+            'filetype':self.name,
             #'time':self._time_from_TODO(raw_info[]),
             }
+        # TODO: distinguish between force clamp and velocity clamp
+        # experiments.  Note that the JPK file format is flexible
+        # enough to support mixed experiments (i.e. both force clamp
+        # and velocity clamp segments in a single experiment), but I
+        # have no idea what sort of analysis such experiments would
+        # require ;).
+        info['experiment'] = experiment.VelocityClamp
         force_unit = chan_info['channel']['vDeflection']['conversion-set']['conversion']['force']['scaling']['unit']['unit']
         assert force_unit == 'N', force_unit
         force_base = chan_info['channel']['vDeflection']['conversion-set']['conversion']['force']['base-calibration-slot']