From 00d4c6ce684b1352d585a287f8ef31c1c30a7c35 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 9 Feb 2013 22:16:25 -0800 Subject: Complain if a unit cell is needed and not provided --- libcrystfel/src/mosflm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libcrystfel/src/mosflm.c') 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; -- cgit v1.2.3