From 7f07cba56273d4bc9895d41383dd5f65a1482a4d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 24 Jan 2012 08:02:08 -0500 Subject: [PATCH] Make ExceptionTooFar check more robust with .max(). --- unfold_protein/unfolder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unfold_protein/unfolder.py b/unfold_protein/unfolder.py index ae835f6..fb289dc 100755 --- a/unfold_protein/unfolder.py +++ b/unfold_protein/unfolder.py @@ -105,8 +105,10 @@ class Unfolder (object): step=step_bits, frequency=frequency, return_data=True) data['setpoint'] = setpoint # check the output - if data['deflection'][-1] < setpoint_bits: - _LOG.info('unfolding too far from the surface') + if data['deflection'].max() < setpoint_bits: + _LOG.info(('unfolding too far from the surface ' + '(def {} < target {})').format( + data['deflection'].max(), setpoint_bits)) self.afm.piezo.jump(self.afm.axis_name, start_pos) #if PYLAB_INTERACTIVE_VERBOSE == True: # figure(BASE_FIG_NUM+1) -- 2.26.2