From: W. Trevor King Date: Sat, 19 Jan 2013 03:56:04 +0000 (-0500) Subject: calibcant-calibrate.py: Record the stepper approach trace X-Git-Tag: 0.9~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=82bf697d46ca589c9ddc4bf4be4cb1d24ec3352d;p=calibcant.git calibcant-calibrate.py: Record the stepper approach trace Sometimes these approach curves are pretty funky, so I'll start recording them by default. --- diff --git a/bin/calibcant-calibrate.py b/bin/calibcant-calibrate.py index 5cf5a92..0ae2c0e 100755 --- a/bin/calibcant-calibrate.py +++ b/bin/calibcant-calibrate.py @@ -10,8 +10,10 @@ import argparse as _argparse import time as _time -from calibcant.calibrate import Calibrator as _Calibrator +import h5py as _h5py from pyafm.storage import load_afm as _load_afm + +from calibcant.calibrate import Calibrator as _Calibrator import calibcant.config as _config @@ -62,7 +64,11 @@ def main(args): calibrator.setup_config() deflection = afm.piezo.read_deflection() try: - afm.stepper_approach(target_deflection=deflection + 1e3) + position,deflection = afm.stepper_approach( + target_deflection=deflection + 1e3, record_data=True) + with _h5py.File(filename) as f: + f['/approach/position'] = position + f['/approach/deflection'] = deflection if insufficient_calibration_data: data = calibrator.acquire(filename=filename) else: