From 9d2f2b2ab97c10da2ebd581c5f31bf662f5c705b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 19 Nov 2013 17:44:12 +0100 Subject: Fix mean_var_area() --- libcrystfel/src/integration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libcrystfel') 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; pw; p++ ) { for ( q=0; qw; 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; pw; p++ ) { for ( q=0; qw; 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; -- cgit v1.2.3