aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-11-19 17:44:12 +0100
committerThomas White <taw@physics.org>2013-11-23 02:52:51 -0800
commit9d2f2b2ab97c10da2ebd581c5f31bf662f5c705b (patch)
treeb92c433cc9c87026dbfb1f49e166c3a509a4a26f
parent671d31caf204963bc3bc46b1c832110113eeaf6b (diff)
Fix mean_var_area()
-rw-r--r--libcrystfel/src/integration.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index fe6f3127..7046e109 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1117,7 +1117,7 @@ static void mean_var_area(struct intcontext *ic, struct peak_box *bx,
for ( p=0; p<ic->w; p++ ) {
for ( q=0; q<ic->w; q++ ) {
if ( bx->bm[p + ic->w*q] != v ) continue;
- sum += bx->a*p + bx->b*q + bx->c;
+ sum += boxi(ic, bx, p, q);
n++;
}
}
@@ -1127,11 +1127,10 @@ static void mean_var_area(struct intcontext *ic, struct peak_box *bx,
for ( p=0; p<ic->w; p++ ) {
for ( q=0; q<ic->w; q++ ) {
if ( bx->bm[p + ic->w*q] != v ) continue;
- var += pow(bx->a*p + bx->b*q + bx->c - mean, 2.0);
+ var += pow(boxi(ic, bx, p, q) - mean, 2.0);
n++;
}
}
-
var = var/n;
*pmean = mean;