From c436476bf872bebb551b974de2c68b2fed2640af Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 13 Dec 2019 16:25:33 +0100 Subject: 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. --- libcrystfel/src/predict-refine.c | 3 +++ 1 file changed, 3 insertions(+) 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"); -- cgit v1.2.3