Files
sf-op/script/Undulators/K_AT_scale1.py
2025-01-14 16:18:27 +01:00

22 lines
683 B
Python

dEph = caget("SATUN:USER-DELTA")
Eph1 = caget("SATUN06-UIND030:FELPHOTENE")
Eph2 = Eph1 + dEph
undlist = ("SATUN06","SATUN07","SATUN08","SATUN09","SATUN10","SATUN11","SATUN12","SATUN13")
K1, K2 = {}, {}
for und in undlist:
K = caget(und + "-UIND030:K_SET")
K1[und] = K
K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5
print K1,K2
for und in undlist: caputq(und + "-UIND030:K_SET", K2[und])
time.sleep(0.5) # Make sure the new K values have been written
#Switching on radial motors (and pushing go) to ensure proper movements
for und in undlist: caput(und + "-UIND030:RADIAL-ON.PROC", 1)
for und in undlist: caput(und + "-UIND030:RADIAL-GO.PROC", 1)
set_return("Success")