aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index a50d4d31..d8c48a2e 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -147,7 +147,7 @@ static int debug_index(struct image *image)
}
-static char *base_indexer_str(IndexingMethod indm)
+char *base_indexer_str(IndexingMethod indm)
{
char *str;
@@ -313,22 +313,16 @@ static void *prepare_method(IndexingMethod *m, UnitCell *cell,
}
-IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
- const DataTemplate *dtempl,
- float *tols, IndexingFlags flags,
- struct taketwo_options *ttopts,
- struct xgandalf_options *xgandalf_opts,
- struct pinkIndexer_options *pinkIndexer_opts,
- struct felix_options *felix_opts)
+IndexingMethod *parse_indexing_methods(const char *method_list,
+ int *pn)
{
int i, n;
char **method_strings;
- IndexingPrivate *ipriv;
+ IndexingMethod *methods;
- /* Parse indexing methods */
n = assplode(method_list, ",", &method_strings, ASSPLODE_NONE);
- IndexingMethod *methods = malloc(n * sizeof(IndexingMethod));
+ methods = malloc(n * sizeof(IndexingMethod));
if ( methods == NULL ) {
ERROR("Failed to allocate indexing method list\n");
return NULL;
@@ -355,6 +349,25 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
}
free(method_strings);
+ *pn = n;
+ return methods;
+}
+
+
+IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
+ const DataTemplate *dtempl,
+ float *tols, IndexingFlags flags,
+ struct taketwo_options *ttopts,
+ struct xgandalf_options *xgandalf_opts,
+ struct pinkIndexer_options *pinkIndexer_opts,
+ struct felix_options *felix_opts)
+{
+ IndexingPrivate *ipriv;
+ IndexingMethod *methods;
+ int n, i;
+
+ methods = parse_indexing_methods(method_list, &n);
+
/* No cell parameters -> no cell checking, no prior cell */
if ( !cell_has_parameters(cell) ) {