(fit.py , flatfilts.py) fixed severe bug in convfilt; now contact point is correctly...
authordevicerandom <devnull@localhost>
Thu, 27 Nov 2008 11:55:39 +0000 (11:55 +0000)
committerdevicerandom <devnull@localhost>
Thu, 27 Nov 2008 11:55:39 +0000 (11:55 +0000)
fit.py
flatfilts.py

diff --git a/fit.py b/fit.py
index bced87e8b149524df86e84c5d4908012513d4202..b843419afbbd4fea6a2242f322dd3630143958f1 100755 (executable)
--- a/fit.py
+++ b/fit.py
@@ -285,7 +285,7 @@ class fitCommands:
         
         self._send_plot([fitplot])
                 
-    def find_contact_point(self):
+    def find_contact_point(self,plot=False):
         '''
         Finds the contact point on the curve.
     
@@ -301,15 +301,19 @@ class fitCommands:
         
         FIXME: should be moved, probably to generalvclamp.py
         '''
+        
+        if not plot:
+            plot=self.plots[0]
+        
         outplot=self.subtract_curves(1)
         xret=outplot.vectors[1][0]
         ydiff=outplot.vectors[1][1]
+
+        xext=plot.vectors[0][0]
+        yext=plot.vectors[0][1]
+        xret2=plot.vectors[1][0]
+        yret=plot.vectors[1][1]
         
-        xext=self.plots[0].vectors[0][0]
-        yext=self.plots[0].vectors[0][1]
-        xret2=self.plots[0].vectors[1][0]
-        yret=self.plots[0].vectors[1][1]
-    
         #taking care of the picoforce trigger bug: we exclude portions of the curve that have too much
         #standard deviation. yes, a lot of magic is here.
         monster=True
index e0283b5e6e0e14b11b816c2849244ece6f7d1670..f7e729ed935e98dfee72d961d2177773750438f3 100755 (executable)
@@ -158,8 +158,7 @@ class flatfiltsCommands:
         convoluted=lps.conv_dx(yret, self.convfilt_config['convolution'])
         
         #surely cut everything before the contact point
-        cut_index=self.find_contact_point()
-        
+        cut_index=self.find_contact_point(plot)
         #cut even more, before the blind window
         start_x=xret[cut_index]
         blind_index=0
@@ -168,7 +167,6 @@ class flatfiltsCommands:
                 break
             blind_index+=1
         cut_index+=blind_index
-        
         #do the dirty convolution-peak finding stuff
         noise_level=lps.noise_absdev(convoluted[cut_index:], self.convfilt_config['positive'], self.convfilt_config['maxcut'], self.convfilt_config['stable'])               
         above=lps.abovenoise(convoluted,noise_level,cut_index,abs_devs)     
@@ -222,8 +220,6 @@ class flatfiltsCommands:
         if len(args)==0:
             args=self.convfilt_config['mindeviation']
         
-           
-        
         try:
             abs_devs=float(args)
         except:
@@ -296,7 +292,6 @@ class flatfiltsCommands:
         print '(Please wait)'
         notflat_list=[]
         
-        
         c=0
         for item in self.current_list:
             c+=1
@@ -334,6 +329,7 @@ class flatfiltsCommands:
             self.current=self.current_list[self.pointer]
             self.do_plot(0)
         
+        
     def do_setconv(self,args):
         '''
         SETCONV