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 /libcrystfel/src/taketwo.c | |
parent | 2d2b1219b9ee8689b36056f32b97fbd5349c9fc1 (diff) |
Default/required/optional flags for TakeTwo
Diffstat (limited to 'libcrystfel/src/taketwo.c')
-rw-r--r-- | libcrystfel/src/taketwo.c | 26 |
1 files changed, 14 insertions, 12 deletions
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; |