aboutsummaryrefslogtreecommitdiff
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
parentfbb051e4b455bd8bb33544d2d3b342b53a09008a (diff)
-e option for hdfsee overrides data layout description from geometry file
-rw-r--r--doc/man/hdfsee.16
-rw-r--r--src/dw-hdfsee.c29
-rw-r--r--src/hdfsee.c8
3 files changed, 39 insertions, 4 deletions
diff --git a/doc/man/hdfsee.1 b/doc/man/hdfsee.1
index c22f1894..77f7dd2b 100644
--- a/doc/man/hdfsee.1
+++ b/doc/man/hdfsee.1
@@ -43,7 +43,11 @@ Show the image after binning down by a factor of \fIb\fR.
.IP "\fB-e\fR \fIpath\fR"
.IP \fB--image=\fR\fIpath\fR
.PD
-Get the image data to display from \fIpath\fR inside the HDF5 file. For example: \fI/data/rawdata\fR. If this is not specified, the default behaviour is to display the first two-dimensional dataset with both dimensions greater than 64.
+Get the image data to display from \fIpath\fR inside the HDF5 file. Example: \fI/data/rawdata\fR.
+.IP
+If no geometry file is provided (see \fB-g\fR) and this option is not used, hdfsee will display the first two-dimensional dataset it finds in the file with both dimensions greater than 64. If a geometry file is provided, the data layout description from the file determines which image is displayed (see \fB man crystfel_geometry\fR).
+.IP
+If \fB-e\fR is used in combination with \fB-g\fR, hdfsee will attempt to show the specified dataset with the geometry applied. The data layout description from the geometry file will be ignored, the data block to be used as data source for all panels will be set to \fIpath\fR and it will be assumed to be 2-dimensional.
.PD 0
.IP "\fB-g\fR \fIfilename\fR"
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"