Files
x03da/script/users/EmpaMarcoMultiple.py
2019-06-23 19:48:48 +02:00

42 lines
1.1 KiB
Python

import ch.psi.pshell.device.DummyPositioner as DummyPositioner
#Energy #Pass Energy #Step Time
STEPS = [ ( 350.5, 50 , 5.0),
]
SETTLING_TIME = 0.0
SENSORS = [Counts, MachineCurrent, SampleCurrent, RefCurrent, EnergyDistribution, Scienta.getDataMatrix()]
ENDSCAN = False
STEP_TIME = 5.0
class PassEnergy(Writable):
def write(self, value):
Scienta.setPassEnergy(50)
POSITIONERS = [Scienta.getCenterEnergy(), PassEnergy(), Scienta.getChild("Scienta step time")]
def scan_gen():
while True:
for step in STEPS:
yield step
set_adc_averaging()
Scienta.stepTime.write(STEP_TIME)
try:
vscan( POSITIONERS,
SENSORS,
scan_gen(),
line = True,
latency=SETTLING_TIME,
domain_axis = "Index",
enabled_plots = POSITIONERS + SENSORS,
line_plots = [EnergyDistribution,],
before_read = before_readout,
after_read = after_readout
)
finally:
if ENDSCAN:
after_scan()