diff options
author | Thomas White <taw@physics.org> | 2014-06-25 16:01:51 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-06-25 16:01:51 +0200 |
commit | cf34597c5f8583f68eaad22d85c849e1050c922b (patch) | |
tree | 4bf919b7591cc6f701157bb48885238e4b3afbfc /tests | |
parent | def8bd0c541252e7f606c9286912eb67d3ac5929 (diff) |
Pass the partiality model down from the API level
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pr_l_gradient_check.c | 11 | ||||
-rw-r--r-- | tests/pr_p_gradient_check.c | 15 | ||||
-rw-r--r-- | tests/pr_pl_gradient_check.c | 15 | ||||
-rw-r--r-- | tests/prof2d_check.c | 6 |
4 files changed, 25 insertions, 22 deletions
diff --git a/tests/pr_l_gradient_check.c b/tests/pr_l_gradient_check.c index 72d353f9..b707629f 100644 --- a/tests/pr_l_gradient_check.c +++ b/tests/pr_l_gradient_check.c @@ -89,7 +89,8 @@ static void shift_parameter(struct image *image, int k, double shift) static void calc_either_side(Crystal *cr, double incr_val, - int *valid, long double *vals[3], int refine) + int *valid, long double *vals[3], int refine, + PartialityModel pmodel) { RefList *compare; struct image *image = crystal_get_image(cr); @@ -97,14 +98,14 @@ static void calc_either_side(Crystal *cr, double incr_val, im_moved = *image; shift_parameter(&im_moved, refine, -incr_val); - compare = find_intersections(&im_moved, cr); + compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0); reflist_free(compare); im_moved = *image; shift_parameter(&im_moved, refine, +incr_val); - compare = find_intersections(&im_moved, cr); + compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2); reflist_free(compare); @@ -133,7 +134,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, int n_line; double cc; - reflections = find_intersections(crystal_get_image(cr), cr); + reflections = find_intersections(crystal_get_image(cr), cr, pmodel); crystal_set_reflections(cr, reflections); nref = num_reflections(reflections); @@ -159,7 +160,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, scan_partialities(reflections, reflections, valid, vals, 1); - calc_either_side(cr, incr_val, valid, vals, refine); + calc_either_side(cr, incr_val, valid, vals, refine, pmodel); if ( plot ) { snprintf(tmp, 32, "gradient-test-%s.dat", file); diff --git a/tests/pr_p_gradient_check.c b/tests/pr_p_gradient_check.c index c3b55cfa..8f7a66e4 100644 --- a/tests/pr_p_gradient_check.c +++ b/tests/pr_p_gradient_check.c @@ -175,7 +175,8 @@ static Crystal *new_shifted_crystal(Crystal *cr, int refine, double incr_val) } static void calc_either_side(Crystal *cr, double incr_val, - int *valid, long double *vals[3], int refine) + int *valid, long double *vals[3], int refine, + PartialityModel pmodel) { RefList *compare; struct image *image = crystal_get_image(cr); @@ -186,7 +187,7 @@ static void calc_either_side(Crystal *cr, double incr_val, /* Crystal properties */ cr_new = new_shifted_crystal(cr, refine, -incr_val); - compare = find_intersections(image, cr_new); + compare = find_intersections(image, cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0); cell_free(crystal_get_cell(cr_new)); @@ -194,7 +195,7 @@ static void calc_either_side(Crystal *cr, double incr_val, reflist_free(compare); cr_new = new_shifted_crystal(cr, refine, +incr_val); - compare = find_intersections(image, cr_new); + compare = find_intersections(image, cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2); cell_free(crystal_get_cell(cr_new)); @@ -208,14 +209,14 @@ static void calc_either_side(Crystal *cr, double incr_val, /* "Image" properties */ im_moved = *image; shift_parameter(&im_moved, refine, -incr_val); - compare = find_intersections(&im_moved, cr); + compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0); reflist_free(compare); im_moved = *image; shift_parameter(&im_moved, refine, +incr_val); - compare = find_intersections(&im_moved, cr); + compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2); reflist_free(compare); @@ -246,7 +247,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, int n_line; double cc; - reflections = find_intersections(crystal_get_image(cr), cr); + reflections = find_intersections(crystal_get_image(cr), cr, pmodel); crystal_set_reflections(cr, reflections); nref = num_reflections(reflections); @@ -272,7 +273,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, scan_partialities(reflections, reflections, valid, vals, 1); - calc_either_side(cr, incr_val, valid, vals, refine); + calc_either_side(cr, incr_val, valid, vals, refine, pmodel); if ( plot ) { snprintf(tmp, 32, "gradient-test-%s.dat", file); diff --git a/tests/pr_pl_gradient_check.c b/tests/pr_pl_gradient_check.c index ddbc1840..f83af335 100644 --- a/tests/pr_pl_gradient_check.c +++ b/tests/pr_pl_gradient_check.c @@ -175,7 +175,8 @@ static Crystal *new_shifted_crystal(Crystal *cr, int refine, double incr_val) } static void calc_either_side(Crystal *cr, double incr_val, - int *valid, long double *vals[3], int refine) + int *valid, long double *vals[3], int refine, + PartialityModel pmodel) { RefList *compare; struct image *image = crystal_get_image(cr); @@ -186,7 +187,7 @@ static void calc_either_side(Crystal *cr, double incr_val, /* Crystal properties */ cr_new = new_shifted_crystal(cr, refine, -incr_val); - compare = find_intersections(image, cr_new); + compare = find_intersections(image, cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0); cell_free(crystal_get_cell(cr_new)); @@ -194,7 +195,7 @@ static void calc_either_side(Crystal *cr, double incr_val, reflist_free(compare); cr_new = new_shifted_crystal(cr, refine, +incr_val); - compare = find_intersections(image, cr_new); + compare = find_intersections(image, cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2); cell_free(crystal_get_cell(cr_new)); @@ -208,14 +209,14 @@ static void calc_either_side(Crystal *cr, double incr_val, /* "Image" properties */ im_moved = *image; shift_parameter(&im_moved, refine, -incr_val); - compare = find_intersections(&im_moved, cr); + compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0); reflist_free(compare); im_moved = *image; shift_parameter(&im_moved, refine, +incr_val); - compare = find_intersections(&im_moved, cr); + compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2); reflist_free(compare); @@ -246,7 +247,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, int n_line; double cc; - reflections = find_intersections(crystal_get_image(cr), cr); + reflections = find_intersections(crystal_get_image(cr), cr, pmodel); crystal_set_reflections(cr, reflections); nref = num_reflections(reflections); @@ -272,7 +273,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, scan_partialities(reflections, reflections, valid, vals, 1); - calc_either_side(cr, incr_val, valid, vals, refine); + calc_either_side(cr, incr_val, valid, vals, refine, pmodel); if ( plot ) { snprintf(tmp, 32, "gradient-test-%s.dat", file); diff --git a/tests/prof2d_check.c b/tests/prof2d_check.c index f1665a6c..75b9748e 100644 --- a/tests/prof2d_check.c +++ b/tests/prof2d_check.c @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) image.n_crystals = 1; image.crystals = &cr; - list = find_intersections(&image, cr); + list = find_intersections(&image, cr, PMODEL_SPHERE); for ( fs=0; fs<w; fs++ ) { for ( ss=0; ss<h; ss++ ) { @@ -176,8 +176,8 @@ int main(int argc, char *argv[]) STATUS("%i strong, %i weak\n", n_strong, n_weak); reflist_free(list); /* integrate_prof2d() will predict again */ - integrate_prof2d(INTEGRATION_PROF2D, cr, &image, INTDIAG_NONE, 0, 0, 0, - ir_inn, ir_mid, ir_out); + integrate_prof2d(INTEGRATION_PROF2D, PMODEL_SPHERE, cr, &image, + INTDIAG_NONE, 0, 0, 0, ir_inn, ir_mid, ir_out); list = crystal_get_reflections(cr); printf("Weak reflections:\n"); |