From: marcobrucale Date: Mon, 22 Jun 2009 10:52:13 +0000 (+0000) Subject: Just added a new config variable, "force_multiplier", which unsurprisingly muliplies... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ced26fe126bf14842c2738aeb2fadbcc3f336bb9;p=hooke.git Just added a new config variable, "force_multiplier", which unsurprisingly muliplies each Y on an SMFS curve. Default value is 1. This is sometimes useful for calibration. --- diff --git a/generalvclamp.py b/generalvclamp.py index 7cccf0b..1c71de0 100644 --- a/generalvclamp.py +++ b/generalvclamp.py @@ -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) + + def plotmanip_multiplier(self, plot, current): + ''' + Multiplies all the Y values of an SMFS curve by a value stored in the 'force_multiplier' + 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 + + for i in range(len(plot.vectors[0][1])): + plot.vectors[0][1][i]=plot.vectors[0][1][i]*self.config['force_multiplier'] + + for i in range(len(plot.vectors[1][1])): + plot.vectors[1][1][i]=plot.vectors[1][1][i]*self.config['force_multiplier'] + + return plot + def plotmanip_flatten(self, plot, current, customvalue=False): ''' diff --git a/hooke.conf b/hooke.conf index 6391e3b..8c72cb6 100755 --- a/hooke.conf +++ b/hooke.conf @@ -1,70 +1,71 @@ - - - - - - - - - insert directory - - - - - test.hkp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + insert directory + + + + + test.hkp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libhookecurve.py b/libhookecurve.py index 1141783..37cd1b1 100755 --- a/libhookecurve.py +++ b/libhookecurve.py @@ -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=[]