From e187ffe71c39ab26c350b56eddb9212e81ada144 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 5 Jun 2019 11:32:21 +0200 Subject: Weight reflections according to how much they need to be scaled up --- src/merge.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/merge.c') diff --git a/src/merge.c b/src/merge.c index a2a49ccf..33567ecd 100644 --- a/src/merge.c +++ b/src/merge.c @@ -218,7 +218,7 @@ static void run_merge_job(void *vwargs, int cookie) } /* Reflections count less the more they have to be scaled up */ - w = get_partiality(refl); + w = get_partiality(refl) / correct_reflection_nopart(1.0, refl, G, B, res); /* Running mean and variance calculation */ temp = w + sumweight; @@ -396,8 +396,11 @@ double residual(Crystal *cr, const RefList *full, int free, if ( get_redundancy(match) < 2 ) continue; int1 = correct_reflection_nopart(get_intensity(refl), refl, G, B, res); - int2 = get_partiality(refl)*I_full; - w = 1.0; + int2 = get_partiality(refl) * I_full; + w = 1.0 / correct_reflection_nopart(1.0, refl, G, B, res); + if ( isnan(w) ) { + w = 0.0; + } num += fabs(int1 - int2) * w; den += fabs(int1 + int2) * w/2.0; -- cgit v1.2.3