aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-04-24 16:53:35 +0200
committerThomas White <taw@physics.org>2015-04-28 14:47:19 +0200
commit67e8af607654dd79f68d6e24dcfd5dcc5905a398 (patch)
treee5c65599e20c23cd00f0bb5f1b8202d501207121 /scripts
parente6fac71fef03bbd13eaa783067799d9c1ac67c1f (diff)
detector-shift: Improve
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/detector-shift17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/detector-shift b/scripts/detector-shift
index 5a39d8a4..d9a3fab4 100755
--- a/scripts/detector-shift
+++ b/scripts/detector-shift
@@ -53,9 +53,16 @@ f.close()
if len(x_shifts) != len(z_shifts):
print 'Warning: number of xy shifts not equal to number of z shifts'
+n = len(z_shifts)
+z_shifts = [t for t in z_shifts if abs(t) < 2.0]
+if len(z_shifts) < n:
+ print 'Warning: %i camera length shifts of more than 2 mm ignored' \
+ % (n-len(z_shifts))
+
mean_x = sum(x_shifts) / len(x_shifts)
mean_y = sum(y_shifts) / len(y_shifts)
mean_z = sum(z_shifts) / len(z_shifts)
+print 'From %i measurements:' % len(x_shifts)
print 'Mean shifts: dx = %.2f mm, dy = %.2f mm; dz = %.2f mm' \
% (mean_x,mean_y,mean_z)
@@ -114,12 +121,20 @@ if have_geom:
g.close()
h.close()
+plt.suptitle('Detector shifts according to prediction refinement')
+plt.subplot(121, autoscale_on=False, aspect='equal')
plt.plot(x_shifts, y_shifts, 'rx')
plt.plot(0, 0, 'bo')
plt.axis([-2,2,-2,2])
-plt.title('Detector shifts according to prediction refinement')
+plt.title('In-plane')
plt.xlabel('x shift / mm')
plt.ylabel('y shift / mm')
plt.grid(True)
+plt.subplot(122)
+plt.hist(z_shifts,bins=30,range=[-2,2])
+plt.title('Camera length')
+plt.xlabel('z shift / mm')
+plt.ylabel('Frequency')
+plt.grid(True)
plt.show()