scan
index
c:\python23\scan.py

Scan class
Author : Olivier Tache' <olivier.tache(a)cea.fr>
Date : 02-05-2006
 
CEA / DSM / DRECAM / SCM / LIONS
http://www-drecam.cea.fr/scm/lions

 
Modules
       
Gnuplot
Numeric
os

 
Classes
       
Scan

 
class Scan
    class Scan
Offer the posibilities to do some actions and scientific
measures synchronously.
Results are print to screen and can be plot with gnuplot in real time.
 
  Methods defined here:
__init__(self)
__repr__(self)
get a str representation of class
__str__(self)
addAction(self, Action, Sequence, name='?')
Add an action (function) to process
with parameters in Sequence
ActionName is a string which represent the physical value
ex :
>>> s.addAction(moveMotor,[1,2,3,4,5],'theta')
Each action function must have the same numbers of parameters
(if different, last one is used) except
a function without parameters
ex :
>>>s.addAction(doSomething,[])
addMeasure(self, function, name, *args)
Add a measure action
Measure : function to execute and which return a result
*Parameters : parameters for the function
ex :
>>> def x2(x,y):
        return x*y
>>> s.addMeasure(x2,'x2',1,2)
addPlot(plot)
link to a gnuplot instance
execute(self)
execute action

Data and other attributes defined here:
DataFilename = r'C:\Python23\temp.txt'
GnuplotCommand = ''
GnuplotInstance = ''
GnuplotParameters = ''
GnuplotParametersFile = ''
ListAction = []
ListMeasure = []
OptionPlot = True
OptionSave = False
results = []

 
Functions
       
simpleScan(action, sequence, actionName, measure, measureName, *args)
perform a simple scan :
one action (action, sequence and actionName)
one Measure(measure,arg and measureName)
 
return : a gnuplot instance

 
Data
        FilenameTemp = r'C:\Python23\temp.txt'
GnuplotSeparator = '\t'
NoParameter = ''