aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-03-18 15:53:11 +0100
committerThomas White <taw@physics.org>2019-03-18 15:53:11 +0100
commitf22471de9120578e38c334dd6a2c4aec9d90f57a (patch)
treef231c818d5f69888058e680f838e661215f39277 /src
parentacd27b952ab2b0f11e23add58cf691bd4386ce99 (diff)
hdfsee: Use a fresh detector geometry structure each time a new image is loaded
If the clen is a literal number, AND there's a coffset, the coffset will be added every time the image data is loaded. Now, it'll start from scratch.
Diffstat (limited to 'src')
-rw-r--r--src/dw-hdfsee.c8
-rw-r--r--src/dw-hdfsee.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index c4149cd4..d10e9da8 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -934,6 +934,11 @@ static gint displaywindow_newevent(DisplayWindow *dw, int new_event)
float **old_dp = dw->image->dp;
int **old_bad = dw->image->bad;
+ if ( dw->image->det != NULL ) {
+ free_detector_geometry(dw->image->det);
+ }
+
+ dw->image->det = copy_geom(dw->original_geom);
fail = imagefile_read(dw->imagefile, dw->image,
dw->ev_list->events[new_event]);
if ( fail ) {
@@ -2994,7 +2999,8 @@ DisplayWindow *displaywindow_open(char *filename, char *geom_filename,
dw->rg_coll_name = NULL;
}
- dw->image->det = det_geom;
+ dw->original_geom = det_geom;
+ dw->image->det = copy_geom(det_geom);
dw->image->beam = beam;
dw->image->lambda = 0.0;
dw->image->filename = filename;
diff --git a/src/dw-hdfsee.h b/src/dw-hdfsee.h
index 85fa288f..a7871654 100644
--- a/src/dw-hdfsee.h
+++ b/src/dw-hdfsee.h
@@ -96,6 +96,7 @@ typedef struct {
GdkPixbuf **pixbufs;
gulong motion_callback;
cairo_surface_t *surf;
+ struct detector *original_geom;
int not_ready_yet;