aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/mosflm.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-02-09 22:16:25 -0800
committerThomas White <taw@physics.org>2013-02-09 22:16:25 -0800
commit00d4c6ce684b1352d585a287f8ef31c1c30a7c35 (patch)
tree90a8442ff28aa1a64e9840043ee7b72faa6081da /libcrystfel/src/mosflm.c
parent11fe97d53a627fd5caf067bd9fe8f967cf3a72df (diff)
Complain if a unit cell is needed and not provided
Diffstat (limited to 'libcrystfel/src/mosflm.c')
-rw-r--r--libcrystfel/src/mosflm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index 28aca7ee..f4f45d40 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -733,6 +733,16 @@ IndexingPrivate *mosflm_prepare(IndexingMethod indm, UnitCell *cell,
struct beam_params *beam, float *ltl)
{
struct mosflm_private *mp;
+ int need_cell = 0;
+
+ if ( indm & INDEXING_CHECK_CELL_COMBINATIONS ) need_cell = 1;
+ if ( indm & INDEXING_CHECK_CELL_AXES ) need_cell = 1;
+ if ( indm & INDEXING_USE_LATTICE_TYPE ) need_cell = 1;
+
+ if ( need_cell && (cell == NULL) ) {
+ ERROR("MOSFLM needs a unit cell for this set of flags.\n");
+ return NULL;
+ }
mp = malloc(sizeof(struct mosflm_private));
if ( mp == NULL ) return NULL;