aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/detector-shift24
-rw-r--r--src/predict-refine.c8
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);