diff options
author | Richard A. Kirian <rkirian@asu.edu> | 2011-10-16 22:28:16 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:39 +0100 |
commit | b7da56e7061e3c5f742c00ac11411ddee7b1185b (patch) | |
tree | f711cadcfdf7c46c3d65ba016419a5b5708e7c4f /src/peaks.c | |
parent | 1231eaeda71f7aa9d6c564406ee1e3f426e716c7 (diff) |
Add option to limit peak SNR
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/peaks.c b/src/peaks.c index fd1b0983..92556ea6 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -281,7 +281,8 @@ int integrate_peak(struct image *image, int cfs, int css, static void search_peaks_in_panel(struct image *image, float threshold, - float min_gradient, struct panel *p) + float min_gradient, float min_snr, + struct panel *p) { int fs, ss, stride; float *data; @@ -297,6 +298,7 @@ static void search_peaks_in_panel(struct image *image, float threshold, int nrej_pro = 0; int nrej_fra = 0; int nrej_bad = 0; + int nrej_snr = 0; int nacc = 0; int ncull; const int pws = p->peak_sep/2; @@ -404,8 +406,8 @@ static void search_peaks_in_panel(struct image *image, float threshold, continue; } - if (intensity/sigma < 5) { - //printf("SNR: %g\n",intensity/sigma); + if (intensity/sigma < min_snr) { + nrej_snr++; continue; } @@ -434,12 +436,13 @@ static void search_peaks_in_panel(struct image *image, float threshold, } // STATUS("%i accepted, %i box, %i proximity, %i outside panel, " -// "%i in bad regions, %i badrow culled.\n", -// nacc, nrej_dis, nrej_pro, nrej_fra, nrej_bad, ncull); +// "%i in bad regions, %i with SNR < %g, %i badrow culled.\n", +// nacc, nrej_dis, nrej_pro, nrej_fra, nrej_bad, nrej_snr, min_snr, ncull); } -void search_peaks(struct image *image, float threshold, float min_gradient) +void search_peaks(struct image *image, float threshold, float min_gradient, + float min_snr) { int i; @@ -453,7 +456,7 @@ void search_peaks(struct image *image, float threshold, float min_gradient) struct panel *p = &image->det->panels[i]; if ( p->no_index ) continue; - search_peaks_in_panel(image, threshold, min_gradient, p); + search_peaks_in_panel(image, threshold, min_gradient, min_snr, p); } } |