#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
'''
generalvclamp.py
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
+ 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.
'''
#multiplier is 1...
if (self.config['force_multiplier']==1):
- return plot\r
-\r
+ 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'] \r
-\r
+ 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']\r
-\r
- return plot \r
+ plot.vectors[1][1][i]=plot.vectors[1][1][i]*self.config['force_multiplier']
+
+ return plot
def plotmanip_flatten(self, plot, current, customvalue=False):
yrn=[0.0 for item in range(max_exponent)]
errn=[0.0 for item in range(max_exponent)]
+ #Check if we have a proper numerical value
+ try:
+ zzz=int(max_cycles)
+ except:
+ #Loudly and annoyingly complain if it's not a number, then fallback to zero
+ print '''Warning: flatten value is not a number!
+ Use "set flatten" or edit hooke.conf to set it properly
+ Using zero.'''
+ max_cycles=0
+
for i in range(int(max_cycles)):
x_ext=plot.vectors[0][0][contact_index+delta_contact:]