aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-06-10 16:58:09 +0200
committerThomas White <taw@physics.org>2020-07-29 18:53:44 +0200
commite319f5d880e15a969bfe2b156989dfab1ba8ac75 (patch)
tree6c5abac6a15ca07c197a7737af668d5de629492e /tests
parent33c2a7cf51375c8a0c16861fdff6d17a11be3b5f (diff)
Convert prediction_gradient_check to detgeom
Diffstat (limited to 'tests')
-rw-r--r--tests/prediction_gradient_check.c17
1 files changed, 13 insertions, 4 deletions
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 <taw@physics.org>
+ * 2012-2020 Thomas White <taw@physics.org>
*
* 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);