aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index af5b81c7..79fa4c3f 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -408,16 +408,22 @@ void index_pattern(struct image *image,
int done = 0;
int r;
int ntry = 0;
+ int success = 0;
do {
r = try_indexer(image, indms[n], iprivs[n]);
+ success += r;
ntry++;
done = finished_retry(indms[n], r, image);
if ( ntry > 5 ) done = 1;
} while ( !done );
+ /* Stop now if the pattern is indexed (don't try again for more
+ * crystals with a different indexing method) */
+ if ( success ) break;
+
n++;
}