From 1231eaeda71f7aa9d6c564406ee1e3f426e716c7 Mon Sep 17 00:00:00 2001 From: "Richard A. Kirian" Date: Sun, 16 Oct 2011 21:24:10 -0700 Subject: Threshold SNR in peak search --- src/peaks.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ) { -- cgit v1.2.3