From 1709a699e5d31da433798b8a312e2a7098c5fa37 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 1 Dec 2009 15:48:00 +0100 Subject: Various improvements --- src/statistics.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/statistics.c') diff --git a/src/statistics.c b/src/statistics.c index 9219b069..50bfd513 100644 --- a/src/statistics.c +++ b/src/statistics.c @@ -29,7 +29,8 @@ static double stat_scale_intensity(double *obs, double *calc, unsigned int *c, double bot = 0.0; int i; - for ( i=0; i skip central beam */ + for ( i=1; i 0 ) { double obsi; @@ -54,16 +55,17 @@ double stat_r2(double *obs, double *calc, unsigned int *c, int size, scale = stat_scale_intensity(obs, calc, c, size); *scalep = scale; - for ( i=0; i skip central beam */ + for ( i=1; i 0 ) { double obsi; obsi = obs[i] / (double)c[i]; - top += fabs(obsi/scale - calc[i]); - bot += obsi/scale; + top += pow(fabs(obsi - scale*calc[i]), 2.0); + bot += pow(obsi, 2.0); } } /* else reflection not measured so don't worry about it */ - return top/bot; + return sqrt(top/bot); } -- cgit v1.2.3