posts:comparing_velocity_clamp_experiments: extract pull velocity.
authorW. Trevor King <wking@tremily.us>
Mon, 17 Sep 2012 18:03:04 +0000 (14:03 -0400)
committerW. Trevor King <wking@tremily.us>
Mon, 17 Sep 2012 18:03:04 +0000 (14:03 -0400)
For determining the expected unfolding force.

posts/Comparing_velocity_clamp_experiments/crunch.py

index f70829a7e02d0164dfbaa313085f2af7c6780929..99fc50ab7ff67adadb3c534f5067171e58271e67 100755 (executable)
@@ -155,6 +155,7 @@ def load_pull(filename=pull_file, with_temperature=True):
         alpha_v = _numpy.array(f['unfold']['z'][...].flat, dtype=float)
         alpha_f = _numpy.array(
             f['unfold']['deflection'][...].flat, dtype=float)
+        v = float(f['config']['unfold']['velocity'][...])
         if with_temperature:
             temperature = float(f['environment']['temperature'][...])
         else:
@@ -162,6 +163,7 @@ def load_pull(filename=pull_file, with_temperature=True):
     return {
         'alpha_v': alpha_v,
         'alpha_f': alpha_f,
+        'velocity': v,
         'temperature': temperature,
         }
 
@@ -594,15 +596,15 @@ class Pull (Experiment):
             'contour_space_model', 'contour_space_parameters',
             'contour_space_lines']
         kwargs['output_parameters'] = [
-            'pull_alpha_d', 'pull_temperature']
+            'pull_alpha_d', 'pull_velocity', 'pull_temperature']
         kwargs['output_parameter_units'] = {
-            'pull_alpha_d': 'diode_bit/piezo_bit',
+            'pull_alpha_d': 'diode_bit/piezo_bit', 'pull_velocity': 'm/s',
             'pull_temperature': 'K',
             }
         super(Pull, self).__init__(name=name, *args, **kwargs)
 
     @staticmethod
-    def _crunch(alpha_v, alpha_f, temperature,
+    def _crunch(alpha_v, alpha_f, velocity, temperature,
                 alpha_z, alpha_d, vibration_variance, vibration_temperature,
                 drift_slope, alpha_f_offset, start_sawteeth, stop_sawteeth,
                 contour_space_model, contour_space_parameters,
@@ -636,6 +638,7 @@ class Pull (Experiment):
         return {
             'pull_alpha_d': alpha_d,
             'pull_temperature': temperature,
+            'pull_velocity': velocity,
             'z': z,
             'f': f,
             'z_piezo': z_piezo,