Added EFILE debugging output to ExceptionTooClose case.
authorW. Trevor King <wking@drexel.edu>
Wed, 3 Jun 2009 19:22:41 +0000 (15:22 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 3 Jun 2009 19:23:08 +0000 (15:23 -0400)
unfold.py

index fddcbde22f065203ce0373c8b9e04fa8c9e6422c..1d8b5869d79ceb05a190a416f61b3bc0d7d8fa54 100644 (file)
--- a/unfold.py
+++ b/unfold.py
@@ -136,18 +136,25 @@ class unfold :
                 self.stepCloser()
                 EFILE.write('step closer successful\n'); EFILE.flush()
             except ExceptionTooClose :
+                EFILE.write('caught ExceptionTooFar\n'); EFILE.flush()
                 try : # try for a useful surface distance...
                     if setpoint == None : # !HACK !redundant!
                         assert rel_setpoint != None, "must have some sort of setpoint"
                         setpoint = self.curDef() + rel_setpoint
                         print "setpoint = %g" % setpoint
+                    EFILE.write('attempt getSurfPos\n'); EFILE.flush()
                     surfPos = self.getSurfPos(setpoint)
+                    EFILE.write('getSurfPos succeeded\n'); EFILE.flush()
                     print "Too close (surface at %g nm), stepping away" % surfPos
                 except z_piezo_utils.poorFit, string : # ... oh well, print what we know
+                    EFILE.write('getSurfPos failed\n'); EFILE.flush()
                     print "Too close, stepping away"
                     print "(Fit failed with: %s)" % string
+                EFILE.write('zero Z piezo\n'); EFILE.flush()
                 self.zp.jumpToPos(self.zp.pos_nm2out(0))
+                EFILE.write('step away\n'); EFILE.flush()
                 self.stepAway()
+                EFILE.write('step away successful\n'); EFILE.flush()
             print "Too close, stepping away"
         return data
     def stepApproach(self, setpoint) :