aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValerio Mariani <valerio.mariani@desy.de>2015-02-23 10:24:46 +0100
committerThomas White <taw@physics.org>2015-02-23 11:08:18 +0100
commit750ffce173aa9d345d72411ba398d4c34203a649 (patch)
tree5efc9ff4875183d65d5d287653258ce4caaf2bb9 /src
parentfbb051e4b455bd8bb33544d2d3b342b53a09008a (diff)
-e option for hdfsee overrides data layout description from geometry file
Diffstat (limited to 'src')
-rw-r--r--src/dw-hdfsee.c29
-rw-r--r--src/hdfsee.c8
2 files changed, 34 insertions, 3 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index a018df5e..0c5852c5 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -2668,6 +2668,30 @@ static gint displaywindow_keypress(GtkWidget *widget, GdkEventKey *event,
}
+static void impose_twod_geometry(DisplayWindow *dw, const char *twod_element)
+{
+
+ int i;
+
+ for ( i=0; i<dw->image->det->n_panels; i++ ) {
+
+ struct panel *p;
+
+ p = &dw->image->det->panels[i];
+
+ if ( p->data != NULL ) free(p->data);
+ p->data = strdup(twod_element);
+
+ if ( p->dim_structure ) free_dim_structure(p->dim_structure);
+ p->dim_structure = default_dim_structure();
+ }
+
+ dw->image->det->path_dim = 0;
+ dw->image->det->dim_dim = 0;
+
+}
+
+
DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
const char *peaks,
double boost, int binning,
@@ -2742,6 +2766,11 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
return NULL;
}
+ if ( dw->image->det != NULL && element != NULL ) {
+ impose_twod_geometry(dw, element);
+ dw->multi_event = 0;
+ }
+
if ( dw->image->det != NULL && ( dw->image->det->path_dim != 0 ||
dw->image->det->dim_dim != 0 )) {
diff --git a/src/hdfsee.c b/src/hdfsee.c
index 89b8bf95..d33f01cc 100644
--- a/src/hdfsee.c
+++ b/src/hdfsee.c
@@ -75,9 +75,11 @@ static void show_help(const char *s)
" black-blue-pink-red-orange-\n"
" -yellow-white.\n"
" -e, --image=<element> Start up displaying this image from the\n"
-" HDF5 file. Example: /data/data0.\n"
-" (Only used when a geometry file is not"
-" provided. See option -g)"
+" HDF5 file. When this option is used,\n"
+" information about the data layout\n"
+" from the geometry file is ignored (See\n"
+" manual page).\n"
+" Example: /data/data0.\n"
" --event=<event code> Event to show from multi-event file.\n"
" -g, --geometry=<filename> Use geometry from file for display.\n"
" (When this option is used, the value of\n"