(generalvclamp.py) now linefit_between accepts whatset
authordevicerandom <devnull@localhost>
Tue, 3 Mar 2009 15:58:29 +0000 (15:58 +0000)
committerdevicerandom <devnull@localhost>
Tue, 3 Mar 2009 15:58:29 +0000 (15:58 +0000)
generalvclamp.py

index e200a59910bcd3bb643667073931fbb6941cbb9d..ebd3e084067377b7ebfe73c134f49f24e229cbc2 100644 (file)
@@ -270,7 +270,7 @@ class generalvclampCommands:
         
         self._send_plot([lineplot])
 
-    def linefit_between(self,index1,index2):
+    def linefit_between(self,index1,index2,whatset=1):
         '''
         Creates two vectors (xtofit,ytofit) slicing out from the
         current return trace a portion delimited by the two indexes
@@ -282,8 +282,8 @@ class generalvclampCommands:
         (c) Marco Brucale, Massimo Sandal 2008
         '''
         # Translates the indexes into two vectors containing the x,y data to fit
-        xtofit=self.plots[0].vectors[1][0][index1:index2]
-        ytofit=self.plots[0].vectors[1][1][index1:index2]
+        xtofit=self.plots[0].vectors[whatset][0][index1:index2]
+        ytofit=self.plots[0].vectors[whatset][1][index1:index2]
         
         # Does the actual linear fitting (simple least squares with numpy.polyfit)
         linefit=[]