Files
x11ma/script/beamline_alignment/Development/FE_scan.py
2025-12-17 09:49:26 +01:00

77 lines
2.5 KiB
Python
Executable File

#add_device(Positioner("FE_CX", "X11MA-FE-SL1:CENTERX", "X11MA-FE-SL1:CENTERX.RBV"), True)
#add_device(Positioner("FE_CY", "X11MA-FE-SL1:CENTERY", "X11MA-FE-SL1:CENTERY.RBV"), True)
#FE_CX.monitored=True
#FE_CY.monitored=True
cy=FE_CY.read()
cx=FE_CX.read()
DX=0.5
DY=0.5
STEPS=0.05
xmin=cx-DX/2
xmax=cx+DX/2
ymin=cy-DY/2
ymax=cy+DY/2
#sensors = [CADC2, FE_CX, FE_CY, FE_CX_RBV, FE_CY_RBV]
detectors=(CADC2, FE_CX_RBV, FE_CY_RBV)
FE_CX.move(xmin)
FE_CX.move(xmax)
FE_CX.move(xmin)
FE_CX.move(xmax)
FE_CX.move(xmin)
FE_CX.move(xmax)
FE_CX.move(xmin)
FE_CX.move(xmax)
FE_CX.move(xmin)
FE_CX.move(xmax)
# moves to 30.0 blocking the code here until 30.0 is reached.
# FE_CX.moveAsync(xmax)
# moveAsync -> command starts the movement without blocking the code
# The code would finish, if no other command follows.
#res = tscan(detectors, 200, 0.1)
#sensors = [Keithley_2_raw, CADC2, FE_CX, FE_CX_RBV, FE_CY, FE_CY_RBV]
#detector = Keithley_2_raw
#ascan([FE_CX, FE_CY], sensors, [X_min, Y_min], [X_max, Y_max], [X_step, Y_step], latency=0.5, zigzag=True)
#ascan([FE_CX, FE_CY], sensors, [-1.0, 0.3], [0.0, 1.3], [0.1, 0.1], latency=0.5, zigzag=True)
#ascan([FE_CX, FE_CY], sensors, [xmin, ymin], [xmax, ymax], [STEPS, STEPS], latency=0.25, zigzag=True)
FE_CX.moveAsync(-0.849586500000001)
FE_CY.moveAsync(1.4759635000000015)
# Scan speed tests:
#*****************
#ascan([FE_CX, FE_CY], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.5, zigzag=False) Motor velocity = 0.5, 4 min 40 sec
#ascan([FE_CX, FE_CY], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.5, zigzag=False) Motor velocity = 1.0, 4 min 35 sec
#ascan([FE_CX, FE_CY], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.5, zigzag=True) Motor velocity = 1.0, 3 min 35 sec
#scan([FE_CX, FE_CY], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.5, zigzag=True) Motor velocity = 5.0, 3 min 32 sec
#ascan([FE_CX, FE_CY], sensors, [-0.5, 0.45], [0.0, 1.05], [0.05, 0.05], latency=0.25, zigzag=True) Motor velocity = 5.0, 2 min 53 sec
#-> for latency below 0.25, motor errors occur
# Test motor speed (on the motor panels):
#TRXR Velocity 0.5 9 secs # Default setting for all motors (TRXR, TRYB, TRXW, TRYT)
#TRXR Velocity 1.0 1 secs
#TRXR Velocity 5.0 1 secs
#caput X11MA-FE-SL1:TRXW.VELO 5.0
#result=lscan(exit_slit, detector, 20.0, -30.0, steps=1.0, relative=False, latency=2.5)
#result=tscan((exit_slit.readback,Keithley_2_raw), 100, 0.1)
#lscan(energy, sensors, 1100, 1900, 5.0, latency=0.5)