Files
x09lb/script/test/Test2D.py
gac-x09lb f1a32a6b92
2022-11-11 13:27:32 +01:00

53 lines
1.5 KiB
Python

DRY_RUN = False
POSITIONERS = [dummy_x, dummy_y] if DRY_RUN else [sample_x, sample_y]
SENSORS = [current, ccd.dataMatrix]
RANGE_X = [-10.0,10.0]
RANGE_Y = [-10.0,10.0]
EXPOSURES = [0.1, 0.5, 1.0]
STEPS = [5, 5] #Integers = number of steps, Float = stepoSize
SETTLING_TIME = 0.1
RELATIVE = True
ZIGZAG = True
START = [RANGE_X[0], RANGE_Y[0]]
STOP = [RANGE_X[1], RANGE_Y[1]]
COMPRESSION = False
ENABLED_PLOTS= [current, ccd.dataMatrix]
CUSTOM_PLOT_TYPES = {ccd.dataMatrix:"ch.psi.pshell.plot.MatrixPlotRenderer"}
if EXPOSURES:
class exposure_index (Writable, Readable):
def __init__(self):
self.pos=0.0
def read(self):
return self.pos
def write(self, value):
ccd.setExposure(EXPOSURES[int(value)])
self.pos = value
class exposure (Readable):
def read(self):
return ccd.exposure
POSITIONERS = POSITIONERS + [exposure_index()]
SENSORS = SENSORS + [exposure()]
START = START + [0.0]
STOP = STOP + [float(len(POSITIONERS)-1)]
STEPS = STEPS + [1.0]
try:
r = ascan(POSITIONERS, SENSORS , START, STOP, STEPS, \
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)
finally:
after_scan()