#
# This file is part of Hooke.
#
-# Hooke is free software: you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation, either
-# version 3 of the License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
-# Hooke is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+# Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Hooke. If not, see
# <http://www.gnu.org/licenses/>.
-"""Hooke driver for W. Trevor King's velocity clamp data format.
+"""Driver for W. Trevor King's velocity clamp data format.
See my related projects:
return False
return True
- def read(self, path):
+ def read(self, path, info=None):
approach_path,retract_path,param_path = self._paths(path)
unlabeled_approach_data = numpy.loadtxt(
unlabeled_approach_data, params, 'approach')
retract = self._scale_block(
unlabeled_retract_data, params, 'retract')
- info = {'filetype':'wtk', 'experiment':experiment.VelocityClamp}
+ info = {'filetype':self.name, 'experiment':experiment.VelocityClamp}
return ([approach, retract], info)
def _paths(self, path):
array in SI units.
"""
ret = curve.Data(
- shape=data.shape,
+ shape=(data.shape[0], 2),
dtype=numpy.float,
info=copy.deepcopy(info)
)
* info['z piezo sensitivity (m/V)']
)
- ret[:,d_scol] = (
+ # Leading '-' because deflection voltage increases as the tip
+ # moves away from the surface, but it makes more sense to me
+ # to have it increase as it moves toward the surface (positive
+ # tension on the protein chain).
+ ret[:,d_scol] = -(
(data[:,d_rcol]
* info['deflection sensitivity (V/bit)']
- info['deflection offset (V)'])
if self._calibfile_timestamp(calibfiles[i]) > timestamp:
i -= 1
break
- return os.path.join(dir, calibfiles[i])
+ return calibfiles[i]
def _read_cantilever_calibration_file(self, filename):
ret = {'file': filename}