From 095bd6bb86b893c61a238f343765d04d3fb038a4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 13 Nov 2019 11:11:14 +0100 Subject: Fix peak check logic for multiple crystals It seems that the code wasn't properly updated when multi-crystal indexing was introducted. This "continue" statement didn't do anything. --- libcrystfel/src/peaks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index ea524210..cd65a0c7 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -701,6 +701,7 @@ int indexing_peak_check(struct image *image, Crystal **crystals, int n_cryst, struct rvec q; double h,k,l,hd,kd,ld; int j; + int ok = 0; /* Assume all image "features" are genuine peaks */ f = image_get_feature(image->features, i); @@ -736,12 +737,13 @@ int indexing_peak_check(struct image *image, Crystal **crystals, int n_cryst, && (fabs(k - kd) < min_dist) && (fabs(l - ld) < min_dist) ) { - n_sane++; - continue; + ok = 1; + break; /* Don't need to check other crystals */ } } + n_sane += ok; } -- cgit v1.2.3