aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-04-18 14:32:14 +0200
committerThomas White <taw@physics.org>2024-04-18 14:32:14 +0200
commit52bde38abbcb53d163355a71fc9e99332ffe3dee (patch)
tree54bf334103708bcbf0b821c583b06f66769edf22 /tests
parent536d1a563e5c93cbbefb3556ea897acaf8fa70ce (diff)
parent62a2fdee1b7e69a1fe1ecb58e286866c41b6bb81 (diff)
Merge branch 'julia'
Diffstat (limited to 'tests')
-rw-r--r--tests/gradient_check.c8
-rw-r--r--tests/gradient_check_utils.c6
-rw-r--r--tests/prof2d_check.c24
-rw-r--r--tests/stream_roundtrip.c2
4 files changed, 19 insertions, 21 deletions
diff --git a/tests/gradient_check.c b/tests/gradient_check.c
index 001bff7a..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]);
+ 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 67ba255e..8b9191cf 100644
--- a/tests/gradient_check_utils.c
+++ b/tests/gradient_check_utils.c
@@ -141,11 +141,9 @@ struct reflpeak *make_test_image(int *pn_refls, struct image *image)
}
crystal_set_mosaicity(cr, 0.0);
crystal_set_profile_radius(cr, 0.005e9);
- crystal_set_image(cr, image);
crystal_set_cell(cr, random_rotated_cell(rng));
- refls = predict_to_res(cr, detgeom_max_resolution(image->detgeom, image->lambda));
- crystal_set_reflections(cr, refls);
+ refls = predict_to_res(cr, image, detgeom_max_resolution(image->detgeom, image->lambda));
n_refls = num_reflections(refls);
/* Associate a peak with every reflection */
@@ -175,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 28ecd67c..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) \
@@ -125,15 +126,14 @@ int main(int argc, char *argv[])
cr = crystal_new();
crystal_set_profile_radius(cr, 0.001e9);
crystal_set_mosaicity(cr, 0.0); /* radians */
- crystal_set_image(cr, &image);
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));
- list = predict_to_res(cr, 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++ ) {
@@ -169,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);
diff --git a/tests/stream_roundtrip.c b/tests/stream_roundtrip.c
index d36191bb..79231b62 100644
--- a/tests/stream_roundtrip.c
+++ b/tests/stream_roundtrip.c
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
image->features = image_feature_list_new();
for ( i=0; i<N_PEAKS; i++ ) {
image_add_feature(image->features, peak_fs[i], peak_ss[i],
- peak_pn[i], image, peak_i[i], NULL);
+ peak_pn[i], peak_i[i], NULL);
}
st = stream_open_for_write("stream_roundtrip.stream", dtempl);