From fc7908049360ff88baea23ca0a879779c66018d6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 11 May 2011 14:03:56 +0200 Subject: Tidy up integration and ESD calculation, and pass checks --- src/peaks.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/peaks.c') diff --git a/src/peaks.c b/src/peaks.c index aa56da8b..7db2ccc9 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -257,16 +257,12 @@ int integrate_peak(struct image *image, int cfs, int css, if ( in_bad_region(image->det, *pfs, *pss) ) return 1; if ( sigma != NULL ) { - /* - * first term is standard deviation of background per pixel + /* First term is standard deviation of background per pixel * sqrt(pixel_counts) - increase of error for integrated value * sqrt(2) - increase of error for background subtraction */ - *sigma = sqrt( noise_meansq/noise_counts - (noise_mean * noise_mean)) - *sqrt(2.0*pixel_counts); - /* printf(" counts %d %d \n", noise_counts, pixel_counts); - printf(" intensity, bg, diff, %f, %f, %f \n", total, pixel_counts*noise_mean, total - pixel_counts*noise_mean); - printf(" sigma = %f \n", *sigma); */ + *sigma = sqrt(noise_meansq/noise_counts-(noise_mean*noise_mean)) + * sqrt(2.0*pixel_counts); } if ( pbg != NULL ) { -- cgit v1.2.3