From e319f5d880e15a969bfe2b156989dfab1ba8ac75 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 10 Jun 2020 16:58:09 +0200 Subject: Convert prediction_gradient_check to detgeom --- tests/prediction_gradient_check.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/prediction_gradient_check.c b/tests/prediction_gradient_check.c index 098ea9b9..38601719 100644 --- a/tests/prediction_gradient_check.c +++ b/tests/prediction_gradient_check.c @@ -7,7 +7,7 @@ * a research centre of the Helmholtz Association. * * Authors: - * 2012-2016 Thomas White + * 2012-2020 Thomas White * * This file is part of CrystFEL. * @@ -185,14 +185,16 @@ static void calc_either_side(Crystal *cr, double incr_val, Crystal *cr_new; cr_new = new_shifted_crystal(cr, refine, -incr_val); - compare = predict_to_res(cr_new, largest_q(image)); + compare = predict_to_res(cr_new, detgeom_max_resolution(image->detgeom, + image->lambda)); scan(crystal_get_reflections(cr), compare, valid, vals, 0, det); cell_free(crystal_get_cell(cr_new)); crystal_free(cr_new); reflist_free(compare); cr_new = new_shifted_crystal(cr, refine, +incr_val); - compare = predict_to_res(cr_new, largest_q(image)); + compare = predict_to_res(cr_new, detgeom_max_resolution(image->detgeom, + image->lambda)); scan(crystal_get_reflections(cr), compare, valid, vals, 2, det); cell_free(crystal_get_cell(cr_new)); crystal_free(cr_new); @@ -200,6 +202,13 @@ static void calc_either_side(Crystal *cr, double incr_val, } +static double max_resolution(const struct image *image) +{ + return detgeom_max_resolution(image->detgeom, + image->lambda); +} + + static double test_gradients(Crystal *cr, double incr_val, int refine, const char *str, const char *file, int quiet, int plot, struct detgeom *det) @@ -221,7 +230,7 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, int n_line; double cc; - reflections = predict_to_res(cr, largest_q(crystal_get_image(cr))); + reflections = predict_to_res(cr, max_resolution(crystal_get_image(cr))); crystal_set_reflections(cr, reflections); nref = num_reflections(reflections); -- cgit v1.2.3