diff options
author | Thomas White <taw@physics.org> | 2016-11-08 16:20:58 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-27 11:02:02 +0100 |
commit | d813960912ddc76d5cff0501b4f7783c3eeca95d (patch) | |
tree | 4dc11e2ecd789d34a451abc81d799508118a6b86 /tests | |
parent | cc64a9ae6c4ca7518ba904d6cdf38b3d8dccbbf7 (diff) |
Separate partiality calculation from prediction
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pr_p_gradient_check.c | 20 | ||||
-rw-r--r-- | tests/prediction_gradient_check.c | 7 | ||||
-rw-r--r-- | tests/prof2d_check.c | 6 |
3 files changed, 21 insertions, 12 deletions
diff --git a/tests/pr_p_gradient_check.c b/tests/pr_p_gradient_check.c index 9c2a6633..5322fcca 100644 --- a/tests/pr_p_gradient_check.c +++ b/tests/pr_p_gradient_check.c @@ -178,7 +178,9 @@ 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, pmodel); + compare = predict_to_res(cr_new, largest_q(image)); + crystal_set_reflections(cr_new, compare); + calculate_partialities(cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0, pmodel); cell_free(crystal_get_cell(cr_new)); @@ -186,7 +188,9 @@ 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, pmodel); + compare = predict_to_res(cr_new, largest_q(image)); + crystal_set_reflections(cr_new, compare); + calculate_partialities(cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2, pmodel); cell_free(crystal_get_cell(cr_new)); @@ -196,18 +200,24 @@ static void calc_either_side(Crystal *cr, double incr_val, } else { struct image im_moved; + Crystal *cr_new = crystal_copy(cr); + crystal_set_image(cr_new, &im_moved); /* "Image" properties */ im_moved = *image; shift_parameter(&im_moved, refine, -incr_val); - compare = find_intersections(&im_moved, cr, pmodel); + compare = predict_to_res(cr_new, largest_q(&im_moved)); + crystal_set_reflections(cr_new, compare); + calculate_partialities(cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 0, pmodel); reflist_free(compare); im_moved = *image; shift_parameter(&im_moved, refine, +incr_val); - compare = find_intersections(&im_moved, cr, pmodel); + compare = predict_to_res(cr_new, largest_q(&im_moved)); + crystal_set_reflections(cr_new, compare); + calculate_partialities(cr_new, pmodel); scan_partialities(crystal_get_reflections(cr), compare, valid, vals, 2, pmodel); reflist_free(compare); @@ -237,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, pmodel); + reflections = predict_to_res(cr, largest_q(crystal_get_image(cr))); crystal_set_reflections(cr, reflections); nref = num_reflections(reflections); diff --git a/tests/prediction_gradient_check.c b/tests/prediction_gradient_check.c index b9f23217..0ffc07ca 100644 --- a/tests/prediction_gradient_check.c +++ b/tests/prediction_gradient_check.c @@ -185,14 +185,14 @@ static void calc_either_side(Crystal *cr, double incr_val, Crystal *cr_new; cr_new = new_shifted_crystal(cr, refine, -incr_val); - compare = find_intersections(image, cr_new, PMODEL_SCSPHERE); + compare = predict_to_res(cr_new, largest_q(image)); scan(crystal_get_reflections(cr), compare, valid, vals, 0); cell_free(crystal_get_cell(cr_new)); crystal_free(cr_new); reflist_free(compare); cr_new = new_shifted_crystal(cr, refine, +incr_val); - compare = find_intersections(image, cr_new, PMODEL_SCSPHERE); + compare = predict_to_res(cr_new, largest_q(image)); scan(crystal_get_reflections(cr), compare, valid, vals, 2); cell_free(crystal_get_cell(cr_new)); crystal_free(cr_new); @@ -221,8 +221,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, - PMODEL_SCSPHERE); + reflections = predict_to_res(cr, largest_q(crystal_get_image(cr))); crystal_set_reflections(cr, reflections); nref = num_reflections(reflections); diff --git a/tests/prof2d_check.c b/tests/prof2d_check.c index 9fe8b356..8b9de871 100644 --- a/tests/prof2d_check.c +++ b/tests/prof2d_check.c @@ -3,11 +3,11 @@ * * Check 2D profile fitting * - * Copyright © 2013-2014 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2013-2016 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: - * 2013-2014 Thomas White <taw@physics.org> + * 2013-2014,2016 Thomas White <taw@physics.org> * * This file is part of CrystFEL. * @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) image.n_crystals = 1; image.crystals = &cr; - list = find_intersections(&image, cr, PMODEL_SCSPHERE); + list = predict_to_res(cr, largest_q(&image)); crystal_set_reflections(cr, list); for ( fs=0; fs<w; fs++ ) { |