From: W. Trevor King Date: Fri, 20 Aug 2010 08:13:26 +0000 (-0400) Subject: Set filetype and experiment fields in JPK driver. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ad742f632c255f70646e2f9dbb7b8a704512361b;p=hooke.git Set filetype and experiment fields in JPK driver. --- diff --git a/hooke/driver/jpk.py b/hooke/driver/jpk.py index 800f78e..1330713 100644 --- a/hooke/driver/jpk.py +++ b/hooke/driver/jpk.py @@ -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']