#
# 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
from .. import curve as curve # this module defines data containers.
from .. import experiment as experiment # this module defines expt. types
-from ..config import Setting # configurable setting class
from . import Driver as Driver # this is the Driver base class
return header[2:17] == 'Force file list'
- def read(self, path):
+ def read(self, path, info=None):
info = self._read_header_path(path)
self._check_version(info)
data = self._read_data_path(path, info)
match = type_re.match(image['@4:Image Data'])
assert match != None, 'Bad regexp for %s, %s' \
% ('@4:Image Data', image['@4:Image Data'])
- assert match.group(1).lower() == match.group(2).replace(' ','').lower(), \
- 'Name missmatch: "%s", "%s"' % (match.group(1), match.group(2))
+ if version == '0x06130001' and match.group(1) == 'ZLowVoltage':
+ assert match.group(2) == 'Low Voltage Z', \
+ 'Name missmatch: "%s", "%s"' % (match.group(1), match.group(2))
+ else:
+ assert match.group(1).lower() == match.group(2).replace(' ','').lower(), \
+ 'Name missmatch: "%s", "%s"' % (match.group(1), match.group(2))
tname = match.group(2)
else:
assert version == '0x07200000', version
# offset assumed if raw data is signed...
nm_sens_re = re.compile('V ([.0-9]*) nm/V')
- match = nm_sens_re.match(info['Scanner list']['@Sens. Zsens'])
- assert match != None, 'Bad regexp for %s/%s, %s' \
- % ('Scanner list', '@Sens. Zsens', info['Scanner list']['@4:Z scale'])
+ if version in ['0x06120002', '0x06130001']:
+ match = nm_sens_re.match(info['Ciao scan list']['@Sens. ZSensorSens'])
+ assert match != None, 'Bad regexp for %s/%s, %s' \
+ % ('Ciao scan list', '@Sens. ZSensorSens',
+ info['Ciao scan list']['@Sens. ZSensorSens'])
+ else:
+ assert version == '0x07200000', version
+ match = nm_sens_re.match(info['Ciao scan list']['@Sens. ZsensSens'])
+ assert match != None, 'Bad regexp for %s/%s, %s' \
+ % ('Ciao scan list', '@Sens. ZsensSens',
+ info['Ciao scan list']['@Sens. ZsensSens'])
ret['z piezo sensitivity (m/V)'] = float(match.group(1))*1e-9
match = nm_sens_re.match(info['Ciao scan list']['@Sens. DeflSens'])