From c5e75bad33b7ba1fb4f9d6178dd744f10e3241d3 Mon Sep 17 00:00:00 2001 From: sfop Date: Tue, 28 Jun 2016 15:15:03 +0200 Subject: [PATCH] Closedown --- script/Alignment/Gun_solenoid_alignment.py | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index a959c6e..f1bce2f 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -14,6 +14,9 @@ import org.apache.commons.math3.linear.Array2DRowRealMatrix as Matrix import ch.psi.utils.Convert.toBidimensional as mono_to_bidi import datetime +zero_solenoids=False +do_elog = False + if get_context().source == CommandSource.ui: I1 = 95.0 I2 = 100.0 @@ -104,17 +107,19 @@ mag = [ "SINEG01-MCRX120","SINEG01-MCRY120", "SINEG01-MCRX220","SINEG01-MCRY220", "SINEG01-MQUA310", "SINEG01-MQUA320" ] -#for m in mag: -# caput(m + ":I-SET", 0.0) -#for m in mag: -# ccr(m) +if zero_solenoids: + for m in mag: + caput(m + ":I-SET", 0.0) + for m in mag: + ccr(m) # add here gun phase setting see wiki page def br(): pass def ar(): - pass + pass + r = None laser_on() try: @@ -123,9 +128,7 @@ try: finally: laser_off() -# take the result of the scan and do the plots -#p = plot(r.getReadable(1), xdata=r.getReadable(0), title = "Centroid excursion")[0] -#hull=add_convex_hull_plot ("Centroid excursion", r.getReadable(0),r.getReadable(1), plot_name, False, (0,cam_img._width), (0,cam_img._height)) +# take the result of the scan and generate convex hull plot if centroid_excursion_plot: (hx,hy)=add_convex_hull_plot ("Centroid excursion", r.getReadable(0),r.getReadable(1), plot_name) else: @@ -133,13 +136,14 @@ else: hx.append(hx[0]); hy.append(hy[0]) # 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()) +if do_elog: + msg = str(r) + msg = msg + "\nFile: " + get_context().path + msg = msg + "\n\n" + r.print() + elog("Gun solenoid current scan", msg , get_plot_snapshots()) + -print "DONE" set_return([r, hx,hy]) -print "QUIT" +