Files
x09lb/script/templates/Scan2D.py
gac-x09lb 64c6f80912 Startup
2022-11-23 09:06:55 +01:00

54 lines
1.4 KiB
Python

"""
Arguments:
DRY_RUN = True
RANGE_X (tuple (min, max))
RANGE_Y (tuple (min, max))
STEPS (tuple (x, y))
EXPOSURES (list or None)
SETTLING_TIME (double)
ZIGZAG (BOOLEAN)
COMPRESSION (BOOLEAN)
"""
#Debugging
if (get_exec_pars().args is None) and (get_exec_pars().script=="Scan2D"):
DRY_RUN = True
RANGE_X = [-10.0,10.0]
RANGE_Y = [-5.0,5.0]
EXPOSURES = [0.1, 0.5, 1.0]
STEPS = [5, 3] #Integers = number of steps, Float = stepoSize
SETTLING_TIME = 1.0
ZIGZAG = True
COMPRESSION = False
RELATIVE = True
#Constants
SENSORS = [current, ccd.dataMatrix]
POSITIONERS = [dummy_x, dummy_y] if DRY_RUN else [sample_x, sample_y]
ENABLED_PLOTS = [current, ccd.dataMatrix]
CUSTOM_PLOT_TYPES = {ccd.dataMatrix:"ch.psi.pshell.plot.MatrixPlotRenderer"}
start = [RANGE_X[0], RANGE_Y[0]]
end = [RANGE_X[1], RANGE_Y[1]]
step_size = STEPS
if EXPOSURES:
POSITIONERS = POSITIONERS + [exposure_index()]
SENSORS = SENSORS + [exposure()]
start = start + [0.0]
end = end + [float(len(EXPOSURES)-1)]
step_size = STEPS + [1.0]
try:
r = ascan(POSITIONERS, SENSORS , start, end, step_size, \
SETTLING_TIME, RELATIVE, zigzag = ZIGZAG, \
before_read=before_readout, after_read = after_readout, \
compression = COMPRESSION, enabled_plots=ENABLED_PLOTS, \
keep=False, check_positions=False, plot_types=CUSTOM_PLOT_TYPES)
set_return(r)
finally:
after_scan()