Files
x03da/script/optics/FocusYRotScan.py
2022-06-22 18:11:42 +02:00

61 lines
1.8 KiB
Python

"""
Focusing mirror Ry scan
set scan parameters below, move the mirror to the center position.
set analyser parameters separately!
changes
-------
2022-06-22 implement fly scan: not supported by positioner!
"""
import math
set_exec_pars(compression=True)
# adjust the following parameters
DISTANCE = 0.2
STEPS = 100
LATENCY = 0.5
ENDSCAN = False
MOTORS = [FocusYRot]
#SENSORS = [SampleCurrent, RefCurrent, MachineCurrent, OpticsCameraCentroidX, OpticsCameraSigmaX, opps1img.getDataMatrix()]
SENSORS = [SampleCurrent, RefCurrent, MachineCurrent]
SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, Scienta.dataMatrix, EnergyDistribution, AngleDistribution)
STARTPOS = (-DISTANCE / 2.0)
ENDPOS = (DISTANCE / 2.0)
RELATIVE = True
FLY_SCAN = False # fly scan not supported by positioner
adjust_sensors()
set_adc_averaging()
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):
STEPS = DISTANCE / STEPS
SPEED = STEPS / 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(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
else:
lscan(MOTORS, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
finally:
if ENDSCAN:
after_scan()