aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-02-19 18:13:13 +0100
committerThomas White <taw@physics.org>2013-02-19 18:13:13 +0100
commit59b99486be3865a53049d0c6317157d9f22bc0e1 (patch)
tree277c5e32714e547e8fb3d242ed5f3d28f6708e92 /libcrystfel/src/index.c
parenta5439f150d97b30576ea9f337c004ff0a9e404a1 (diff)
Add -cell and -nocell to indexing methods
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c25
1 files changed, 25 insertions, 0 deletions
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;