diff --git a/script/Alignment/Gun_solenoid_alignment.py b/script/Alignment/Gun_solenoid_alignment.py index 0ef53c1..65328ce 100755 --- a/script/Alignment/Gun_solenoid_alignment.py +++ b/script/Alignment/Gun_solenoid_alignment.py @@ -37,7 +37,7 @@ plot_name = datetime.datetime.fromtimestamp(time.time()).strftime('%H%M%S') add_device(CamTool("camtool") , True) -camtool.setNumberOfImages(number_images) +camtool.setNumberOfImages(max(number_images,1)) camtool.enableBackground (use_background) if use_background and not multiple_background: laser_off() @@ -95,7 +95,8 @@ r = None if not multiple_background: laser_on() try: - sensors = [camtool.com_x, camtool.com_y] + #sensors = [camtool.com_x, camtool.com_y] + sensors = [camtool.com_x_mean, camtool.com_y_mean] if plot_image: sensors.append(camtool.image) r = lscan(gun_solenoid, sensors , I1, I2, dI, settling_time, before_read = br, after_read = ar) diff --git a/script/camtool.py b/script/camtool.py index e2bcb33..9334c44 100644 --- a/script/camtool.py +++ b/script/camtool.py @@ -53,10 +53,12 @@ class CamTool(DeviceBase): self.com_x_samples, self.com_y_samples = [], [] class CamToolComX(Readable): def read(self): + print "X", self.camtool.com_x_samples, mean(self.camtool.com_x_samples) return mean(self.camtool.com_x_samples) self.com_x_mean = CamToolComX(); self.com_x_mean.camtool = self class CamToolComY(Readable): def read(self): + print "Y", self.camtool.com_y_samples, mean(self.camtool.com_y_samples) return mean(self.camtool.com_y_samples) self.com_y_mean = CamToolComY(); self.com_y_mean.camtool = self class CamToolComXVar(Readable):