From fd81cfcf3fad3d772221865d113f9d37184815ad Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 15 Jul 2010 10:25:46 +0200 Subject: Fix scale factors --- src/statistics.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/statistics.c b/src/statistics.c index 1acbb718..e0a2e71a 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -97,8 +97,8 @@ static double stat_scale_sqrti(const double *ref1, const double *ref2, i2 = lookup_intensity(ref2, h, k, l); f2 = i2 > 0.0 ? sqrt(i2) : 0.0; - top += i1 * i2; - bot += i2 * i2; + top += f1 * f2; + bot += f2 * f2; } @@ -122,8 +122,8 @@ static double internal_r2(const double *ref1, const double *ref2, it = get_item(items, i); h = it->h; k = it->k; l = it->l; - i1 = scale * lookup_intensity(ref1, h, k, l); - i2 = lookup_intensity(ref2, h, k, l); + i1 = lookup_intensity(ref1, h, k, l); + i2 = scale * lookup_intensity(ref2, h, k, l); top += pow(i1 - i2, 2.0); bot += pow(i1, 2.0); @@ -154,6 +154,7 @@ static double internal_rmerge(const double *ref1, const double *ref2, f1 = i1 > 0.0 ? sqrt(i1) : 0.0; i2 = lookup_intensity(ref2, h, k, l); f2 = i2 > 0.0 ? sqrt(i2) : 0.0; + f2 *= scale; top += fabs(f1 - f2); bot += f1 + f2; -- cgit v1.2.3