From ffd48c0085f6f7a609079d0a4cfa2dd2a72c1e26 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 27 Sep 2018 16:56:51 +0200 Subject: Write in stream whether crystal was selected as a "hit" or not --- libcrystfel/src/image.h | 2 ++ libcrystfel/src/stream.c | 1 + src/process_image.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index 2909e401..cc1bcc5d 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -157,6 +157,7 @@ struct beam_params /** * image: + * @hit: Non-zero if the frame was determined to be a "hit" * @crystals: Array of crystals in the image * @n_crystals: The number of crystals in the image * @indexed_by: Indexing method which indexed this pattern @@ -203,6 +204,7 @@ struct image { int **bad; /* Bad pixels by panel */ float **sat; /* Per-pixel saturation values */ + int hit; Crystal **crystals; int n_crystals; IndexingMethod indexed_by; diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index 40133c93..bcd2627e 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -832,6 +832,7 @@ int write_chunk(Stream *st, struct image *i, struct imagefile *imfile, fprintf(st->fh, "Image serial number: %i\n", i->serial); + fprintf(st->fh, "hit = %i\n", i->hit); indexer = indexer_str(i->indexed_by); fprintf(st->fh, "indexed_by = %s\n", indexer); free(indexer); diff --git a/src/process_image.c b/src/process_image.c index 89887436..10863fd3 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -285,6 +285,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, return; } free(rn); + image.hit = 0; if ( iargs->stream_nonhits ) { goto streamwrite; @@ -292,6 +293,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, goto out; } } + image.hit = 1; /* Index the pattern */ time_accounts_set(taccs, TACC_INDEXING); -- cgit v1.2.3