aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-01-21 14:58:26 +0100
committerThomas White <taw@physics.org>2016-01-29 14:07:52 +0100
commitd6b4d3d274012054dde84d03e1b19ade7223c3c9 (patch)
treecf245d46f72fe73a62b4b23da0d9369b7837338b
parent5b69bbf806d03dc5722c48884874a2f5a3cb3cdd (diff)
Use a fresh copy of the peak list for each new indexing method
-rw-r--r--libcrystfel/src/index.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index 2c6780dd..2b84a621 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -392,7 +392,6 @@ void index_pattern(struct image *image,
IndexingMethod *indms, IndexingPrivate **iprivs)
{
int n = 0;
- ImageFeatureList *peaks;
ImageFeatureList *orig;
if ( indms == NULL ) return;
@@ -401,9 +400,7 @@ void index_pattern(struct image *image,
image->crystals = NULL;
image->n_crystals = 0;
- peaks = sort_peaks(image->features);
orig = image->features;
- image->features = peaks;
while ( indms[n] != INDEXING_NONE ) {
@@ -412,6 +409,8 @@ void index_pattern(struct image *image,
int ntry = 0;
int success = 0;
+ image->features = sort_peaks(orig);
+
do {
r = try_indexer(image, indms[n], iprivs[n]);
@@ -422,6 +421,8 @@ void index_pattern(struct image *image,
} while ( !done );
+ image_feature_list_free(image->features);
+
/* Stop now if the pattern is indexed (don't try again for more
* crystals with a different indexing method) */
if ( success ) break;
@@ -432,7 +433,6 @@ void index_pattern(struct image *image,
image->indexed_by = indms[n];
image->features = orig;
- image_feature_list_free(peaks);
}