aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-11 17:06:59 +0100
committerThomas White <taw@physics.org>2021-03-11 17:06:59 +0100
commite21cc1f84a8cb2b0627e99383c882e59efda4920 (patch)
tree7d8c56a259b8b4b9e030f22e26871e3cbe1942b5 /src/indexamajig.c
parent0722b797e25ba3bf95d5eec56198460be0eb6aa8 (diff)
indexamajig: Use static wavelength from DataTemplate as estimate
If the geometry file contains a literal wavelength, then let's use it. That's better than nagging the user for a --wavelength-estimate.
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index e4da883a..6980c4b7 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -601,6 +601,7 @@ int main(int argc, char *argv[])
FelixOptions *felix_opts = NULL;
XGandalfOptions *xgandalf_opts = NULL;
PinkIndexerOptions *pinkindexer_opts = NULL;
+ double wl_from_dt;
/* Defaults for "top level" arguments */
args.filename = NULL;
@@ -930,6 +931,16 @@ int main(int argc, char *argv[])
}
+ wl_from_dt = data_template_get_wavelength_if_possible(args.iargs.dtempl);
+ if ( !isnan(wl_from_dt) ) {
+ if ( !isnan(args.iargs.wavelength_estimate) ) {
+ ERROR("WARNING: Ignoring your value for "
+ "--wavelength-estimate because the geometry file "
+ "already contains a static value.\n");
+ }
+ args.iargs.wavelength_estimate = wl_from_dt;
+ }
+
/* Prepare the indexing system */
if ( args.indm_str == NULL ) {