aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-10-08 16:59:20 +0200
committerThomas White <taw@physics.org>2013-10-08 17:18:27 +0200
commit39f63a391bae09087136e48fbc4093ef83b3b33e (patch)
tree82a4d1c8fe374c012146726ce29f24ebd4bde539 /src
parent4befc077162907a972da894a288d1eb4c2430eb9 (diff)
Read scalar values from HDF5 files as 0d arrays
Historically, scalar values have been represented in our data files as 1d arrays with size=1. Now they are (more correctly) written as 0d arrays. This change allows CrystFEL to read both.
Diffstat (limited to 'src')
-rw-r--r--src/dw-hdfsee.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 3b361207..d253b904 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -1685,7 +1685,11 @@ static GtkWidget *displaywindow_addhdfgroup(struct hdfile *hdfile,
item = gtk_menu_item_new_with_label(names[i]);
- tmp = hdfile_get_string_value(hdfile, names[i]);
+ if ( hdfile_is_scalar(hdfile, names[i], 0) ) {
+ tmp = hdfile_get_string_value(hdfile, names[i]);
+ } else {
+ tmp = NULL;
+ }
if ( tmp != NULL ) {
GtkWidget *ss;