aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-22 13:50:30 +0200
committerThomas White <taw@physics.org>2017-09-22 13:50:30 +0200
commitd9982145681e16b896d275e297fe6fc0bb406692 (patch)
treebb3faa3a260025287cbb10847d5169eec4d51773 /libcrystfel
parente07517ba5b579c757908ed0855ac6ee0e8f5cd3b (diff)
asdf uses prior information for its volume constraint, so add "cell" to the method
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/asdf.c17
-rw-r--r--libcrystfel/src/index.h3
2 files changed, 16 insertions, 4 deletions
diff --git a/libcrystfel/src/asdf.c b/libcrystfel/src/asdf.c
index 6fee6952..22fe3320 100644
--- a/libcrystfel/src/asdf.c
+++ b/libcrystfel/src/asdf.c
@@ -1073,8 +1073,8 @@ int run_asdf(struct image *image, void *ipriv)
struct asdf_private *dp = (struct asdf_private *)ipriv;
- if ( dp->indm & INDEXING_CHECK_CELL_AXES ||
- dp->indm & INDEXING_CHECK_CELL_COMBINATIONS) {
+ if ( dp->indm & INDEXING_USE_CELL_PARAMETERS ) {
+
double a, b, c, gamma, beta, alpha;
cell_get_parameters(dp->template, &a, &b, &c,
&alpha, &beta, &gamma);
@@ -1171,7 +1171,18 @@ void *asdf_prepare(IndexingMethod *indm, UnitCell *cell,
struct asdf_private *dp;
/* Flags that asdf knows about */
- *indm &= INDEXING_METHOD_MASK;
+ *indm &= INDEXING_METHOD_MASK
+ | INDEXING_USE_CELL_PARAMETERS | INDEXING_USE_LATTICE_TYPE;
+
+ if ( ((*indm & INDEXING_USE_LATTICE_TYPE)
+ && !(*indm & INDEXING_USE_CELL_PARAMETERS))
+ || ((*indm & INDEXING_USE_CELL_PARAMETERS)
+ && !(*indm & INDEXING_USE_LATTICE_TYPE)) )
+ {
+ ERROR("Invalid asdf options: "
+ "try asdf-nolatt-nocell or asdf-latt-cell.\n");
+ return NULL;
+ }
dp = malloc(sizeof(struct asdf_private));
if ( dp == NULL ) return NULL;
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index 2aad377b..516a9368 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -41,7 +41,8 @@
#define INDEXING_DEFAULTS_DIRAX (INDEXING_DIRAX)
-#define INDEXING_DEFAULTS_ASDF (INDEXING_ASDF)
+#define INDEXING_DEFAULTS_ASDF (INDEXING_ASDF | INDEXING_USE_LATTICE_TYPE \
+ | INDEXING_USE_CELL_PARAMETERS)
#define INDEXING_DEFAULTS_MOSFLM (INDEXING_MOSFLM | INDEXING_USE_LATTICE_TYPE \
| INDEXING_USE_CELL_PARAMETERS)