From: W. Trevor King Date: Tue, 24 Jan 2012 13:02:08 +0000 (-0500) Subject: Make ExceptionTooFar check more robust with .max(). X-Git-Tag: v0.2~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7f07cba56273d4bc9895d41383dd5f65a1482a4d;p=unfold-protein.git Make ExceptionTooFar check more robust with .max(). --- 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)