Updated documentation for calibcant.calibrate.calib_aquire.
[calibcant.git] / calibcant / calibrate.py
index f78520ffe5ed6f4f41a7c54b4a9c61330b8f9b17..636b113aa8c25f92ef80e581a2bbe094c7c9c637 100755 (executable)
@@ -230,13 +230,14 @@ def vib(**kwargs) :
 # with proper spacing relative to the surface.
 
 @splittableKwargsFunction()
-def move_just_onto_surface(stepper, zpiezo, Depth_nm=100, setpoint=2) :
+def move_just_onto_surface(stepper, zpiezo, Depth_nm=-50, setpoint=2) :
     """
-    Uses z_piezo_utils.getSurfPos() to pinpoint the position of the surface.
-    Adjusts the stepper position as required to get within stepper_tol nm
-    of the surface.
-    Then set Vzp to place the cantilever Depth_nm onto the surface.
-
+    Uses z_piezo_utils.getSurfPos() to pinpoint the position of the
+    surface.  Adjusts the stepper position as required to get within
+    stepper_tol nm of the surface.  Then set Vzp to place the
+    cantilever Depth_nm onto the surface.  Negative Depth_nm values
+    will place the cantilever that many nm _off_ the surface.
+    
     If getSurfPos() fails to find the surface, backs off (for safety)
     and steps in (without moving the zpiezo) until Vphoto > setpoint.
     """
@@ -333,13 +334,12 @@ def move_far_from_surface(stepper, um_back=50) :
 # and finally, the calib family
 
 @splittableKwargsFunction((move_just_onto_surface, 'stepper', 'zpiezo'),
-                          (bump, 'zpiezo', 'freq', 'log_dir', 'Vphoto_in2V'),
+                          (bump, 'zpiezo', 'log_dir', 'Vphoto_in2V'),
                           (move_far_from_surface, 'stepper'),
                           (T, 'log_dir'),
                           (vib, 'zpiezo', 'log_dir', 'Vphoto_in2V'),
                           (analyze.calib_save, 'bumps','Ts','vibs','log_dir'))
 def calib_aquire(stepper, zpiezo, num_bumps=10, num_Ts=10, num_vibs=20,
-                 bump_freq=100e3,
                  log_dir=config.LOG_DIR, Vphoto_in2V=config.Vphoto_in2V,
                  **kwargs):
     """
@@ -348,12 +348,16 @@ def calib_aquire(stepper, zpiezo, num_bumps=10, num_Ts=10, num_vibs=20,
     Inputs :
      stepper       a stepper.stepper_obj for coarse Z positioning
      zpiezo        a z_piezo.z_piezo for fine positioning and deflection readin
-     setpoint      maximum allowed deflection (in Volts) during approaches
-     num_bumps     number of 'a's (see Outputs)
-     push_depth_nm depth of each push when generating a
-     num_temps     number of 'T's (see Outputs)
+     num_bumps     number of 'bumps' (see Outputs)
+     num_temps     number of 'Ts' (see Outputs)
      num_vibs      number of 'vib's (see Outputs)
      log_dir       directory to log data to.  Default 'None' disables logging.
+     Vphoto_in2V   function to convert photodiode input bits to Volts
+
+     + other kwargs.  Run calib_aquire._kwargs(calib_aquire) to see
+     all options.  Run calib_aquire._childSplittables to see a list
+     of kwarg functions that this function calls.
+
     Outputs (all are arrays of recorded data) :
      bumps measured (V_photodiode / nm_tip) proportionality constant
      Ts    measured temperature (K)
@@ -366,7 +370,7 @@ def calib_aquire(stepper, zpiezo, num_bumps=10, num_Ts=10, num_vibs=20,
     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) :
-        bumps[i] = bump(zpiezo=zpiezo, freq=bump_freq, log_dir=log_dir,
+        bumps[i] = bump(zpiezo=zpiezo, log_dir=log_dir,
                         Vphoto_in2V=Vphoto_in2V, **bump_kwargs)
     if config.TEXT_VERBOSE :
         print bumps