Closedown

This commit is contained in:
sfop
2016-06-21 11:42:51 +02:00
parent 334e48cfe7
commit 101be44c1e
4 changed files with 22 additions and 21 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
import org.apache.commons.math3.linear.Array2DRowRealMatrix as Matrix
import ch.psi.utils.Convert.toBidimensional as mono_to_bidi
import datetime
I1 = 20.0
I2 = 50.0
+16 -15
View File
@@ -7,15 +7,12 @@
# change the phase of the gun RF
# look at the centroid position (BPM or screen) downstream of the gun.
phi_set = Channel("SINEG01-RSYS:SET-BEAM-PHASE")
phi_get = Channel("SINEG01-RSYS:GET-BEAM-PHASE")
cam_x = Channel("SINEG01-DSCR190:profile.X_stats.com", alias = "cam_x")
cam_y = Channel("SINEG01-DSCR190:profile.Y_stats.com", alias = "cam_y")
bpm_x = Channel("SINEG01-DBPM340:X1", alias = "bpm_x")
bpm_y = Channel("SINEG01-DBPM340:Y1", alias = "bpm_y")
cam_x = Channel("SINEG01-DSCR190:profile.X_stats.com", alias = "cam_x")
cam_y = Channel("SINEG01-DSCR190:profile.Y_stats.com", alias = "cam_y")
def ccr(mag):
n = 1
while n > 0:
@@ -23,14 +20,13 @@ def ccr(mag):
n = caget(mag + ":I-COMP")
def laser_on():
caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 0)
def laser_off():
caput("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", 1)
phi1 = 20.0
phi2 = 150.0
phi2 = 30.0
dphi = 1.0
settling_time = 0.5
settling_time = 0.1
# Switch off magnets
mag = [ "SINEG01-MCRX120","SINEG01-MCRY120",
@@ -47,18 +43,23 @@ for m in mag:
for m in mag:
ccr(m)
def br():
pass
def ar():
pass
laser_on()
# Scan using the screen
#r = lscan(phi_set, [phi_get, cam_x, cam_y], phi1, phi2, dphi, 0.5)
# Scan using the BPM
r = lscan(phi_set, [phi_get, bpm_x, bpm_y], phi1, phi2, dphi, settling_time)
laser_off()
try:
r = lscan(gun_phase, [bpm_x, bpm_y], phi1, phi2, dphi, settling_time, before_read = br, after_read = ar)
finally:
laser_off()
# take the result of the scan and do the plots
plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")
plot(r.getReadable(1), xdata=r.getReadable(0), title = "Centroid excursion")
#add_convex_hull_plot ("Centroid excursion", r.getReadable(0),r.getReadable(1), "Name")
# save the entry in the logbook
msg = str(r)
msg = msg + "\nFile: " + get_context().path
msg = msg + "\n\n" + r.print()
elog("Gun solenoid current scan", msg , get_plot_snapshots())
elog("Gun laser alignment", msg , get_plot_snapshots())