aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-07-09 16:56:07 +0200
committerThomas White <taw@physics.org>2018-07-09 16:56:30 +0200
commitae98d68749f58d63b2deb0c2d056fb567046bf8b (patch)
tree56d214da068a959bf16ba913ae5cf866859fe6b7 /libcrystfel
parent177af3bd9f28821f153b1ed4e447b696242a8923 (diff)
Add number of indexing attempts to stream
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image.h2
-rw-r--r--libcrystfel/src/index.c5
-rw-r--r--libcrystfel/src/stream.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h
index 40717ab3..580e3d6c 100644
--- a/libcrystfel/src/image.h
+++ b/libcrystfel/src/image.h
@@ -148,6 +148,7 @@ struct beam_params
* @crystals: Array of crystals in the image
* @n_crystals: The number of crystals in the image
* @indexed_by: Indexing method which indexed this pattern
+ * @n_indexing_tries: Number of times the indexer was tried before indexing
* @det: Detector structure
* @beam: Beam parameters structure
* @filename: Filename for the image file
@@ -193,6 +194,7 @@ struct image {
Crystal **crystals;
int n_crystals;
IndexingMethod indexed_by;
+ int n_indexing_tries;
struct detector *det;
struct beam_params *beam; /* The nominal beam parameters */
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index 4ff4405a..b846574d 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -851,7 +851,10 @@ void index_pattern_2(struct image *image, IndexingPrivate *ipriv, int *ping)
/* Stop now if the pattern is indexed (don't try again for more
* crystals with a different indexing method) */
- if ( success ) break;
+ if ( success ) {
+ image->n_indexing_tries = ntry;
+ break;
+ }
}
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index c11e38df..5cd8e560 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -835,6 +835,9 @@ int write_chunk(Stream *st, struct image *i, struct imagefile *imfile,
indexer = indexer_str(i->indexed_by);
fprintf(st->fh, "indexed_by = %s\n", indexer);
free(indexer);
+ if ( i->indexed_by != INDEXING_NONE ) {
+ fprintf(st->fh, "n_indexing_tries = %i\n", i->n_indexing_tries);
+ }
fprintf(st->fh, "photon_energy_eV = %f\n",
J_to_eV(ph_lambda_to_en(i->lambda)));