diff options
author | Thomas White <taw@physics.org> | 2015-04-27 15:26:58 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-04-28 14:47:19 +0200 |
commit | c192a34cb66c17b1f67447afe87abf928997ca63 (patch) | |
tree | 24a7cf573577f57e13b2004dd8b93710b89f351b | |
parent | 67e8af607654dd79f68d6e24dcfd5dcc5905a398 (diff) |
Remove camera length refinement
...because it very often seems to cause problems.
-rwxr-xr-x | scripts/detector-shift | 24 | ||||
-rw-r--r-- | src/predict-refine.c | 8 |
2 files changed, 5 insertions, 27 deletions
diff --git a/scripts/detector-shift b/scripts/detector-shift index d9a3fab4..f37a645a 100755 --- a/scripts/detector-shift +++ b/scripts/detector-shift @@ -50,21 +50,9 @@ while True: 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) +print 'Mean shifts: dx = %.2f mm, dy = %.2f mm' % (mean_x,mean_y) # Apply shifts to geometry if have_geom: @@ -121,20 +109,12 @@ 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('In-plane') +plt.title('Detector shifts according to prediction refinement') 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() diff --git a/src/predict-refine.c b/src/predict-refine.c index 70e523e4..26dcf139 100644 --- a/src/predict-refine.c +++ b/src/predict-refine.c @@ -61,10 +61,9 @@ static const enum gparam rv[] = GPARAM_CSZ, GPARAM_DETX, GPARAM_DETY, - GPARAM_CLEN }; -static const int num_params = 12; +static const int num_params = 11; struct reflpeak { Reflection *refl; @@ -736,9 +735,8 @@ int refine_prediction(struct image *image, Crystal *cr) } STATUS("Final residual = %e\n", residual(rps, n, image->det)); - snprintf(tmp, 1024, "predict_refine/det_shift x = %.3f y = %.3f mm\n" - "predict_refine/clen_shift = %.3f mm", - total_x*1e3, total_y*1e3, total_z*1e3); + snprintf(tmp, 1024, "predict_refine/det_shift x = %.3f y = %.3f mm", + total_x*1e3, total_y*1e3); crystal_add_notes(cr, tmp); crystal_set_reflections(cr, NULL); |