aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-06-14 11:57:46 +0200
committerThomas White <taw@physics.org>2018-06-14 12:00:36 +0200
commitb01de14e096e3ccdb0fb2175cc83b3e4b9fd0554 (patch)
treecb01c12e6ef95211184009cbf95ff3d98471e915 /libcrystfel
parent9be0dda6ceaf0cc5b2e7ca723cc583a47db178e6 (diff)
Add final residual from prediction refinement to stream
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/predict-refine.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index 14a60bc7..9062e754 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -556,21 +556,18 @@ static double UNUSED residual(struct reflpeak *rps, int n, struct detector *det)
for ( i=0; i<n; i++ ) {
r += EXC_WEIGHT * rps[i].Ih * pow(r_dev(&rps[i]), 2.0);
}
- printf("%e ", r);
res += r;
r = 0.0;
for ( i=0; i<n; i++ ) {
r += pow(x_dev(&rps[i], det), 2.0);
}
- printf("%e ", r);
res += r;
r = 0.0;
for ( i=0; i<n; i++ ) {
r += pow(y_dev(&rps[i], det), 2.0);
}
- printf("%e\n", r);
res += r;
return res;
@@ -600,6 +597,7 @@ int refine_prediction(struct image *image, Crystal *cr)
double total_x = 0.0;
double total_y = 0.0;
double total_z = 0.0;
+ char tmp[256];
rps = malloc(image_feature_count(image->features)
* sizeof(struct reflpeak));
@@ -641,6 +639,10 @@ int refine_prediction(struct image *image, Crystal *cr)
}
//STATUS("Final residual = %e\n", residual(rps, n, image->det));
+ snprintf(tmp, 255, "predict_refine/final_residual = %e",
+ residual(rps, n, image->det));
+ crystal_add_notes(cr, tmp);
+
crystal_set_det_shift(cr, total_x, total_y);
crystal_set_reflections(cr, NULL);