Update to piezo v0.3 (based on data_logger 0.4) and bump to v0.5.
[calibcant.git] / calibcant / calibrate.py
index 636b113aa8c25f92ef80e581a2bbe094c7c9c637..c2fb1b848034174c972ee7ac8d4f5d0b4b12d134 100755 (executable)
@@ -2,26 +2,23 @@
 #
 # calibcant - tools for thermally calibrating AFM cantilevers
 #
-# Copyright (C) 2007,2008, William Trevor King
+# Copyright (C) 2008-2010 W. Trevor King <wking@drexel.edu>
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 3 of the
-# License, or (at your option) any later version.
+# This file is part of CalibCant.
 #
-# This program 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 General Public License for more details.
+# CalibCant 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.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# CalibCant 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.
 #
-# The author may be contacted at <wking@drexel.edu> on the Internet, or
-# write to Trevor King, Drexel University, Physics Dept., 3141 Chestnut St.,
-# Philadelphia PA 19104, USA.
+# You should have received a copy of the GNU Lesser General Public
+# License along with CalibCant.  If not, see
+# <http://www.gnu.org/licenses/>.
 
 """
 Aquire and analyze cantilever calibration data.
@@ -104,17 +101,19 @@ which make automating the calibration procedure more straightforward.
 
 import numpy
 import time 
-import z_piezo_utils
+
+import FFT_tools
+import piezo.z_piezo_utils as z_piezo_utils
 from splittable_kwargs import splittableKwargsFunction, \
     make_splittable_kwargs_function
-import FFT_tools
 
-import common
-import config
-import bump_analyze
-import T_analyze
-import vib_analyze
-import analyze
+from . import common
+from . import config
+from . import bump_analyze
+from . import T_analyze
+from . import vib_analyze
+from . import analyze
+
 
 # bump family
 
@@ -367,9 +366,9 @@ def calib_aquire(stepper, zpiezo, num_bumps=10, num_Ts=10, num_vibs=20,
         T_kwargs,vib_kwargs,calib_save_kwargs = \
         calib_aquire._splitargs(calib_aquire, kwargs)
     # get bumps
-    move_just_onto_surface(stepper, zpiezo, **move_just_onto_surface_kwargs)
     bumps = numpy.zeros((num_bumps,), dtype=numpy.float)
     for i in range(num_bumps) :
+        move_just_onto_surface(stepper, zpiezo, **move_just_onto_surface_kwargs)
         bumps[i] = bump(zpiezo=zpiezo, log_dir=log_dir,
                         Vphoto_in2V=Vphoto_in2V, **bump_kwargs)
     if config.TEXT_VERBOSE :