diff options
author | Thomas White <taw@physics.org> | 2024-01-18 15:35:35 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2024-02-06 16:59:34 +0100 |
commit | a40db3a0a67914934f214d5ea9473ad3465235b5 (patch) | |
tree | 79816ca3d71ca8c55b19517db9be073259173ebd | |
parent | ec990bb275f55c2b5228c6995cf9ffc19074b6f9 (diff) |
Crystals shouldn't own RefLists (part 7)
This fixes the test programs.
-rw-r--r-- | tests/gradient_check.c | 8 | ||||
-rw-r--r-- | tests/gradient_check_utils.c | 3 | ||||
-rw-r--r-- | tests/prof2d_check.c | 21 |
3 files changed, 16 insertions, 16 deletions
diff --git a/tests/gradient_check.c b/tests/gradient_check.c index 48b8311b..0722b849 100644 --- a/tests/gradient_check.c +++ b/tests/gradient_check.c @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) #ifdef CHANGE_CELL double asx, asy, asz, bsx, bsy, bsz, csx, csy, csz; - UnitCell *cell = crystal_get_cell(image.crystals[0]); + UnitCell *cell = crystal_get_cell(image.crystals[0].cr); step = 0.5e5; cell_get_reciprocal(cell, &asx, &asy, &asz, &bsx, &bsy, &bsz, @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) return 1; } - update_predictions(image.crystals[0], &image); + update_predictions(image.crystals[0].refls, image.crystals[0].cr, &image); after = make_dev_list(rps, n_refls, image.detgeom); for ( i=0; i<n_refls; i++ ) { @@ -124,11 +124,11 @@ int main(int argc, char *argv[]) double obs[3]; calc[0] = r_gradient(TEST_GPARAM, rps[i].refl, - crystal_get_cell(image.crystals[0]), + crystal_get_cell(image.crystals[0].cr), image.lambda); fs_ss_gradient(TEST_GPARAM, rps[i].refl, - crystal_get_cell(image.crystals[0]), + crystal_get_cell(image.crystals[0].cr), &image.detgeom->panels[rps[i].peak->pn], panel_matrices[rps[i].peak->pn], cx, cy, cz, &calc[1], &calc[2]); diff --git a/tests/gradient_check_utils.c b/tests/gradient_check_utils.c index e217609f..8b9191cf 100644 --- a/tests/gradient_check_utils.c +++ b/tests/gradient_check_utils.c @@ -144,7 +144,6 @@ struct reflpeak *make_test_image(int *pn_refls, struct image *image) crystal_set_cell(cr, random_rotated_cell(rng)); refls = predict_to_res(cr, image, detgeom_max_resolution(image->detgeom, image->lambda)); - crystal_set_reflections(cr, refls); n_refls = num_reflections(refls); /* Associate a peak with every reflection */ @@ -174,7 +173,7 @@ struct reflpeak *make_test_image(int *pn_refls, struct image *image) i++; } - image_add_crystal(image, cr); + image_add_crystal_refls(image, cr, refls); gsl_rng_free(rng); diff --git a/tests/prof2d_check.c b/tests/prof2d_check.c index d2ff0bcd..4ea3cee5 100644 --- a/tests/prof2d_check.c +++ b/tests/prof2d_check.c @@ -38,11 +38,12 @@ #include "histogram.h" -extern void integrate_prof2d(IntegrationMethod meth, - Crystal *cr, struct image *image, IntDiag int_diag, - signed int idh, signed int idk, signed int idl, - double ir_inn, double ir_mid, double ir_out, - pthread_mutex_t *term_lock, int **masks); +void integrate_prof2d(IntegrationMethod meth, + Crystal *cr, RefList *list, + struct image *image, IntDiag int_diag, + signed int idh, signed int idk, signed int idl, + double ir_inn, double ir_mid, double ir_out, + pthread_mutex_t *term_lock, int **masks); #define ADD_PX(fs, ss, val) \ @@ -127,12 +128,12 @@ int main(int argc, char *argv[]) crystal_set_mosaicity(cr, 0.0); /* radians */ crystal_set_cell(cr, cell); - image.n_crystals = 1; - image.crystals = &cr; - + image.crystals = NULL; + image.n_crystals = 0; list = predict_to_res(cr, &image, detgeom_max_resolution(image.detgeom, image.lambda)); - crystal_set_reflections(cr, list); + + image_add_crystal_refls(&image, cr, list); for ( fs=0; fs<w; fs++ ) { for ( ss=0; ss<h; ss++ ) { @@ -168,7 +169,7 @@ int main(int argc, char *argv[]) STATUS("%i strong, %i weak\n", n_strong, n_weak); - integrate_prof2d(INTEGRATION_PROF2D, cr, &image, + integrate_prof2d(INTEGRATION_PROF2D, cr, list, &image, INTDIAG_NONE, 0, 0, 0, ir_inn, ir_mid, ir_out, 0, NULL); |