From f22471de9120578e38c334dd6a2c4aec9d90f57a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 18 Mar 2019 15:53:11 +0100 Subject: 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. --- src/dw-hdfsee.c | 8 +++++++- src/dw-hdfsee.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3