From 17bbe4e8cc42e7801313e801c9123a18571f39a5 Mon Sep 17 00:00:00 2001 From: sfop Date: Wed, 24 Aug 2016 15:24:34 +0200 Subject: [PATCH] Script execution --- script/Alignment/Gun_solenoid_alignment.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index 72e3968..9a0974a 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -9,9 +9,6 @@ # look at the centroid position (BPM or screen) downstream of the gun. import datetime -run("camtool") -#from camtool import CamTool -from ImageStats import ImageStats if get_context().source == CommandSource.ui: I1 = 95.0 @@ -28,6 +25,10 @@ if get_context().source == CommandSource.ui: else: centroid_excursion_plot = False +from camtool import CamTool +from ImageStats import ImageStats + + multiple_background = multiple_background and use_background print "Parameters: ", I1, I2, dI, settling_time, plot_image, number_images, use_background, multiple_background, number_backgrounds @@ -35,7 +36,10 @@ plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S') if get_device("image_stats") is None: print "Instantiating camtool" - add_device(CamTool("image_stats", prefix = "cam:", latch = True, camera = "SINEG01-DSCR350"), True) + latch = True + add_device(CamTool("image_stats", prefix = "cam:", latch = latch, camera = "SINEG01-DSCR350"), True) + if (latch): + image_stats.start() #add_device(ImageStats("image_stats", simulated_source), True) image_stats.setNumberOfImages(max(number_images,1)) image_stats.enableBackground (use_background)