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
View File
@@ -1,5 +1,4 @@
gun_solenoid=ch.psi.pshell.epics.Positioner|SINEG01-MSOL130:I-SET SINEG01-MSOL130:I-READ|||true
SINEG01-DBPM340=ch.psi.pshell.epics.Positioner|SINEG01-DBPM340:X1 SINEG01-DBPM340:Y1|Read||true
gun_phase=ch.psi.pshell.epics.Positioner|SINEG01-RSYS:SET-BEAM-PHASE SINEG01-RSYS:GET-BEAM-PHASE|||true
#SINSB01_phase=ch.psi.pshell.epics.Positioner|VA-SINSB01-RSYS100:SET-BEAM-PHASE VA-SINSB01-RSYS100:GET-BEAM-PHASE|||true
#BC1_energy=ch.psi.pshell.epics.ChannelDouble|VA-SINBC02-DBPM140:ENERGY|Read||true
+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())
+5 -4
View File
@@ -7,8 +7,9 @@ for step in range(1,5):
for i in range(50):
x.append(random.random() * 100 / step)
y.append(random.random() * 100/ step)
add_convex_hull_plot ("test", x,y,"Step " + str(step), (-50,150), (-50,150))
print step
add_convex_hull_plot ("test", x,y,"Step " + str(step), False, (-50,150), (-50,150))
#x = [317.86916703765246, 318.2215338763623, 317.5688250452771, 318.74843805712953, 315.77042681965906, 319.8600058760031, 318.2215338763623, 318.2215338763623, 318.74843805712953, 318.11687837407675, 319.8600058760031]
#y = [226.71039474501808, 222.34863253627455, 226.4631572933208, 226.81240897796238, 230.7042858871591, 227.4796142397247, 222.34863253627455, 222.34863253627455, 226.81240897796238, 230.7042858871591, 227.4796142397247]
#add_convex_hull_plot ("test", x,y,"X")
x = [317.86916703765246, 318.2215338763623, 317.5688250452771, 318.74843805712953, 315.77042681965906, 319.8600058760031, 318.2215338763623, 318.2215338763623, 318.74843805712953, 318.11687837407675, 319.8600058760031]
y = [226.71039474501808, 222.34863253627455, 226.4631572933208, 226.81240897796238, 230.7042858871591, 227.4796142397247, 222.34863253627455, 222.34863253627455, 226.81240897796238, 230.7042858871591, 227.4796142397247]
add_convex_hull_plot ("test", x,y,"X")