diff --git a/script/Alignment/Gun_solenoid_alignment_dv.py b/script/Alignment/Gun_solenoid_alignment_dv.py index ebd05af..4b5c17b 100644 --- a/script/Alignment/Gun_solenoid_alignment_dv.py +++ b/script/Alignment/Gun_solenoid_alignment_dv.py @@ -1,6 +1,6 @@ #Tool to align the laser on the cathode. # S. Bettoni, A. Gobbo, D. Voulot -#10/05/2016 +#30/05/2016 #Procedure: @@ -8,25 +8,40 @@ #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? +I = Channel("SINEG01-MSOL130:I-SET") +cam_x, cam_y = ... # some camtool command / channel? bpm_x = Channel("SINEG01-DBPM340:X1") bpm_y = Channel("SINEG01-DBPM340:Y1") -start_I = 20 -end_I = 150 -step_I = 1 +def CheckI(): + n = 1 + while n > 0: + n = caget("SINEG01-MSOL130:I-COMP") -# Enable gun laser -caput("SIN-CVME-TIMAST-TMA:Beam-laser-On", 1) +I1 = 20.0 +I2 = 150.0 +dI = 1.0 + +# Switch off magnets +caput("SINEG01-MCRX120:I-SET", 0.0) +caput("SINEG01-MCRY120:I-SET", 0.0) +caput("SINEG01-MQUA140:I-SET", 0.0) +caput("SINEG01-MQUA150:I-SET", 0.0) +caput("SINEG01-MCRX160:I-SET", 0.0) +caput("SINEG01-MCRY160:I-SET", 0.0) +caput("SINEG01-MCRX180:I-SET", 0.0) +caput("SINEG01-MCRY180:I-SET", 0.0) + +# Disable laser delay +caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 0) #Scan using the screen -r = lscan(gun_sol_I, [center_x, center_y], start_I, end_I, step_I, latency = 0.5) +#r = lscan(I, [cam_x, cam_y], I1, I2, dI, passes = 2, zigzag = True, before_read = CheckI) #Scan using the BPM -#r = lscan(gun_sol_current, [bpm_x, bpm_y], start_I, end_I, step_I, latency = 0.5) +r = lscan(I, [bpm_x, bpm_y], I1, I2, dI, passes = 2, zigzag = True, before_read = CheckI) -# Disable gun laser -caput("SIN-CVME-TIMAST-TMA:Beam-laser-On", 0) +# Enable laser delay +caput("SIN-CVME-TIMAST-TMA:LaserDelayControl", 1) #I take the result of the scan and I do the plots x = r.getReadable(0) @@ -34,4 +49,7 @@ y = r.getReadable(1) plot(y, xdata=x, title = "CM") #I 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()) diff --git a/script/region_scan_with_elog.py b/script/region_scan_with_elog.py index 45e1b04..192a189 100755 --- a/script/region_scan_with_elog.py +++ b/script/region_scan_with_elog.py @@ -1,7 +1,7 @@ #Execute the scan: 3 regions with different number of steps -a= rscan(ao1, (ai1,ai2), [(0,5,5), (10,15,20), (20,25,5)] , 0.01) - -msg = str(a) -msg = msg + "\nFile: " + get_context().path + ".h5" -msg = msg + "\n\n" + a.print() -elog("Region scan", msg , get_plot_snapshots()) +a= rscan(ao1, (ai1,ai2), [(0,5,5), (10,15,20), (20,25,5)] , 0.01) + +msg = str(a) +msg = msg + "\nFile: " + get_context().path +msg = msg + "\n\n" + a.print() +elog("Region scan", msg , get_plot_snapshots())