aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-10-27 15:27:52 +0100
committerThomas White <taw@physics.org>2020-10-27 15:27:52 +0100
commit0972792a889f6614c08380f52b08d919b7da31d1 (patch)
treee91132744ca73ec94fb41aee1ac2425cf716439a /libcrystfel
parentec808350915885ebb5172be7f4d6d1d6e73742e3 (diff)
Add a new StreamFlag for generating the detgeom structure
This is a hack, and should be replaced by something which gets the metadata from the stream rather than hitting the read image file every time.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/stream.c8
-rw-r--r--libcrystfel/src/stream.h5
2 files changed, 10 insertions, 3 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 25066314..08f0e332 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -990,9 +990,11 @@ struct image *stream_read_chunk(Stream *st, StreamFlags srf)
if ( strcmp(line, STREAM_CHUNK_END_MARKER) == 0 ) {
if ( have_filename && have_ev ) {
/* Success */
- create_detgeom(image, st->dtempl);
- image_set_zero_data(image, st->dtempl);
- image_set_zero_mask(image, st->dtempl);
+ if ( srf & STREAM_DATA_DETGEOM ) {
+ create_detgeom(image, st->dtempl);
+ image_set_zero_data(image, st->dtempl);
+ image_set_zero_mask(image, st->dtempl);
+ }
/* FIXME: Maybe arbitrary spectrum from file (?) */
image->spectrum = spectrum_generate_gaussian(image->lambda,
image->bw);
diff --git a/libcrystfel/src/stream.h b/libcrystfel/src/stream.h
index 5eadf69b..3d57c7b6 100644
--- a/libcrystfel/src/stream.h
+++ b/libcrystfel/src/stream.h
@@ -75,6 +75,11 @@ typedef enum {
/** Read the peak search results */
STREAM_PEAKS = 4,
+ /** Reconstruct the detgeom structure,
+ * and create (blank) data/mask arrays.
+ * (NB this is (currently) a slow operation) */
+ STREAM_DATA_DETGEOM = 8,
+
} StreamFlags;
#ifdef __cplusplus