From 4eb0015369115791fc721ca97736d30fc38d8ae1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 27 Feb 2018 15:58:00 +0100 Subject: Switch to simpler scaling algorithm --- src/post-refinement.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/post-refinement.c') diff --git a/src/post-refinement.c b/src/post-refinement.c index af701575..7402b91c 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -381,6 +381,8 @@ static void do_pr_refine(Crystal *cr, const RefList *full, int n_params = 0; int n_iter = 0; int status; + int r; + double G; double residual_start, residual_free_start; residual_start = residual(cr, full, 0, NULL, NULL); @@ -456,6 +458,12 @@ static void do_pr_refine(Crystal *cr, const RefList *full, apply_parameters(min->x, initial, rv, cr); update_predictions(cr); calculate_partialities(cr, PMODEL_XSPHERE); + r = linear_scale(full, crystal_get_reflections(cr), &G); + if ( r == 0 ) { + crystal_set_osf(cr, G); + } else { + fprintf(stderr, "Scaling failure after refinement.\n"); + } if ( verbose ) { STATUS("PR final: dev = %10.5e, free dev = %10.5e\n", -- cgit v1.2.3