Files
x03da/script/test/TestGenerator.py
gac-x03da 5ff752da53 Closedown
2019-06-19 09:50:03 +02:00

44 lines
1.1 KiB
Python

import ch.psi.pshell.device.DummyPositioner as DummyPositioner
#Energy #Pass Energy
STEPS = [ ( 136.0, 10 , 5.0),
( 350.5, 20 , 6.0),
( 400.0, 50 , 7.0),
]
SETTLING_TIME = 1.0
SENSORS = [MachineCurrent, SampleCurrent, RefCurrent] #, Scienta.getChild("Scienta pass energy")
ENDSCAN = False
class PassEnergy(Writable):
def write(self, value):
Scienta.setPassEnergy(50)
energy = DummyPositioner("energy")
pass_energy = PassEnergy()
def scan_gen():
while True:
for step in STEPS:
yield step
POSITIONERS = [energy, pass_energy, Scienta.getChild("Scienta step time")]
try:
vscan( POSITIONERS,
SENSORS,
scan_gen(),
line = True,
latency=SETTLING_TIME,
domain_axis = "Index",
enabled_plots = POSITIONERS + SENSORS
#range = [-10.0,10.0, -10.0, 10.0]
)
finally:
if ENDSCAN:
after_scan()