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.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index d6c58c4a..c684cc1f 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -60,6 +60,7 @@
#include "indexers/xgandalf.h"
#include "indexers/pinkindexer.h"
#include "indexers/fromfile.h"
+#include "indexers/smallcell.h"
#include "uthash.h"
@@ -161,6 +162,10 @@ char *base_indexer_str(IndexingMethod indm)
strcpy(str, "file");
break;
+ case INDEXING_SMALLCELL :
+ strcpy(str, "smallcell");
+ break;
+
default :
strcpy(str, "(unknown)");
break;
@@ -197,6 +202,7 @@ static void *prepare_method(IndexingMethod *m, UnitCell *cell,
struct felix_options *felix_opts,
struct taketwo_options *taketwo_opts,
struct fromfile_options *fromfile_opts,
+ struct smallcell_options *smallcell_opts,
struct asdf_options *asdf_opts)
{
char *str;
@@ -229,6 +235,10 @@ static void *prepare_method(IndexingMethod *m, UnitCell *cell,
priv = fromfile_prepare(m, fromfile_opts);
break;
+ case INDEXING_SMALLCELL :
+ priv = smallcell_prepare(m, smallcell_opts, cell);
+ break;
+
case INDEXING_FELIX :
priv = felix_prepare(m, cell, felix_opts);
break;
@@ -328,6 +338,7 @@ IndexingPrivate *setup_indexing(const char *method_list,
struct pinkindexer_options *pinkIndexer_opts,
struct felix_options *felix_opts,
struct fromfile_options *fromfile_opts,
+ struct smallcell_options *smallcell_opts,
struct asdf_options *asdf_opts)
{
IndexingPrivate *ipriv;
@@ -400,6 +411,7 @@ IndexingPrivate *setup_indexing(const char *method_list,
felix_opts,
ttopts,
fromfile_opts,
+ smallcell_opts,
asdf_opts);
if ( ipriv->engine_private[i] == NULL ) {
@@ -489,6 +501,10 @@ void cleanup_indexing(IndexingPrivate *ipriv)
fromfile_cleanup(ipriv->engine_private[n]);
break;
+ case INDEXING_SMALLCELL :
+ smallcell_cleanup(ipriv->engine_private[n]);
+ break;
+
case INDEXING_TAKETWO :
taketwo_cleanup(ipriv->engine_private[n]);
break;
@@ -614,6 +630,13 @@ static int try_indexer(struct image *image, IndexingMethod indm,
profile_end("fromfile");
break;
+ case INDEXING_SMALLCELL :
+ set_last_task("indexing:smallcell");
+ profile_start("smallcell");
+ r = smallcell_index(image, mpriv);
+ profile_end("smallcell");
+ break;
+
case INDEXING_FELIX :
set_last_task("indexing:felix");
profile_start("felix");
@@ -1123,6 +1146,11 @@ IndexingMethod get_indm_from_string_2(const char *str, int *err)
method = INDEXING_FILE;
return method;
+ } else if ( strcmp(bits[i], "smallcell") == 0) {
+ if ( have_method ) return warn_method(str);
+ method = INDEXING_SMALLCELL;
+ return method;
+
} else if ( strcmp(bits[i], "latt") == 0) {
method = set_lattice(method);
@@ -1225,6 +1253,7 @@ void default_method_options(struct taketwo_options **ttopts,
struct pinkindexer_options **pinkIndexer_opts,
struct felix_options **felix_opts,
struct fromfile_options **fromfile_opts,
+ struct smallcell_options **smallcell_opts,
struct asdf_options **asdf_opts)
{
taketwo_default_options(ttopts);
@@ -1232,5 +1261,6 @@ void default_method_options(struct taketwo_options **ttopts,
pinkIndexer_default_options(pinkIndexer_opts);
felix_default_options(felix_opts);
fromfile_default_options(fromfile_opts);
+ smallcell_default_options(smallcell_opts);
asdf_default_options(asdf_opts);
}