From 82bf697d46ca589c9ddc4bf4be4cb1d24ec3352d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 18 Jan 2013 22:56:04 -0500 Subject: [PATCH] calibcant-calibrate.py: Record the stepper approach trace Sometimes these approach curves are pretty funky, so I'll start recording them by default. --- bin/calibcant-calibrate.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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: -- 2.26.2