aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard A. Kirian <rkirian@asu.edu>2011-10-16 21:24:10 -0700
committerThomas White <taw@physics.org>2012-02-22 15:27:39 +0100
commit1231eaeda71f7aa9d6c564406ee1e3f426e716c7 (patch)
tree6c788c2cecdaa9eede7fcbe743bc1a54aaf87b05
parent1074dc9faf000fec117a8f243c7343b09df5da51 (diff)
Threshold SNR in peak search
-rw-r--r--src/peaks.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/peaks.c b/src/peaks.c
index 1c3564d1..fd1b0983 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -290,6 +290,9 @@ static void search_peaks_in_panel(struct image *image, float threshold,
double f_fs = 0.0;
double f_ss = 0.0;
double intensity = 0.0;
+ double sigma = 0.0;
+ double pbg = 0.0;
+ double pmax = 0.0;
int nrej_dis = 0;
int nrej_pro = 0;
int nrej_fra = 0;
@@ -386,7 +389,8 @@ static void search_peaks_in_panel(struct image *image, float threshold,
* intensity of this peak is only an estimate at this stage. */
r = integrate_peak(image, mask_fs, mask_ss,
&f_fs, &f_ss, &intensity,
- NULL, NULL, NULL, 0, 1, 0);
+ &pbg, &pmax, &sigma, 0, 1, 1);
+
if ( r ) {
/* Bad region - don't detect peak */
nrej_bad++;
@@ -400,6 +404,11 @@ static void search_peaks_in_panel(struct image *image, float threshold,
continue;
}
+ if (intensity/sigma < 5) {
+ //printf("SNR: %g\n",intensity/sigma);
+ continue;
+ }
+
/* Check for a nearby feature */
image_feature_closest(image->features, f_fs, f_ss, &d, &idx);
if ( d < p->peak_sep/2.0 ) {