From 5dc4c993400637b351d68c67292804e8cbd18420 Mon Sep 17 00:00:00 2001 From: sfop Date: Wed, 24 Aug 2016 14:38:31 +0200 Subject: [PATCH] Closedown --- script/Alignment/Gun_solenoid_alignment.py | 23 +++++++++++----------- script/ImageStats.py | 1 + 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index ad0dcf0..0ae99c5 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -10,6 +10,7 @@ import datetime from camtool import CamTool +from ImageStats import ImageStats if get_context().source == CommandSource.ui: I1 = 95.0 @@ -31,16 +32,14 @@ print "Parameters: ", I1, I2, dI, settling_time, plot_image, number_images, use_ plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S') -#add_device(CamTool("camtool") , True) -#from ImageStats import * -run("ImageStats") -add_device(ImageStats("camtool", simulated_source), True) -camtool.setNumberOfImages(max(number_images,1)) -camtool.enableBackground (use_background) +add_device(CamTool("image_stats", prefix = "cam:", latch = True, camera = "SINEG01-DSCR350"), True) +#add_device(ImageStats("image_stats", simulated_source), True) +image_stats.setNumberOfImages(max(number_images,1)) +image_stats.enableBackground (use_background) if use_background: laser_off() if not multiple_background: - camtool.captureBackground(number_backgrounds) + image_stats.captureBackground(number_backgrounds) # Switch off magnets mag = [ "SINEG01-MCRX120","SINEG01-MCRY120", @@ -59,9 +58,9 @@ mag = [ "SINEG01-MCRX120","SINEG01-MCRY120", def before_sample(): if multiple_background: - camtool.captureBackground(number_backgrounds) + image_stats.captureBackground(number_backgrounds) laser_on() - camtool.update() + image_stats.update() def after_sample(): if multiple_background: @@ -72,10 +71,10 @@ if not multiple_background: laser_on() try: - #sensors = [camtool.com_x, camtool.com_y] - sensors = [camtool.com_x_mean, camtool.com_y_mean, camtool.com_x_stdev, camtool.com_y_stdev] + #sensors = [image_stats.com_x, image_stats.com_y] + sensors = [image_stats.com_x_mean, image_stats.com_y_mean, image_stats.com_x_stdev, image_stats.com_y_stdev] if plot_image: - sensors.append(camtool.image) + sensors.append(image_stats.image) r = lscan(gun_solenoid, sensors , I1, I2, dI, settling_time, before_read = before_sample, after_read = after_sample) finally: laser_off() diff --git a/script/ImageStats.py b/script/ImageStats.py index 4771172..ab9986d 100644 --- a/script/ImageStats.py +++ b/script/ImageStats.py @@ -1,4 +1,5 @@ from ijutils import * +import ch.psi.pshell.device.DeviceBase as DeviceBase from ch.psi.pshell.imaging.Overlays import * import ch.psi.pshell.imaging.Pen as Pen import random