diff options
author | Andrew Martin <andrew.martin@desy.de> | 2011-06-06 17:21:29 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:28 +0100 |
commit | 174efddd7d70baada39d933c77bc568267ba115f (patch) | |
tree | cb56bfb0f10d7d39083424bea0dee81c03901352 /src/peaks.c | |
parent | ed3696ce29ddc5372a467cf7e96966f3407b6f04 (diff) |
calculate background with 3 rings
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/peaks.c b/src/peaks.c index f4bfb650..35a8cd23 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -147,8 +147,8 @@ int integrate_peak(struct image *image, int cfs, int css, int do_polar, int centroid, int bgsub) { signed int fs, ss; - double lim, out_lim; - double lim_sq, out_lim_sq; + double lim, out_lim, mid_lim; + double lim_sq, out_lim_sq, mid_lim_sq; double total = 0.0; double fsct = 0.0; double ssct = 0.0; @@ -165,8 +165,10 @@ int integrate_peak(struct image *image, int cfs, int css, if ( p->no_index ) return 1; lim = p->integr_radius; - out_lim = 2.0 + lim; + mid_lim = 2.0 + lim; + out_lim = 4.0 + lim; lim_sq = pow(lim, 2.0); + mid_lim_sq = pow(mid_lim, 2.0); out_lim_sq = pow(out_lim, 2.0); for ( fs=-out_lim; fs<+out_lim; fs++ ) { @@ -223,14 +225,14 @@ int integrate_peak(struct image *image, int cfs, int css, if ( val > max ) max = val; /* If outside inner mask, estimate noise from this region */ - if ( fs*fs + ss*ss > lim_sq ) { + if ( fs*fs + ss*ss > mid_lim_sq ) { /* Noise */ noise += val; noise_counts++; noise_meansq += pow(val, 2.0); - } else { + } else if ( fs*fs + ss*ss < lim_sq ) { /* Peak */ pixel_counts++; |