aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-25 15:24:36 +0100
committerThomas White <taw@physics.org>2021-03-25 16:16:01 +0100
commit31ab21aba60d592d7fc78a302e2f5620727445ee (patch)
treeffbe06942043943ec5df9cfcf2ed4a5c9f4e0a5c /src
parent1440b2b897845b713450ef1bc8460d2d6d7bb337 (diff)
indexamajig: Add --camera-length-estimate
Unfortunately, PinkIndexer needs the real camera length for its centre refinement. Giving a fake value and scaling the resulting shift does not work - the indexing rate drops with even a small error. Ideally, this would work in the same way as --wavelength-estimate, by using a static value from the geometry file if it's given. However, this is rather complicated to implement because of the way all the units stuff is implemented. Therefore, this is left as an improvement for the future.
Diffstat (limited to 'src')
-rw-r--r--src/gui_index.c4
-rw-r--r--src/indexamajig.c13
-rw-r--r--src/process_image.h3
3 files changed, 18 insertions, 2 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index 9b72ca10..f5f07f73 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -529,7 +529,9 @@ static void run_indexing_once(struct crystfelproject *proj)
ipriv = setup_indexing(methods, cell,
proj->indexing_params.tols,
indexing_flags(&proj->indexing_params),
- proj->cur_image->lambda, 1,
+ proj->cur_image->lambda,
+ detgeom_mean_camera_length(proj->cur_image->detgeom),
+ 1,
taketwoopts, xgandalf_opts,
pinkIndexer_opts, felix_opts,
NULL);
diff --git a/src/indexamajig.c b/src/indexamajig.c
index d5d3d31a..eb39a32c 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -467,6 +467,15 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
return EINVAL;
}
break;
+
+ case 415 :
+ if (sscanf(arg, "%f", &args->iargs.clen_estimate) != 1)
+ {
+ ERROR("Invalid value for --camera-length-estimate\n");
+ return EINVAL;
+ }
+ break;
+
/* ---------- Integration ---------- */
case 501 :
@@ -682,6 +691,7 @@ int main(int argc, char *argv[])
args.iargs.no_image_data = 0;
args.iargs.no_mask_data = 0;
args.iargs.wavelength_estimate = NAN;
+ args.iargs.clen_estimate = NAN;
args.iargs.n_threads = 1;
argp_program_version_hook = show_version;
@@ -784,6 +794,8 @@ int main(int argc, char *argv[])
"Estimate of the incident radiation wavelength, in metres."},
{"max-indexer-threads", 414, "n", 0,
"Maximum number of threads allowed for indexing engines."},
+ {"camera-length-estimate", 415, "metres", 0,
+ "Estimate of the camera length, in metres."},
{NULL, 0, 0, OPTION_DOC, "Integration options:", 5},
{"integration", 501, "method", OPTION_NO_USAGE, "Integration method"},
@@ -996,6 +1008,7 @@ int main(int argc, char *argv[])
args.iargs.tols,
flags,
args.iargs.wavelength_estimate,
+ args.iargs.clen_estimate,
args.iargs.n_threads,
taketwo_opts,
xgandalf_opts,
diff --git a/src/process_image.h b/src/process_image.h
index 703f0cde..c3db8551 100644
--- a/src/process_image.h
+++ b/src/process_image.h
@@ -7,7 +7,7 @@
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2010-2020 Thomas White <taw@physics.org>
+ * 2010-2021 Thomas White <taw@physics.org>
* 2014-2017 Valerio Mariani <valerio.mariani@desy.de>
* 2017-2018 Yaroslav Gevorkov <yaroslav.gevorkov@desy.de>
*
@@ -99,6 +99,7 @@ struct index_args
int no_image_data;
int no_mask_data;
float wavelength_estimate;
+ float clen_estimate;
int n_threads;
};