diff options
author | Thomas White <taw@physics.org> | 2020-08-17 16:00:56 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-08-17 16:00:56 +0200 |
commit | f3253fb25c8a9c249eda1e2aeea3f4f4e7e3eb8e (patch) | |
tree | 0c47e56c7461ab9ce8bf69a2d31bb9507ece59ad | |
parent | 5764e660226792b32fa89992d1ff720d1e2e1d51 (diff) |
Expose parse_indexing_methods and base_indexer_str
-rw-r--r-- | libcrystfel/src/index.c | 35 | ||||
-rw-r--r-- | libcrystfel/src/index.h | 4 |
2 files changed, 28 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) ) { diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h index e064a4b3..ab2b12a4 100644 --- a/libcrystfel/src/index.h +++ b/libcrystfel/src/index.h @@ -140,6 +140,10 @@ extern char *indexer_str(IndexingMethod indm); extern IndexingMethod get_indm_from_string(const char *method); extern IndexingMethod get_indm_from_string_2(const char *method, int *err); +extern IndexingMethod *parse_indexing_methods(const char *method_list, + int *pn); +extern char *base_indexer_str(IndexingMethod indm); + #include "cell.h" #include "image.h" #include "datatemplate.h" |