From c25749106ba046e1d13ec91703952aafc0fb6807 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 8 Feb 2023 15:52:29 +0100 Subject: indexamajig: Use static clen as --camera-length-estimate, if given This makes it work the same way as --wavelength-estimate. --- src/indexamajig.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/indexamajig.c') diff --git a/src/indexamajig.c b/src/indexamajig.c index 67206070..2f431636 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -856,6 +856,7 @@ int main(int argc, char *argv[]) struct fromfile_options *fromfile_opts = NULL; struct asdf_options *asdf_opts = NULL; double wl_from_dt; + double clen_from_dt; /* Defaults for "top level" arguments */ args.filename = NULL; @@ -1260,6 +1261,16 @@ int main(int argc, char *argv[]) args.iargs.wavelength_estimate = wl_from_dt; } + clen_from_dt = data_template_get_clen_if_possible(args.iargs.dtempl); + if ( !isnan(clen_from_dt) ) { + if ( !isnan(args.iargs.clen_estimate) ) { + ERROR("WARNING: Ignoring your value for " + "--camera-length-estimate because the geometry file " + "already contains a static value.\n"); + } + args.iargs.clen_estimate = clen_from_dt; + } + /* Prepare the indexing system */ if ( args.indm_str == NULL ) { -- cgit v1.2.3