From 67e8af607654dd79f68d6e24dcfd5dcc5905a398 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 24 Apr 2015 16:53:35 +0200 Subject: detector-shift: Improve --- scripts/detector-shift | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts') 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() -- cgit v1.2.3