_LOG.info('step back %d steps (~%g m)' % (steps, distance))
stepper.step_relative(-steps)
-def calib_acquire(afm, calibration_config, bump_config, temperature_config,
- vibration_config, filename=None, group='/'):
+def calib_acquire(afm, calibration_config, filename=None, group='/'):
"""Acquire data for calibrating a cantilever in one function.
Inputs:
afm a pyafm.AFM instance
calibration_config a .config._CalibrationConfig instance
- bump_config a .config._BumpConfig instance
- temperature_config a .config._TConfig instance
- vibration_config a .config._VibrationConfig instance
Outputs (all are arrays of recorded data):
bumps measured (V_photodiode / nm_tip) proportionality constant
bumps = _zeros((calibration_config['num-bumps'],), dtype=_float)
for i in range(calibration_config['num-bumps']):
_LOG.info('acquire bump %d of %d' % (i, calibration_config['num-bumps']))
- bumps[i] = _bump(afm=afm, bump_config=bump_config,
+ bumps[i] = _bump(afm=afm, bump_config=calibration_config['bump'],
filename=filename, group='%sbump/%d/' % (group, i))
_LOG.debug('bumps: %s' % bumps)
_LOG.info('acquire T %d of %d'
% (i, calibration_config['num-temperatures']))
Ts[i] = _T(
- get_T=afm.get_temperature, temperature_config=temperature_config,
+ get_T=afm.get_temperature,
+ temperature_config=calibration_config['temperature'],
filename=filename, group='%stemperature/%d/' % (group, i))
_sleep(calibration_config['temperature-sleep'])
_LOG.debug('temperatures: %s' % Ts)
vibs = _zeros((calibration_config['num-vibrations'],), dtype=_float)
for i in range(calibration_config['num-vibrations']):
vibs[i] = _vib(
- piezo=afm.piezo, vibration_config=vibration_config,
+ piezo=afm.piezo, vibration_config=calibration_config['vibration'],
filename=filename, group='%svibration/%d/' % (group, i))
_LOG.debug('vibrations: %s' % vibs)
return (bumps, Ts, vibs)
-def calib(afm, calibration_config, bump_config, temperature_config,
- vibration_config, filename=None, group='/'):
+def calib(afm, calibration_config, filename=None, group='/'):
"""Calibrate a cantilever in one function.
Inputs:
>>> import os
>>> from pprint import pprint
>>> import tempfile
+ >>> from h5config.storage.hdf5 import pprint_HDF5
>>> from pycomedi.device import Device
>>> from pycomedi.subdevice import StreamingSubdevice
>>> from pycomedi.channel import AnalogChannel, DigitalChannel
>>> from pycomedi.constant import AREF, IO_DIRECTION, SUBDEVICE_TYPE, UNIT
>>> from pypiezo.afm import AFMPiezo
>>> from pypiezo.base import PiezoAxis, InputChannel
- >>> from pypiezo.config import (HDF5_ChannelConfig, HDF5_AxisConfig,
- ... pprint_HDF5)
+ >>> from pypiezo.config import ChannelConfig, AxisConfig
>>> from stepper import Stepper
>>> from pyafm import AFM
- >>> from .config import (HDF5_CalibrationConfig, HDF5_BumpConfig,
- ... HDF5_TemperatureConfig, HDF5_VibrationConfig)
+ >>> from .config import (CalibrationConfig, BumpConfig,
+ ... TemperatureConfig, VibrationConfig)
>>> from .analyze import calib_load_all
>>> fd,filename = tempfile.mkstemp(suffix='.h5', prefix='calibcant-')
first few surface approaching steps, which could lead to an
`EdgeKink` error instead of a `FlatFit` error.
- >>> axis_config = HDF5_AxisConfig(filename, '/bump/config/z/axis')
+ >>> axis_config = AxisConfig()
>>> axis_config.update(
... {'gain':20, 'sensitivity':8e-9, 'minimum':-9})
- >>> axis_channel_config = HDF5_ChannelConfig(
- ... filename, '/bump/config/z/channel')
- >>> input_channel_config = HDF5_ChannelConfig(
- ... filename, '/bump/config/deflection/channel')
+ >>> axis_channel_config = ChannelConfig()
+ >>> input_channel_config = ChannelConfig()
>>> a = PiezoAxis(axis_config=axis_config,
... axis_channel_config=axis_channel_config,
Test calibration:
- >>> calibration_config = HDF5_CalibrationConfig(
- ... filename=filename, group='/bump/config/calibration/')
- >>> bump_config = HDF5_BumpConfig(
- ... filename=filename, group='/bump/config/bump/')
- >>> temperature_config = HDF5_TemperatureConfig(
- ... filename=filename, group='/bump/config/temperature/')
- >>> vibration_config = HDF5_VibrationConfig(
- ... filename=filename, group='/bump/config/vibration')
+ >>> calibration_config = CalibrationConfig()
+ >>> bump_config = BumpConfig()
+ >>> temperature_config = TemperatureConfig()
+ >>> vibration_config = VibrationConfig()
>>> calib(afm, calibration_config, bump_config, temperature_config,
... vibration_config, filename=filename, group='/')
TODO: replace skipped example data with real-world values