Files
x03da/script/users/Empa/EmpaMarcoMultiple.py
2021-09-07 06:27:59 +02:00

44 lines
1.3 KiB
Python

import ch.psi.pshell.device.DummyPositioner as DummyPositioner
#Energy #Pass Energy #Step Time
STEPS = [ #( 136.2, 50 , 5.0),
( 957.2, 20 , 5.0),
# ( 350.8, 100 , 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(20)
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()