Files
x03da/script/optics/RefocusManipulatorScan.py
2023-05-02 16:00:17 +02:00

42 lines
1.0 KiB
Python

"""
Scan refocusing mirror RY and manipulator X in parallel (to find analyser focus).
Beam stays on same spot on the sample.
set scan parameters below.
set analyser parameters separately!
move manipulator and mirror to center position before start!
"""
import math
# adjust the following parameters
DISTANCE_X = 8. # mm
#DISTANCE_Ry = 0.5 # mrad (Ry)
SLOPE = 1.0/0.24 # mm/mrad (DX / DRy)
STEPS = 160
LATENCY = 0.0
ENDSCAN = False
# do not edit below
#DISTANCE_X = DISTANCE_Ry * SLOPE
DISTANCE_Ry = DISTANCE_X / SLOPE
MOTOR = (RefocusYRot, ManipulatorX)
SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution)
STARTPOS = (-DISTANCE_Ry / 2.0, -DISTANCE_X / 2.0)
ENDPOS = (DISTANCE_Ry / 2.0, DISTANCE_X / 2.0)
RELATIVE = True
# STARTPOS = (-1.6854, -5.5)
# ENDPOS = (+0.2346, +2.5)
# RELATIVE = False
adjust_sensors()
set_adc_averaging()
try:
lscan(MOTOR, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
finally:
if ENDSCAN:
after_scan()