diff options
author | Thomas White <taw@physics.org> | 2011-05-11 14:03:56 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:26 +0100 |
commit | fc7908049360ff88baea23ca0a879779c66018d6 (patch) | |
tree | 46a454961f18abe2bac7f62e7ef7ae8319c8b1cd /src/peaks.c | |
parent | b5ff617e1fb65431c3b0cadd3a3d9e917ea7ec38 (diff) |
Tidy up integration and ESD calculation, and pass checks
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 10 |
1 files changed, 3 insertions, 7 deletions
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 ) { |