diff options
author | Thomas White <taw@physics.org> | 2019-03-18 15:53:11 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-03-18 15:53:11 +0100 |
commit | f22471de9120578e38c334dd6a2c4aec9d90f57a (patch) | |
tree | f231c818d5f69888058e680f838e661215f39277 /src/dw-hdfsee.c | |
parent | acd27b952ab2b0f11e23add58cf691bd4386ce99 (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/dw-hdfsee.c')
-rw-r--r-- | src/dw-hdfsee.c | 8 |
1 files changed, 7 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; |