Startup
This commit is contained in:
26
script/tutorial/09_PseudoDevices.py
Normal file
26
script/tutorial/09_PseudoDevices.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Using pseudo-device to :
|
||||
- Add calculations to scan data.
|
||||
- Execute logic during scan
|
||||
"""
|
||||
|
||||
class Clock(Readable):
|
||||
def read(self):
|
||||
return time.clock()
|
||||
|
||||
class Averager(Readable):
|
||||
def read(self):
|
||||
arr = wf1.take() #Gets the CACHED waveform
|
||||
return reduce(lambda x, y: x + y, arr) / len(arr)
|
||||
|
||||
class Positioner(Writable):
|
||||
def write(self,pos):
|
||||
print "Step = " + str(pos)
|
||||
|
||||
averager=Averager()
|
||||
clock=Clock()
|
||||
positioner=Positioner()
|
||||
|
||||
a= lscan((ao1,positioner),(ai2,wf1,averager,clock),(0,0),(40,20),20,0.1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user