Just added a new config variable, "force_multiplier", which unsurprisingly muliplies...
authormarcobrucale <devnull@localhost>
Mon, 22 Jun 2009 10:52:13 +0000 (10:52 +0000)
committermarcobrucale <devnull@localhost>
Mon, 22 Jun 2009 10:52:13 +0000 (10:52 +0000)
generalvclamp.py
hooke.conf
libhookecurve.py

index 7cccf0b2fc71e456c3e871dcfe2a42bd59de1b8e..1c71de0e03ab61074a9501cc31ce5f54e11fb301 100644 (file)
@@ -120,7 +120,33 @@ class generalvclampCommands:
         print str(forcebase*(10**12))+' pN'
         to_dump='forcebase '+self.current.path+' '+str(forcebase*(10**12))+' pN'
         self.outlet.push(to_dump)
+\r
+    def plotmanip_multiplier(self, plot, current):
+        '''
+        Multiplies all the Y values of an SMFS curve by a value stored in the 'force_multiplier'\r
+        configuration variable. Useful for calibrations and other stuff.
+        '''
+        
+        #not a smfs curve...
+        if current.curve.experiment != 'smfs':
+            return plot
+        
+        #only one set is present...
+        if len(self.plots[0].vectors) != 2:
+            return plot
         
+        #multiplier is 1...
+        if (self.config['force_multiplier']==1):
+            return plot\r
+\r
+        for i in range(len(plot.vectors[0][1])):
+            plot.vectors[0][1][i]=plot.vectors[0][1][i]*self.config['force_multiplier']        \r
+\r
+        for i in range(len(plot.vectors[1][1])):
+            plot.vectors[1][1][i]=plot.vectors[1][1][i]*self.config['force_multiplier']\r
+\r
+        return plot            \r
+   
     
     def plotmanip_flatten(self, plot, current, customvalue=False):
         '''
index 6391e3bab5ce19515710195b7c32bc30a96a5f71..8c72cb65b97ac1980d3861a2ef8f5e10e9807380 100755 (executable)
@@ -1,70 +1,71 @@
-<?xml version="1.0" ?>
-<!-- To comment something, put dashes and ! like here -->
-<config>
-<!-- Internal variabls. -->
-    <display ext="1" colour_ext="None" ret="1" colour_ret="None" correct="1" colour_correct="None" contact_point="0" medfilt="0" xaxes="0" yaxes="0" flatten="1" temperature="301" auto_fit_points="50" auto_slope_span="20" auto_delta_force="10" auto_fit_nm="5" auto_min_p="0.005" auto_max_p="10" baseline_clicks="0" auto_left_baseline="20" auto_right_baseline="20" fc_showphase="0" fc_showimposed="0" fc_interesting="0" tccd_threshold="0" tccd_coincident="0"/>
-
-<!-- 
-The following section defines your own work directory. Substitute your work directory.
-     -->
-<workdir>
-    insert directory
-</workdir>
-
-<!--
-The following section defines the default playlist to load at startup.
--->
-<defaultlist>
-    test.hkp
-</defaultlist>
-
-<!--
-This section defines which plugins have to be loaded by Hooke.
-    -->
-<plugins>
-    <fit/>
-    <procplots/>
-    <flatfilts/>
-    <generalclamp/>
-    <!-- dummyguiplug/ -->
-    <!-- superimpose/ -->
-    <generalvclamp/>
-    <massanalysis/>
-    <viewer/>
-    <!-- tutorial/ -->
-    <macro/>
-    <autopeak/>
-    <pcluster/>
-    <generaltccd/>
-</plugins>
-
-<!--
-This section defines which drivers have to be loaded by Hooke.
-    -->
-<drivers>
-    <picoforce/>
-    <!-- picoforcealt/ -->
-    <hemingclamp/>
-    <csvdriver/>
-    <!-- tutorialdriver/ -->
-    <jpk/>
-    <mfp1dexport/>
-    <mcs/>
-</drivers>
-
-<!--
-This section defines which plot manipulators have to be loaded by Hooke,
-and -IMPORTANTLY- their order.
-    -->
-<plotmanips>
-    <correct/>
-    <median/>
-    <!-- absvalue/ -->
-    <flatten/>
-    <clamp/>
-    <threshold/>
-    <coincident/>
-</plotmanips>
-
-</config>
-
+<?xml version="1.0" ?>\r
+<!-- To comment something, put dashes and ! like here -->\r
+<config>\r
+<!-- Internal variabls. -->\r
+    <display ext="1" colour_ext="None" ret="1" colour_ret="None" correct="1" colour_correct="None" contact_point="0" medfilt="0" xaxes="0" yaxes="0" flatten="1" temperature="301" auto_fit_points="50" auto_slope_span="20" auto_delta_force="10" auto_fit_nm="5" auto_min_p="0.005" auto_max_p="10" baseline_clicks="0" auto_left_baseline="20" auto_right_baseline="20" force_multiplier="1" fc_showphase="0" fc_showimposed="0" fc_interesting="0" tccd_threshold="0" tccd_coincident="0"/>\r
+\r
+<!-- \r
+The following section defines your own work directory. Substitute your work directory.\r
+     -->\r
+<workdir>\r
+    insert directory\r
+</workdir>\r
+\r
+<!--\r
+The following section defines the default playlist to load at startup.\r
+-->\r
+<defaultlist>\r
+    test.hkp\r
+</defaultlist>\r
+\r
+<!--\r
+This section defines which plugins have to be loaded by Hooke.\r
+    -->\r
+<plugins>\r
+    <fit/>\r
+    <procplots/>\r
+    <flatfilts/>\r
+    <generalclamp/>\r
+    <!-- dummyguiplug/ -->\r
+    <!-- superimpose/ -->\r
+    <generalvclamp/>\r
+    <massanalysis/>\r
+    <viewer/>\r
+    <!-- tutorial/ -->\r
+    <macro/>\r
+    <autopeak/>\r
+    <pcluster/>\r
+    <generaltccd/>\r
+</plugins>\r
+\r
+<!--\r
+This section defines which drivers have to be loaded by Hooke.\r
+    -->\r
+<drivers>\r
+    <picoforce/>\r
+    <!-- picoforcealt/ -->\r
+    <hemingclamp/>\r
+    <csvdriver/>\r
+    <!-- tutorialdriver/ -->\r
+    <jpk/>\r
+    <mfp1dexport/>\r
+    <mcs/>\r
+</drivers>\r
+\r
+<!--\r
+This section defines which plot manipulators have to be loaded by Hooke,\r
+and -IMPORTANTLY- their order.\r
+    -->\r
+<plotmanips>\r
+    <correct/>\r
+    <median/>\r
+    <!-- absvalue/ -->\r
+    <flatten/>\r
+    <multiplier/>\r
+    <clamp/>\r
+    <threshold/>\r
+    <coincident/>\r
+</plotmanips>\r
+\r
+</config>\r
+\r
index 11417834d196e62bb4ad753a4ed20e851372885e..37cd1b11bba4213629b0a9fd9b89b21c3f40ad47 100755 (executable)
@@ -103,7 +103,7 @@ class PlotObject:
         '''
         styles: defines what is the style of the current plots. If undefined or None, it is line plot.
         If an element of the list is 'scatter', the corresponding dataset
-       is drawn with scattered points and not a continuous line.
+        is drawn with scattered points and not a continuous line.
         '''
         self.styles=[]