diff options
author | Thomas White <taw@physics.org> | 2021-10-22 12:58:37 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-10-22 12:58:37 +0200 |
commit | a99dec5f78e36c6659306c3a063a47b13e69b233 (patch) | |
tree | a228ba560776daef37a4cdb8fb8798ec1e9f97d4 /libcrystfel | |
parent | 3726808bd5fda236183bb53b80c36d0067dd9a32 (diff) |
pair_peaks: Skip reflections if the indices are too large
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/predict-refine.c | 8 |
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"); |