aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-21 16:18:22 +0200
committerThomas White <taw@physics.org>2017-09-21 16:18:22 +0200
commit6239330e483a47c3579b89c407ac02346f388e27 (patch)
tree0b95f7e18b6b7fc6394843b489944ef31327d360
parentbd5585847aea5f55fc33cd8a40ba9ffd8b7f425f (diff)
Improve error message when using CBF files and a multi-event geometry
-rw-r--r--libcrystfel/src/image.c2
-rw-r--r--libcrystfel/src/image.h1
-rw-r--r--src/im-sandbox.c8
3 files changed, 10 insertions, 1 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 8de16bd5..de27308c 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -861,7 +861,7 @@ static int read_cbf(struct imagefile *f, struct image *image)
/****************************** Image files ***********************************/
-static signed int is_cbf_file(const char *filename)
+signed int is_cbf_file(const char *filename)
{
FILE *fh;
char line[1024];
diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h
index c900bd29..99c3d57e 100644
--- a/libcrystfel/src/image.h
+++ b/libcrystfel/src/image.h
@@ -271,6 +271,7 @@ extern void imagefile_copy_fields(struct imagefile *f,
const struct imagefile_field_list *copyme,
FILE *fh, struct event *ev);
extern void imagefile_close(struct imagefile *f);
+extern signed int is_cbf_file(const char *filename);
/* Field lists */
extern struct imagefile_field_list *new_imagefile_field_list(void);
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 60400ad8..8b7eb29c 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -219,6 +219,14 @@ static struct filename_plus_event *get_pattern(FILE *fh, int config_basename,
if ( det->path_dim != 0 || det->dim_dim != 0 ) {
+ if ( is_cbf_file(filename) ) {
+ ERROR("Your geometry file is for a multi-event "
+ "format, but this file is in CBF format.\n");
+ ERROR("Your geometry file probably needs to be "
+ "changed.\n");
+ return NULL;
+ }
+
ev_list = initialize_event_list();
if ( scan_check == 1 ) {