Files
sf-rf/script/Alignment/Gun_solenoid_alignment_dv.py
2016-05-30 11:19:36 +02:00

38 lines
1.0 KiB
Python

#Tool to align the laser on the cathode.
# S. Bettoni, A. Gobbo, D. Voulot
#10/05/2016
#Procedure:
#I switch off all the magnets between the gun solenoid and the screen or BPM used for the measurement
#I change the current of the gun soleoid
#I look at the centroid position (BPM or screen) downstream of the gun.
gun_sol_I = Channel("SINEG01-MSOL130:I-SET")
center_x, center_y = ... # some camtool command or channel?
bpm_x = Channel("SINEG01-DBPM340:X1")
bpm_y = Channel("SINEG01-DBPM340:Y1")
start_I = 20
end_I = 150
step_I = 1
# Enable gun laser
caput("SIN-CVME-TIMAST-TMA:Beam-laser-On", 1)
#Scan using the screen
r = lscan(gun_sol_I, [center_x, center_y], start_I, end_I, step_I, latency = 0.5)
#Scan using the BPM
#r = lscan(gun_sol_current, [bpm_x, bpm_y], start_I, end_I, step_I, latency = 0.5)
# Disable gun laser
caput("SIN-CVME-TIMAST-TMA:Beam-laser-On", 0)
#I take the result of the scan and I do the plots
x = r.getReadable(0)
y = r.getReadable(1)
plot(y, xdata=x, title = "CM")
#I save the entry in the logbook