aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/asdf.c
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/src/asdf.c
parente07517ba5b579c757908ed0855ac6ee0e8f5cd3b (diff)
asdf uses prior information for its volume constraint, so add "cell" to the method
Diffstat (limited to 'libcrystfel/src/asdf.c')
-rw-r--r--libcrystfel/src/asdf.c17
1 files changed, 14 insertions, 3 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;