diff options
author | Thomas White <taw@physics.org> | 2023-07-03 15:48:00 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-07-28 13:22:05 +0200 |
commit | ef2a5b59b78ecf7df4b72795e0f08eec345b5b82 (patch) | |
tree | 60060457dcb8bb373b36624ccc5a017121b3937f /tests | |
parent | 554e1f936f1bb274cf0265bb419e8232400eb4c8 (diff) |
Calculate fs and ss gradients together, SPOT panel number, add matrix hooks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gradient_cell_asx.c | 15 | ||||
-rw-r--r-- | tests/gradient_check_utils.c | 1 | ||||
-rw-r--r-- | tests/gradient_panel_x.c | 15 |
3 files changed, 14 insertions, 17 deletions
diff --git a/tests/gradient_cell_asx.c b/tests/gradient_cell_asx.c index 47649286..c9c00ab0 100644 --- a/tests/gradient_cell_asx.c +++ b/tests/gradient_cell_asx.c @@ -53,6 +53,7 @@ int main(int argc, char *argv[]) double asx, asy, asz; double bsx, bsy, bsz; double csx, csy, csz; + gsl_matrix *panel_matrices[64]; rps = make_test_image(&n_refls, &image); @@ -72,20 +73,18 @@ int main(int argc, char *argv[]) for ( i=0; i<n_refls; i++ ) { - double calc[3]; + float calc[3]; double obs[3]; calc[0] = r_gradient(GPARAM_ASX, rps[i].refl, crystal_get_cell(image.crystals[0]), image.lambda); - calc[1] = fs_gradient(GPARAM_ASX, rps[i].refl, - crystal_get_cell(image.crystals[0]), - rps[i].panel); - - calc[2] = ss_gradient(GPARAM_ASX, rps[i].refl, - crystal_get_cell(image.crystals[0]), - rps[i].panel); + fs_ss_gradient(GPARAM_ASX, rps[i].refl, + crystal_get_cell(image.crystals[0]), + &image.detgeom->panels[rps[i].peak->pn], + panel_matrices[rps[i].peak->pn], + &calc[1], &calc[2]); obs[0] = (after[0][i] - before[0][i]) / step; obs[1] = (after[1][i] - before[1][i]) / step; diff --git a/tests/gradient_check_utils.c b/tests/gradient_check_utils.c index f52d43ca..6b641b9d 100644 --- a/tests/gradient_check_utils.c +++ b/tests/gradient_check_utils.c @@ -172,7 +172,6 @@ struct reflpeak *make_test_image(int *pn_refls, struct image *image) rps[i].peak = pk; rps[i].refl = refl; rps[i].Ih = 1.0; - rps[i].panel = &image->detgeom->panels[pn]; i++; } diff --git a/tests/gradient_panel_x.c b/tests/gradient_panel_x.c index 460044da..012df9e1 100644 --- a/tests/gradient_panel_x.c +++ b/tests/gradient_panel_x.c @@ -51,6 +51,7 @@ int main(int argc, char *argv[]) int n_wrong_obsr = 0; int fail = 0; double step = 0.1; /* Pixels */ + gsl_matrix *panel_matrices[64]; rps = make_test_image(&n_refls, &image); @@ -61,20 +62,18 @@ int main(int argc, char *argv[]) for ( i=0; i<n_refls; i++ ) { - double calc[3]; + float calc[3]; double obs[3]; calc[0] = r_gradient(GPARAM_DET_TX, rps[i].refl, crystal_get_cell(image.crystals[0]), image.lambda); - calc[1] = fs_gradient(GPARAM_DET_TX, rps[i].refl, - crystal_get_cell(image.crystals[0]), - rps[i].panel); - - calc[2] = ss_gradient(GPARAM_DET_TX, rps[i].refl, - crystal_get_cell(image.crystals[0]), - rps[i].panel); + fs_ss_gradient(GPARAM_DET_TX, rps[i].refl, + crystal_get_cell(image.crystals[0]), + &image.detgeom->panels[rps[i].peak->pn], + panel_matrices[rps[i].peak->pn], + &calc[1], &calc[2]); obs[0] = (after[0][i] - before[0][i]) / step; obs[1] = (after[1][i] - before[1][i]) / step; |