Files
x07db/script/templates/TimeResolved.py
gac-ISS e9ba08ce4f V2
2025-08-27 14:36:28 +02:00

51 lines
1.1 KiB
Python

if get_exec_pars().debug:
print "Setting debug parameters"
SCANS = 10
NAME = None
FILE = None
if FILE:
FILE = Setup.expandPath("{home}/parameters/" + FILE)
import json
with open(FILE) as json_file:
cfg = json.load(json_file)
NAME , SCANS= cfg[0], cfg[1]
print "FILE: ", FILE
print "SCANS: ", SCANS
DUMMY_TRIGGER=False
"""
scienta.getState().assertReady()
current_spectrum=scienta.getSpectrum().take()
scienta.start()
try:
scienta.getSpectrum().waitValueNot(current_spectrum, -1)
mscan(scienta.getSpectrum(), scienta.getSpectrum(), scienta.getIterations(), -1, take_initial=True)
except:
scienta.stop()
scienta.zeroSupplies()
"""
set_device_alias(scienta.getSpectrum(), "spectrum")
sensors=[i0, scienta.getSpectrum()]
def before_read(position, scan):
trigger_scienta()
clear_scan_output()
if DUMMY_TRIGGER:
dummy_trigger_scienta()
try:
tscan(sensors, SCANS, 0.001, before_read=before_read, after_read=after_readout, name=NAME, lazy=not DUMMY_TRIGGER)
finally:
scienta.zeroSupplies()