aboutsummaryrefslogtreecommitdiff
path: root/src/statistics.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-07-15 10:25:46 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:53 +0100
commitfd81cfcf3fad3d772221865d113f9d37184815ad (patch)
treeccc9ecfcc423a9d0d131127e75c48589561d2a9f /src/statistics.c
parent6a5422356c15962726df2261aa53354b0ff12662 (diff)
Fix scale factors
Diffstat (limited to 'src/statistics.c')
-rw-r--r--src/statistics.c9
1 files 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;