From a06a3f67f57de0bc85982976b9ea6d598598e014 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 14 Aug 2014 14:34:40 +0200 Subject: WIP on gradients for scsphere --- tests/pr_p_gradient_check.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/pr_p_gradient_check.c b/tests/pr_p_gradient_check.c index b88380eb..82ed2b02 100644 --- a/tests/pr_p_gradient_check.c +++ b/tests/pr_p_gradient_check.c @@ -45,7 +45,8 @@ static void scan_partialities(RefList *reflections, RefList *compare, - int *valid, long double *vals[3], int idx) + int *valid, long double *vals[3], int idx, + PartialityModel pmodel) { int i; Reflection *refl; @@ -70,7 +71,7 @@ static void scan_partialities(RefList *reflections, RefList *compare, } get_partial(refl2, &r1, &r2, &p, &clamp_low, &clamp_high); - if ( clamp_low && clamp_high ) { + if ( clamp_low && clamp_high && (pmodel != PMODEL_SCSPHERE) ) { if ( !within_tolerance(p, 1.0, 0.001) ) { signed int h, k, l; @@ -190,7 +191,7 @@ static void calc_either_side(Crystal *cr, double incr_val, cr_new = new_shifted_crystal(cr, refine, -incr_val); compare = find_intersections(image, cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, - vals, 0); + vals, 0, pmodel); cell_free(crystal_get_cell(cr_new)); crystal_free(cr_new); reflist_free(compare); @@ -198,7 +199,7 @@ static void calc_either_side(Crystal *cr, double incr_val, cr_new = new_shifted_crystal(cr, refine, +incr_val); compare = find_intersections(image, cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, - vals, 2); + vals, 2, pmodel); cell_free(crystal_get_cell(cr_new)); crystal_free(cr_new); reflist_free(compare); @@ -212,14 +213,14 @@ static void calc_either_side(Crystal *cr, double incr_val, shift_parameter(&im_moved, refine, -incr_val); compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, - valid, vals, 0); + valid, vals, 0, pmodel); reflist_free(compare); im_moved = *image; shift_parameter(&im_moved, refine, +incr_val); compare = find_intersections(&im_moved, cr, pmodel); scan_partialities(crystal_get_reflections(cr), compare, - valid, vals, 2); + valid, vals, 2, pmodel); reflist_free(compare); } @@ -271,7 +272,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, } for ( i=0; i