diff options
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/peaks.c b/src/peaks.c index 4b87ba08..936601a3 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -222,20 +222,22 @@ int integrate_peak(struct image *image, int cfs, int css, if ( val > max ) max = val; - /* Inner mask */ + /* If outside inner mask, estimate noise from this region */ if ( fs*fs + ss*ss > lim_sq ) { - /* Estimate noise from this region */ - noise += val; //fabs(val); + + /* Noise */ + noise += val; noise_counts++; - /* Estimate the standard deviation of the noise */ - noise_meansq += fabs(val)*fabs(val) ; - continue; - } + noise_meansq += pow(val, 2.0); - pixel_counts ++; - total += val; - fsct += val*(cfs+fs); - ssct += val*(css+ss); + } else { + + /* Peak */ + pixel_counts++; + total += val; + fsct += val*(cfs+fs); + ssct += val*(css+ss); + } } } |