From 74e6cfc815f01f735653e1f45fe5cd221dea5127 Mon Sep 17 00:00:00 2001 From: marcobrucale Date: Mon, 22 Jun 2009 10:52:13 +0000 Subject: [PATCH] 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. --- generalvclamp.py | 26 +++++++++ hooke.conf | 141 ++++++++++++++++++++++++----------------------- libhookecurve.py | 2 +- 3 files changed, 98 insertions(+), 71 deletions(-) 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=[] -- 2.26.2