From a99dec5f78e36c6659306c3a063a47b13e69b233 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 22 Oct 2021 12:58:37 +0200 Subject: pair_peaks: Skip reflections if the indices are too large --- libcrystfel/src/predict-refine.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c index 9b562fb0..9bee242c 100644 --- a/libcrystfel/src/predict-refine.c +++ b/libcrystfel/src/predict-refine.c @@ -215,6 +215,14 @@ static int pair_peaks(struct image *image, Crystal *cr, /* Don't pair with 000, because that can cause trouble later */ if ( (h==0) && (k==0) && (l==0) ) continue; + if ( (abs(h)>=512) || (abs(k)>=512) || (abs(l)>=512) ) { + ERROR("Peak %i (on panel %s at %.2f,%.2f) has indices too " + "large for pairing (%.0f %.0f %.0f)\n", + i, image->detgeom->panels[f->pn].name, + f->fs, f->ss, h, k, l); + continue; + } + refl = reflection_new(h, k, l); if ( refl == NULL ) { ERROR("Failed to create reflection\n"); -- cgit v1.2.3