aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-06-05 11:32:21 +0200
committerThomas White <taw@physics.org>2019-07-17 09:18:16 +0200
commite187ffe71c39ab26c350b56eddb9212e81ada144 (patch)
tree3f4a8b7e990f187916d1cb5e463f9e95e2e7b3ff /src
parent2e101d99268b467c1ab900121c4fba3bbab6f4b1 (diff)
Weight reflections according to how much they need to be scaled up
Diffstat (limited to 'src')
-rw-r--r--src/merge.c9
1 files changed, 6 insertions, 3 deletions
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;