From 87ec1a40b32fffeecb17542f2f2aa5353d776dde Mon Sep 17 00:00:00 2001 From: sfop Date: Mon, 27 Jun 2016 16:39:34 +0200 Subject: [PATCH] Script execution --- script/Alignment/Gun_solenoid_alignment.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index 203416e..d93b097 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -15,8 +15,8 @@ import ch.psi.utils.Convert.toBidimensional as mono_to_bidi import datetime if get_context().source == CommandSource.ui: - I1 = 20.0 - I2 = 50.0 + I1 = 95.0 + I2 = 100.0 dI = 1.0 settling_time = 0.1 plot_image = False @@ -24,6 +24,9 @@ if get_context().source == CommandSource.ui: use_background = True multiple_background = True number_backgrounds = 5 + centroid_excursion_plot = True +else: + centroid_excursion_plot = False print I1 print I2 @@ -122,7 +125,12 @@ finally: # take the result of the scan and do the plots #p = plot(r.getReadable(1), xdata=r.getReadable(0), title = "Centroid excursion")[0] -#add_convex_hull_plot ("Centroid excursion", r.getReadable(0),r.getReadable(1), plot_name, False, (0,cam_img._width), (0,cam_img._height)) +#hull=add_convex_hull_plot ("Centroid excursion", r.getReadable(0),r.getReadable(1), plot_name, False, (0,cam_img._width), (0,cam_img._height)) +if add_convex_hull_plot: + (hx,hy)=add_convex_hull_plot ("Centroid excursion", r.getReadable(0),r.getReadable(1), plot_name) +else: + (hx,hy)= convex_hull(x=r.getReadable(0), y=r.getReadable(1)) + hx.append(hx[0]); hy.append(hy[0]) # save the entry in the logbook msg = str(r) @@ -131,7 +139,7 @@ msg = msg + "\n\n" + r.print() #elog("Gun solenoid current scan", msg , get_plot_snapshots()) print "DONE" -set_return(r) +set_return([r, hx,hy]) print "QUIT"