aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-03-06 15:11:17 +0100
committerThomas White <taw@physics.org>2019-03-06 15:11:17 +0100
commit29fdf21f5bc807e612cb560d262617304fef33fe (patch)
tree471084a90279aa28d6ee5e1727593c61a3eeecc0 /src
parent02e1c27088afab67f2e637ab57fd11ed1f0f71e5 (diff)
indexamajig: Rename --min-gradient to --min-squared-gradient
The eventual aim of this is to deprecate the "--min-gradient" option, resolving the long-standing confusion about whether this option is the gradient or the squared gradient.
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c15
-rw-r--r--src/process_image.c2
-rw-r--r--src/process_image.h2
3 files changed, 14 insertions, 5 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index f452b033..2d584726 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -98,7 +98,8 @@ static void show_help(const char *s)
" --filter-noise Apply noise filter to image data\n"
" --threshold=<n> Threshold for peak detection\n"
" (zaef,peakfinder8 only) Default: 800\n"
-" --min-gradient=<n> Minimum squared gradient\n"
+" --min-squared-gradient=<n>\n"
+" Minimum squared gradient\n"
" (zaef only) Default: 100,000\n"
" --min-snr=<n> Minimum signal/noise ratio for peaks\n"
" (zaef,peakfinder8, peakfinder9 only) Default: 5\n"
@@ -350,7 +351,7 @@ int main(int argc, char *argv[])
iargs.tols[2] = 5.0;
iargs.tols[3] = 1.5;
iargs.threshold = 800.0;
- iargs.min_gradient = 100000.0;
+ iargs.min_sq_gradient = 100000.0;
iargs.min_snr = 5.0;
iargs.min_pix_count = 2;
iargs.max_pix_count = 200;
@@ -531,6 +532,8 @@ int main(int argc, char *argv[])
{"xgandalf-max-lvl", 1, NULL, 356},
{"spectrum-file", 1, NULL, 357},
{"wait-for-file", 1, NULL, 358},
+ {"min-squared-gradient",1,NULL, 359},
+ {"min-sq-gradient", 1, NULL, 359}, /* compat */
{0, 0, NULL, 0}
};
@@ -602,7 +605,9 @@ int main(int argc, char *argv[])
return 1;
case 304 :
- iargs.min_gradient = strtof(optarg, NULL);
+ iargs.min_sq_gradient = strtof(optarg, NULL);
+ ERROR("Recommend using --min-squared-gradient instead "
+ "of --min-gradient.\n");
break;
case 305 :
@@ -933,6 +938,10 @@ int main(int argc, char *argv[])
}
break;
+ case 359 :
+ iargs.min_sq_gradient = strtof(optarg, NULL);
+ break;
+
case 0 :
break;
diff --git a/src/process_image.c b/src/process_image.c
index 31abcb21..a5418486 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -266,7 +266,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
case PEAK_ZAEF:
set_last_task(last_task, "peaksearch:zaef");
search_peaks(&image, iargs->threshold,
- iargs->min_gradient, iargs->min_snr,
+ iargs->min_sq_gradient, iargs->min_snr,
iargs->pk_inn, iargs->pk_mid, iargs->pk_out,
iargs->use_saturated);
break;
diff --git a/src/process_image.h b/src/process_image.h
index 90925592..2a43d11d 100644
--- a/src/process_image.h
+++ b/src/process_image.h
@@ -63,7 +63,7 @@ struct index_args
int median_filter;
int satcorr;
float threshold;
- float min_gradient;
+ float min_sq_gradient;
float min_snr;
int check_hdf5_snr;
struct detector *det;