Files
x10da/script/CalibrateGonio.py
2022-08-30 11:36:37 +02:00

17 lines
551 B
Python

EEdge=9.
start=EEdge-0.3
step=0.01
sleepTime=0.5
for i in range(0,5):
caput("X10DA-OP1-MO1:BraggEAO",start+step*i)
time.sleep(sleepTime)
EnergyGonio=caget("X10DA-OP1-MO1:BraggEAO.VAL")
EnergyAbsolut=caget("X10DA-OP1-MO1:ENC-ROTXEnergy.VAL")
BraggGonio1=caget("X10DA-OP1-MO1:BraggThetaAO.VAL")
caput("X10DA-OP1-MO1:BraggEAO",EnergyAbsolut)
time.sleep(sleepTime)
BraggGonio2=caget("X10DA-OP1-MO1:BraggThetaAO.VAL")
OldOffset=caget("X10DA-OP1-MO1:ROTX.OFF")
NewOffset=OldOffset+BraggGomio2-BraggGonio1
caput("X10DA-OP1-MO1:ROTX.OFF", NewOffset)