aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-12-13 16:25:33 +0100
committerThomas White <taw@physics.org>2019-12-13 16:25:33 +0100
commitc436476bf872bebb551b974de2c68b2fed2640af (patch)
treeb68e8ade24a54bfe042b5c8437989ac40410826c /libcrystfel
parent2a747e2872840deb05988ff1660fca51d13d2207 (diff)
pair_peaks: Don't attempt to pair 000
Normally the beam centre is masked out or not on the detector. However, when it is, pairing with 000 causes gradients to come out as NaN and the prediction refinement to fail.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/predict-refine.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index 6facc6c3..84e3c5bf 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -250,6 +250,9 @@ static int pair_peaks(struct image *image, Crystal *cr,
k = lrint(kd);
l = lrint(ld);
+ /* Don't pair with 000, because that can cause trouble later */
+ if ( (h==0) && (k==0) && (l==0) ) continue;
+
refl = reflection_new(h, k, l);
if ( refl == NULL ) {
ERROR("Failed to create reflection\n");