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