aboutsummaryrefslogtreecommitdiff
path: root/src/dw-hdfsee.c
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/dw-hdfsee.c
parentfbb051e4b455bd8bb33544d2d3b342b53a09008a (diff)
-e option for hdfsee overrides data layout description from geometry file
Diffstat (limited to 'src/dw-hdfsee.c')
-rw-r--r--src/dw-hdfsee.c29
1 files changed, 29 insertions, 0 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 )) {