diff options
author | Thomas White <taw@physics.org> | 2016-10-19 14:48:08 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2016-10-19 14:48:08 +0200 |
commit | c8029395ae91a4660efdae16b72c2e085ebf14d2 (patch) | |
tree | e02c7b741c5fc0aa50bc057768721f330e94d95f | |
parent | 2d2b1219b9ee8689b36056f32b97fbd5349c9fc1 (diff) |
Default/required/optional flags for TakeTwo
-rw-r--r-- | libcrystfel/src/index.h | 3 | ||||
-rw-r--r-- | libcrystfel/src/taketwo.c | 26 |
2 files changed, 16 insertions, 13 deletions
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h index 6ac9792a..23545506 100644 --- a/libcrystfel/src/index.h +++ b/libcrystfel/src/index.h @@ -58,8 +58,9 @@ | INDEXING_USE_CELL_PARAMETERS \ | INDEXING_RETRY | INDEXING_REFINE) -#define INDEXING_DEFAULTS_TAKETWO (INDEXING_TAKETWO \ +#define INDEXING_DEFAULTS_TAKETWO (INDEXING_TAKETWO | INDEXING_CHECK_PEAKS \ | INDEXING_USE_CELL_PARAMETERS \ + | INDEXING_USE_LATTICE_TYPE \ | INDEXING_RETRY | INDEXING_REFINE) /* Axis check is needed for XDS, because it likes to permute the axes */ diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c index 49a3c933..2ba72c91 100644 --- a/libcrystfel/src/taketwo.c +++ b/libcrystfel/src/taketwo.c @@ -927,22 +927,24 @@ IndexingPrivate *taketwo_prepare(IndexingMethod *indm, UnitCell *cell, struct detector *det, float *ltl) { struct taketwo_private *tp; - int need_cell = 0; - if ( *indm & INDEXING_CHECK_CELL_COMBINATIONS ) need_cell = 1; - if ( *indm & INDEXING_CHECK_CELL_AXES ) need_cell = 1; + /* Flags that TakeTwo knows about */ + *indm &= INDEXING_METHOD_MASK | INDEXING_CHECK_PEAKS + | INDEXING_USE_LATTICE_TYPE | INDEXING_USE_CELL_PARAMETERS + | INDEXING_CONTROL_FLAGS; - if ( need_cell && !cell_has_parameters(cell) ) { - ERROR("Altering your TakeTwo flags because cell parameters were" - " not provided.\n"); - *indm &= ~INDEXING_CHECK_CELL_COMBINATIONS; - *indm &= ~INDEXING_CHECK_CELL_AXES; + if ( !( (*indm & INDEXING_USE_LATTICE_TYPE) + && (*indm & INDEXING_USE_CELL_PARAMETERS)) ) + { + ERROR("TakeTwo indexing requires cell and lattice type " + "information.\n"); + return NULL; } - /* Flags that TakeTwo knows about */ - *indm &= INDEXING_METHOD_MASK | INDEXING_CHECK_CELL_COMBINATIONS - | INDEXING_CHECK_CELL_AXES | INDEXING_CHECK_PEAKS - | INDEXING_CONTROL_FLAGS; + if ( cell == NULL ) { + ERROR("TakeTwo indexing requires a unit cell.\n"); + return NULL; + } tp = malloc(sizeof(struct taketwo_private)); if ( tp == NULL ) return NULL; |