aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--libcrystfel/src/stream.c8
-rw-r--r--libcrystfel/src/stream.h5
-rw-r--r--src/gui_project.c3
3 files changed, 12 insertions, 4 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
diff --git a/src/gui_project.c b/src/gui_project.c
index 38e800ba..0c7d5502 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -865,7 +865,8 @@ struct image *find_result(struct crystfelproject *proj,
}
image = stream_read_chunk(st, STREAM_REFLECTIONS
- | STREAM_PEAKS);
+ | STREAM_PEAKS
+ | STREAM_DATA_DETGEOM);
stream_close(st);
return image;