aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-11 17:06:23 +0100
committerThomas White <taw@physics.org>2021-03-11 17:06:23 +0100
commit0722b797e25ba3bf95d5eec56198460be0eb6aa8 (patch)
tree236c9c69bc82d5eb8e0a91e0207c476a0933f276 /libcrystfel
parent98908775a3dd3fb9c63bca434ab98b26b447742d (diff)
Add some warnings
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index f6971b1e..767689f8 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -297,6 +297,11 @@ static double get_value(struct image *image, const char *from,
return val;
}
+ if ( image == NULL ) {
+ ERROR("Attempt to retrieve a header value without an image\n");
+ return NAN;
+ }
+
if ( is_hdf5_file(image->filename) ) {
return image_hdf5_get_value(from,
image->filename,
@@ -915,6 +920,18 @@ static int create_satmap(struct image *image,
}
+/**
+ * Create an image structure, suitable for simulation.
+ *
+ * WARNING: This is probably not the routine you are looking for!
+ * If you use this routine anywhere other than a simulation program, then
+ * you are abusing the API and can expect breakage. In particular, your
+ * program will only work when the experiment is completely described by
+ * the DataTemplate, with no values whatsoever coming from image headers.
+ *
+ * \returns the new image structure.
+ *
+ */
struct image *image_create_for_simulation(const DataTemplate *dtempl)
{
struct image *image;