From 59b99486be3865a53049d0c6317157d9f22bc0e1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 19 Feb 2013 18:13:13 +0100 Subject: Add -cell and -nocell to indexing methods --- libcrystfel/src/index.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'libcrystfel/src/index.c') diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 0ab467a6..311dc2ce 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -316,6 +316,19 @@ static IndexingMethod set_lattice(IndexingMethod a) } +/* Set the indexer flags for "use no unit cell parameters" */ +static IndexingMethod set_nocellparams(IndexingMethod a) +{ + return a & ~INDEXING_USE_CELL_PARAMETERS; +} + + +/* Set the indexer flags for "use unit cell parameters" */ +static IndexingMethod set_cellparams(IndexingMethod a) +{ + return a | INDEXING_USE_CELL_PARAMETERS; +} + char *indexer_str(IndexingMethod indm) { char *str; @@ -379,6 +392,12 @@ char *indexer_str(IndexingMethod indm) strcat(str, "-nolatt"); } + if ( indm & INDEXING_USE_CELL_PARAMETERS ) { + strcat(str, "-cell"); + } else { + strcat(str, "-nocell"); + } + return str; } @@ -433,6 +452,12 @@ IndexingMethod *build_indexer_list(const char *str) } else if ( strcmp(methods[i], "nolatt") == 0) { list[nmeth] = set_nolattice(list[nmeth]); + } else if ( strcmp(methods[i], "cell") == 0) { + list[nmeth] = set_cellparams(list[nmeth]); + + } else if ( strcmp(methods[i], "nocell") == 0) { + list[nmeth] = set_nocellparams(list[nmeth]); + } else { ERROR("Bad list of indexing methods: '%s'\n", str); return NULL; -- cgit v1.2.3