Script execution

This commit is contained in:
gac-x09lb
2022-10-03 10:10:39 +02:00
parent c4a289c497
commit aac4b91b57
+20 -36
View File
@@ -1,46 +1,30 @@
"""
Arguments:
MOTOR (device)
MOTORS (list)
SENSORS (list)
RANGE (tuple (min, max))
STEPS (int or tuple)
RANGE_X (tuple (min, max))
RANGE_Y (tuple (min, max))
STEPS (tuple (x, y))
LATENCY (double)
RELATIVE (BOOLEAN)
FLY_SCAN (BOOLEAN)
ENDSCAN (BOOLEAN)
ZIGZAG (BOOLEAN)
"""
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
adjust_sensors()
set_adc_averaging()
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
set_exec_pars(compression=True)
#Debugging
if get_exec_pars().args is None:
MOTORS = [dummy_x, dummy_y]
SENSORS = [current]
RANGE_X = [0.0,2.0]
RANGE_Y = [0.0,1.0]
STEPS = [5, 10]
LATENCY = 0.1
RELATIVE = False
ZIGZAG = True
try:
if FLY_SCAN:
# time per scienta acquisition in seconds
trig_scienta()
time1 = time.time()
before_readout()
time.sleep(0.2)
time2 = time.time()
scienta_time = (time2 - time1) + 1.
print "step time: ", scienta_time
if isinstance(STEPS,int):
raise Exception ("Fly Scan must define step size, and not number of steps")
STEP = STEPS[0]
SPEED = STEP / scienta_time
fly_time = (RANGE[1] - RANGE[0]) / SPEED
STEPS = int(fly_time / scienta_time) + 1
print "speed: ", SPEED
print "scan time: ", fly_time
cscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
else:
lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
ascan((ManipulatorPhi, ManipulatorTheta), SENSORS, (PHI_RANGE[0], THETA_RANGE[0]), (PHI_RANGE[1], THETA_RANGE[1]), STEPS, LATENCY, RELATIVE, zigzag = ZIGZAG, \
before_read=before_readout, after_read = after_readout, compression = True)
finally:
if ENDSCAN:
after_scan()
after_scan()