diff options
author | Thomas White <taw@physics.org> | 2020-06-10 15:34:22 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:53:44 +0200 |
commit | c8693a9af33849be40a94e9c437d87c068fce740 (patch) | |
tree | 957369f29f0d557f954d13500deb1e9d33ae4529 /tests/integration_check.c | |
parent | 9de2a50dea4c81cc728bd61a678c074dbe702e2d (diff) |
Update tests for detgeom
Diffstat (limited to 'tests/integration_check.c')
-rw-r--r-- | tests/integration_check.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/tests/integration_check.c b/tests/integration_check.c index 50e99d65..b7deb5ca 100644 --- a/tests/integration_check.c +++ b/tests/integration_check.c @@ -7,7 +7,7 @@ * a research centre of the Helmholtz Association. * * Authors: - * 2013-2016 Thomas White <taw@physics.org> + * 2013-2020 Thomas White <taw@physics.org> * * This file is part of CrystFEL. * @@ -73,30 +73,24 @@ int main(int argc, char *argv[]) } fclose(fh); - image.beam = NULL; image.lambda = ph_eV_to_lambda(9000.0); - image.det = calloc(1, sizeof(struct detector)); - image.det->n_panels = 1; - image.det->panels = calloc(1, sizeof(struct panel)); - - image.det->panels[0].w = w; - image.det->panels[0].h = h; - image.det->panels[0].fsx = 1.0; - image.det->panels[0].fsy = 0.0; - image.det->panels[0].ssx = 0.0; - image.det->panels[0].ssy = 1.0; - image.det->panels[0].xfs = 1.0; - image.det->panels[0].yfs = 0.0; - image.det->panels[0].xss = 0.0; - image.det->panels[0].yss = 1.0; - image.det->panels[0].cnx = -w/2; - image.det->panels[0].cny = -h/2; - image.det->panels[0].clen = 60.0e-3; - image.det->panels[0].res = 100000; /* 10 px per mm */ - image.det->panels[0].adu_per_eV = NAN; - image.det->panels[0].adu_per_photon = 10; - image.det->panels[0].max_adu = +INFINITY; /* No cutoff */ + image.detgeom = calloc(1, sizeof(struct detgeom)); + image.detgeom->n_panels = 1; + image.detgeom->panels = calloc(1, sizeof(struct detgeom_panel)); + + image.detgeom->panels[0].w = w; + image.detgeom->panels[0].h = h; + image.detgeom->panels[0].fsx = 1.0; + image.detgeom->panels[0].fsy = 0.0; + image.detgeom->panels[0].ssx = 0.0; + image.detgeom->panels[0].ssy = 1.0; + image.detgeom->panels[0].cnx = -w/2; + image.detgeom->panels[0].cny = -h/2; + image.detgeom->panels[0].cnz = 60.0e-3 / 100e-6; + image.detgeom->panels[0].pixel_pitch = 100e-6; /* 10 px per mm */ + image.detgeom->panels[0].adu_per_photon = 10; + image.detgeom->panels[0].max_adu = +INFINITY; /* No cutoff */ image.dp = malloc(sizeof(float *)); image.dp[0] = malloc(w*h*sizeof(float)); @@ -163,9 +157,7 @@ int main(int argc, char *argv[]) histogram_show(hi); histogram_free(hi); - free(image.beam); - free(image.det->panels); - free(image.det); + detgeom_free(image.detgeom); free(image.dp[0]); free(image.dp); |