aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Gevorkov <yaroslav.gevorkov@desy.de>2019-05-07 19:26:57 +0200
committerThomas White <taw@physics.org>2019-05-08 10:27:02 +0200
commitc908df3b78051f3c4a08d4114d61b5505ae51afc (patch)
tree2898060c0a024696f2bd71f62643c054f5f7217b
parentbf602577aa55c0adcbf6b79021d40d2456119bed (diff)
Add new xgandalf options
-rw-r--r--doc/man/indexamajig.16
-rw-r--r--libcrystfel/src/xgandalf.c15
-rw-r--r--libcrystfel/src/xgandalf.h1
-rw-r--r--src/indexamajig.c25
4 files changed, 39 insertions, 8 deletions
diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1
index 4b428475..d1ed0df4 100644
--- a/doc/man/indexamajig.1
+++ b/doc/man/indexamajig.1
@@ -413,6 +413,8 @@ These set low-level parameters for the Felix indexing algorithm.
.IP \fB--xgandalf-no-deviation-from-provided-cell\fR
.IP \fB--xgandalf-max-lattice-vector-length=\fIn\fR
.IP \fB--xgandalf-min-lattice-vector-length=\fIn\fR
+.IP \fB--xgandalf-max-peaks\fR
+.IP \fB--xgandalf-fast-execution\fR
.PD
These set low-level parameters for the XGANDALF indexing algorithm.
.IP
@@ -425,6 +427,10 @@ These set low-level parameters for the XGANDALF indexing algorithm.
\fB--xgandalf-no-deviation-from-provided-cell\fR if a prior unit cell was provided, and this flag is set, the found unit cell will have exactly the same size as the provided one.
.IP
\fB--xgandalf-min-lattice-vector-length\fR and \fB--xgandalf-min-lattice-vector-length\fR minimum and maximum possible lattice vector lengths (unit is A). Used for fitting without prior lattice as starting point for gradient descent, so the final minimum lattice vector length can be smaller/highier as min/max. Note: This is valid for the uncentered cell, i.e. the P-cell! Default is 30A and 250A respectively.
+.IP
+\fB--xgandalf-max-peaks\fR maximum number of peaks used for indexing. For refinement all peaks are used. Peaks are selected by increasing radius. Limits the maximum execution time for patterns with a huge amount of peaks - either real ones or false positives. Default is 250.
+.IP
+\fB--xgandalf-fast-execution\fR Shortcut to set --xgandalf-sampling-pitch=2 --xgandalf-grad-desc-iterations=3
.SH INTEGRATION OPTIONS
.PD 0
diff --git a/libcrystfel/src/xgandalf.c b/libcrystfel/src/xgandalf.c
index 1900d784..98ef44d0 100644
--- a/libcrystfel/src/xgandalf.c
+++ b/libcrystfel/src/xgandalf.c
@@ -203,10 +203,6 @@ void *xgandalf_prepare(IndexingMethod *indm, UnitCell *cell,
FAKE_REFLECTION_RADIUS);
xgandalf_private_data->indexer = IndexerPlain_new(experimentSettings);
- IndexerPlain_setSamplingPitch(xgandalf_private_data->indexer,
- samplingPitch);
- IndexerPlain_setGradientDescentIterationsCount(xgandalf_private_data->indexer,
- gradientDescentIterationsCount);
if (xgandalf_opts->no_deviation_from_provided_cell) {
IndexerPlain_setRefineWithExactLattice(xgandalf_private_data->indexer, 1);
@@ -231,14 +227,17 @@ void *xgandalf_prepare(IndexingMethod *indm, UnitCell *cell,
FAKE_REFLECTION_RADIUS);
xgandalf_private_data->indexer = IndexerPlain_new(experimentSettings);
- IndexerPlain_setSamplingPitch(xgandalf_private_data->indexer,
- samplingPitch);
- IndexerPlain_setGradientDescentIterationsCount(xgandalf_private_data->indexer,
- gradientDescentIterationsCount);
ExperimentSettings_delete(experimentSettings);
}
+ IndexerPlain_setSamplingPitch(xgandalf_private_data->indexer,
+ samplingPitch);
+ IndexerPlain_setGradientDescentIterationsCount(xgandalf_private_data->indexer,
+ gradientDescentIterationsCount);
+ IndexerPlain_setMaxPeaksToUseForIndexing(xgandalf_private_data->indexer,
+ xgandalf_opts->maxPeaksForIndexing);
+
/* Flags that XGANDALF knows about */
*indm &= INDEXING_METHOD_MASK | INDEXING_USE_CELL_PARAMETERS;
diff --git a/libcrystfel/src/xgandalf.h b/libcrystfel/src/xgandalf.h
index 09dbf7d4..23c5c1b0 100644
--- a/libcrystfel/src/xgandalf.h
+++ b/libcrystfel/src/xgandalf.h
@@ -47,6 +47,7 @@ struct xgandalf_options {
unsigned int no_deviation_from_provided_cell;
float minLatticeVectorLength_A;
float maxLatticeVectorLength_A;
+ int maxPeaksForIndexing;
};
#include "index.h"
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 2d584726..b19af80a 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -185,6 +185,9 @@ static void show_help(const char *s)
" --xgandalf-grad-desc-iterations\n"
" Gradient descent iterations: 0 (few) to 5 (many)\n"
" Default: 4\n"
+" --xgandalf-fast-execution Shortcut to set\n"
+" --xgandalf-sampling-pitch=2\n"
+" --xgandalf-grad-desc-iterations=3\n"
" --xgandalf-tolerance Relative tolerance of the lattice vectors.\n"
" Default is 0.02\n"
" --xgandalf-no-deviation-from-provided-cell\n"
@@ -196,6 +199,10 @@ static void show_help(const char *s)
" --xgandalf-max-lattice-vector-length\n"
" Maximum possible lattice vector length in A.\n"
" Default: 250 A\n"
+" --xgandalf-max-peaks\n"
+" Maximum number of peaks used for indexing.\n"
+" All peaks are used for refinement.\n"
+" Default: 250\n"
"\n"
"\nIntegration options:\n\n"
" --integration=<meth> Integration method (rings,prof2d)-(cen,nocen)\n"
@@ -407,6 +414,7 @@ int main(int argc, char *argv[])
iargs.xgandalf_opts.no_deviation_from_provided_cell = 0;
iargs.xgandalf_opts.minLatticeVectorLength_A = 30;
iargs.xgandalf_opts.maxLatticeVectorLength_A = 250;
+ iargs.xgandalf_opts.maxPeaksForIndexing = 250;
iargs.felix_opts.ttmin = -1.0;
iargs.felix_opts.ttmax = -1.0;
iargs.felix_opts.min_visits = 0;
@@ -534,6 +542,8 @@ int main(int argc, char *argv[])
{"wait-for-file", 1, NULL, 358},
{"min-squared-gradient",1,NULL, 359},
{"min-sq-gradient", 1, NULL, 359}, /* compat */
+ {"xgandalf-fast-execution", 0, NULL, 360},
+ {"xgandalf-max-peaks", 1, NULL, 361},
{0, 0, NULL, 0}
};
@@ -942,6 +952,21 @@ int main(int argc, char *argv[])
iargs.min_sq_gradient = strtof(optarg, NULL);
break;
+ case 360:
+ iargs.xgandalf_opts.sampling_pitch = 2;
+ iargs.xgandalf_opts.grad_desc_iterations = 3;
+ break;
+
+ case 361:
+ if (sscanf(optarg, "%i",
+ &iargs.xgandalf_opts.maxPeaksForIndexing) != 1)
+ {
+ ERROR("Invalid value for "
+ "--xgandalf-max-peaks\n");
+ return 1;
+ }
+ break;
+
case 0 :
break;