From a9d289c5c9c5c3491b8ecd6580c381a423094734 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 12 Feb 2013 02:16:44 -0800 Subject: Improve handling of indexing methods --- libcrystfel/src/mosflm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'libcrystfel/src/mosflm.c') diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c index 98d4280d..22606fa4 100644 --- a/libcrystfel/src/mosflm.c +++ b/libcrystfel/src/mosflm.c @@ -798,28 +798,33 @@ int run_mosflm(struct image *image, IndexingPrivate *ipriv) } -IndexingPrivate *mosflm_prepare(IndexingMethod indm, UnitCell *cell, +IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell, const char *filename, struct detector *det, 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 ( *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; } + /* Flags that MOSFLM knows about */ + *indm &= INDEXING_METHOD_MASK | INDEXING_CHECK_CELL_COMBINATIONS + | INDEXING_CHECK_CELL_AXES | INDEXING_CHECK_PEAKS + | INDEXING_USE_LATTICE_TYPE; + mp = malloc(sizeof(struct mosflm_private)); if ( mp == NULL ) return NULL; mp->ltl = ltl; mp->template = cell; - mp->indm = indm; + mp->indm = *indm; return (IndexingPrivate *)mp; } -- cgit v1.2.3