aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-02-27 15:58:00 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:42 +0100
commit4eb0015369115791fc721ca97736d30fc38d8ae1 (patch)
tree93b036568e52c675771ec70fa00be61b410bb07a /src/post-refinement.c
parent5c03e7be8ae7ae54dd9d22f9fd26815e8166f336 (diff)
Switch to simpler scaling algorithm
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c8
1 files changed, 8 insertions, 0 deletions
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",