aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/predict-refine.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/predict-refine.c')
-rw-r--r--libcrystfel/src/predict-refine.c8
1 files changed, 8 insertions, 0 deletions
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");