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/indexamajig.c | |
parent | 1231eaeda71f7aa9d6c564406ee1e3f426e716c7 (diff) |
Add option to limit peak SNR
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r-- | src/indexamajig.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index 79bf69e6..26ea158d 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -68,6 +68,7 @@ struct static_index_args int config_bgsub; float threshold; float min_gradient; + float min_snr; struct detector *det; IndexingMethod *indm; IndexingPrivate **ipriv; @@ -182,6 +183,8 @@ static void show_help(const char *s) " --threshold=<n> Only accept peaks above <n> ADU. Default: 800.\n" " --min-gradient=<n> Minimum gradient for Zaefferer peak search.\n" " Default: 100,000.\n" +" --min-snr=<n> Minimum signal-to-noise ratio for peaks.\n" +" Default: 5.\n" " -e, --image=<element> Use this image from the HDF5 file.\n" " Example: /data/data0.\n" " Default: The first one found.\n" @@ -310,7 +313,8 @@ static void process_image(void *pp, int cookie) break; case PEAK_ZAEF : search_peaks(&image, pargs->static_args.threshold, - pargs->static_args.min_gradient); + pargs->static_args.min_gradient, + pargs->static_args.min_snr); break; } @@ -506,6 +510,7 @@ int main(int argc, char *argv[]) int config_basename = 0; float threshold = 800.0; float min_gradient = 100000.0; + float min_snr = 5; struct detector *det; char *geometry = NULL; IndexingMethod *indm; @@ -563,6 +568,7 @@ int main(int argc, char *argv[]) {"sat-corr", 0, &config_satcorr, 1}, /* Compat */ {"threshold", 1, NULL, 't'}, {"min-gradient", 1, NULL, 4}, + {"min-snr", 1, NULL, 11}, {"no-check-prefix", 0, &config_checkprefix, 0}, {"no-closer-peak", 0, &config_closer, 0}, {"insane", 0, &config_insane, 1}, @@ -641,6 +647,10 @@ int main(int argc, char *argv[]) min_gradient = strtof(optarg, NULL); break; + case 11 : + min_snr = strtof(optarg, NULL); + break; + case 'e' : element = strdup(optarg); break; @@ -899,6 +909,7 @@ int main(int argc, char *argv[]) qargs.static_args.cellr = cellr; qargs.static_args.threshold = threshold; qargs.static_args.min_gradient = min_gradient; + qargs.static_args.min_snr = min_snr; qargs.static_args.det = det; qargs.static_args.indm = indm; qargs.static_args.ipriv = ipriv; |