aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-10-16 16:28:35 +0200
committerThomas White <taw@physics.org>2014-10-23 17:02:32 +0200
commitcb08ffbe0adeed6502db70f3380059800464726d (patch)
tree0dccc8ee60ccad060fbb8778c4c15a3e52fa0074 /libcrystfel
parent64a006630632c58be1ca740d7f12041879da6e00 (diff)
Add serial numbers to chunks
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image.h2
-rw-r--r--libcrystfel/src/stream.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h
index 6589ac1a..2498b5c2 100644
--- a/libcrystfel/src/image.h
+++ b/libcrystfel/src/image.h
@@ -183,6 +183,8 @@ struct image {
int id; /* ID number of the thread
* handling this image */
+ int serial; /* Monotonically ascending serial
+ * number for this image */
struct sample *spectrum;
int nsamples; /* Number of wavelengths */
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 04627a0c..6ae6fd64 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -634,6 +634,8 @@ void write_chunk(Stream *st, struct image *i, struct hdfile *hdfile,
fprintf(st->fh, "Event: %s\n", get_event_string(i->event));
}
+ fprintf(st->fh, "Image serial number: %i\n", i->serial);
+
indexer = indexer_str(i->indexed_by);
fprintf(st->fh, "indexed_by = %s\n", indexer);
free(indexer);