aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-10-17 17:29:16 +0200
committerThomas White <taw@physics.org>2016-10-17 17:37:10 +0200
commit22951c51e383e8a2f1a01d8bca60e4da9732633c (patch)
tree8a7f092115f473e06e53dfa5e307b7320c5c603e /libcrystfel/src/index.c
parentcc55abcff6e91d57e8226fa8a4265b667c20ceb0 (diff)
Initial TakeTwo import
Only changes from Helen's code so far: 1. Stripping trailing spaces 2. Tweaking includes (<> -> "") 3. Adding initial CrystFEL hooks at the bottom of taketwo.c 4. Moving definition of struct SpotVec to taketwo.c 5. Removing prototype for run_taketwo from taketwo.h (comment moved to .c) 6. Authorship/copyright boilerplate
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index c8c86414..e0bebfa4 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -3,12 +3,12 @@
*
* Perform indexing (somehow)
*
- * Copyright © 2012-2015 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2016 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
* Copyright © 2012 Lorenzo Galli
*
* Authors:
- * 2010-2014 Thomas White <taw@physics.org>
+ * 2010-2016 Thomas White <taw@physics.org>
* 2010-2011 Richard Kirian <rkirian@asu.edu>
* 2012 Lorenzo Galli
* 2013 Cornelius Gati <cornelius.gati@cfel.de>
@@ -56,6 +56,7 @@
#include "cell-utils.h"
#include "felix.h"
#include "predict-refine.h"
+#include "taketwo.h"
static int debug_index(struct image *image)
@@ -117,6 +118,10 @@ IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
options);
break;
+ case INDEXING_TAKETWO :
+ iprivs[n] = taketwo_prepare(&indm[n], cell, det, ltl);
+ break;
+
default :
ERROR("Don't know how to prepare indexing method %i\n",
indm[n]);
@@ -193,6 +198,10 @@ void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs)
free(privs[n]);
break;
+ case INDEXING_TAKETWO :
+ taketwo_cleanup(privs[n]);
+ break;
+
default :
ERROR("Don't know how to clean up indexing method %i\n",
indms[n]);
@@ -268,6 +277,10 @@ static int try_indexer(struct image *image, IndexingMethod indm,
r = felix_index(image, ipriv);
break;
+ case INDEXING_TAKETWO :
+ r = taketwo_index(image, ipriv);
+ break;
+
default :
ERROR("Unrecognised indexing method: %i\n", indm);
return 0;
@@ -568,6 +581,10 @@ char *indexer_str(IndexingMethod indm)
strcpy(str, "xds");
break;
+ case INDEXING_TAKETWO :
+ strcpy(str, "taketwo");
+ break;
+
case INDEXING_SIMULATION :
strcpy(str, "simulation");
break;
@@ -660,6 +677,9 @@ IndexingMethod *build_indexer_list(const char *str)
} else if ( strcmp(methods[i], "felix") == 0) {
list[++nmeth] = INDEXING_DEFAULTS_FELIX;
+ } else if ( strcmp(methods[i], "taketwo") == 0) {
+ list[++nmeth] = INDEXING_DEFAULTS_TAKETWO;
+
} else if ( strcmp(methods[i], "none") == 0) {
list[++nmeth] = INDEXING_NONE;