From 294965d42b309e98c8952d3a5dea753af21713a6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 2 May 2018 17:37:12 +0200 Subject: Preparation for adjusting B factor during post-refinement Add --no-Bscale option to partialator, and pass down as far as needed residual() no longer does scaling: call scale_one_crystal() first if necessary scale_one() replaces old linear_scale() function to scale a pair of RefLists (but so far does the same as the old function) --- src/scaling.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/scaling.c') diff --git a/src/scaling.c b/src/scaling.c index 39541926..5f896e65 100644 --- a/src/scaling.c +++ b/src/scaling.c @@ -389,7 +389,7 @@ static double total_log_r(Crystal **crystals, int n_crystals, RefList *full, /* Perform iterative scaling, all the way to convergence */ -void scale_all(Crystal **crystals, int n_crystals, int nthreads) +void scale_all(Crystal **crystals, int n_crystals, int nthreads, int no_Bscale) { struct scale_args task_defaults; struct queue_args qargs; @@ -448,10 +448,11 @@ void scale_all(Crystal **crystals, int n_crystals, int nthreads) } -/* Calculates G, by which list2 should be multiplied to fit list1 */ -int linear_scale(const RefList *list1, const RefList *list2, double *G, - int complain_loudly) +/* Calculates G and B, by which list2 should be multiplied to fit list1 */ +int scale_one(const RefList *list1, const RefList *list2, int flags, + double *G, double *B) { + int complain_loudly = 0; const Reflection *refl1; const Reflection *refl2; RefListIterator *iter; @@ -474,6 +475,8 @@ int linear_scale(const RefList *list1, const RefList *list2, double *G, int n_part = 0; int n_nom = 0; + *B = 0.0; /* FIXME */ + x = malloc(max_n*sizeof(double)); w = malloc(max_n*sizeof(double)); y = malloc(max_n*sizeof(double)); @@ -556,6 +559,7 @@ int linear_scale(const RefList *list1, const RefList *list2, double *G, if ( r ) { ERROR("Scaling failed.\n"); + *G = 1.0; return 1; } @@ -567,7 +571,7 @@ int linear_scale(const RefList *list1, const RefList *list2, double *G, int i; for ( i=0; i