Files
x09lb/script/test/Test2D.py
gac-x09lb 68aea72a8d Startup
2022-10-03 19:11:30 +02:00

59 lines
1.7 KiB
Python

DRY_RUN = True
MOTORS = [sample_x, sample_y]
SENSORS = [current, ccd.dataMatrix]
RANGE_X = [-10.0,10.0]
RANGE_Y = [-10.0,10.0]
EXPOSURES = None # [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]
if DRY_RUN:
MOTORS = [dummy_x, dummy_y]
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 = MOTORS + [exposure_index()]
_SENSORS = SENSORS + [exposure()]
START = START + [0.0]
STOP = STOP + [float(len(POSITIONERS)-1)]
try:
if EXPOSURES:
ascan(POSITIONERS, _SENSORS , START, STOP, STEPS + [1.0], \
SETTLING_TIME, RELATIVE, zigzag = ZIGZAG, \
before_read=before_readout, after_read = after_readout, \
line_plots = ["current"],
compression = COMPRESSION, enabled_plots=ENABLED_PLOTS, keep=False, check_positions=False)
else:
ascan(MOTORS, 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)
finally:
after_scan()