From 8907b7cb333a893720cac1def3d86dbe26600fa8 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 9 Feb 2013 10:18:48 -0800 Subject: Clarify lattice type information --- libcrystfel/src/index.c | 13 ++++++++++++- libcrystfel/src/index.h | 1 + libcrystfel/src/mosflm.c | 23 +++++++++++++++-------- 3 files changed, 28 insertions(+), 9 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 1c3441a6..949be146 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -206,7 +206,8 @@ void index_pattern(struct image *image, /* Set the default indexer flags. May need tweaking depending on the method */ static IndexingMethod defaults(IndexingMethod a) { - return a | INDEXING_CHECK_CELL_COMBINATIONS | INDEXING_CHECK_PEAKS; + return a | INDEXING_CHECK_CELL_COMBINATIONS | INDEXING_CHECK_PEAKS + | INDEXING_USE_LATTICE_TYPE; } @@ -235,6 +236,13 @@ static IndexingMethod set_axes(IndexingMethod a) } +/* Set the indexer flags for "use no lattice type information" */ +static IndexingMethod set_nolattice(IndexingMethod a) +{ + return a & ~INDEXING_USE_LATTICE_TYPE; +} + + IndexingMethod *build_indexer_list(const char *str) { int n, i; @@ -271,6 +279,9 @@ IndexingMethod *build_indexer_list(const char *str) } else if ( strcmp(methods[i], "axes") == 0) { list[nmeth] = set_axes(list[nmeth]); + } else if ( strcmp(methods[i], "nolatt") == 0) { + list[nmeth] = set_nolattice(list[nmeth]); + } else { ERROR("Bad list of indexing methods: '%s'\n", str); return NULL; diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h index 093e4ad6..a54691b4 100644 --- a/libcrystfel/src/index.h +++ b/libcrystfel/src/index.h @@ -66,6 +66,7 @@ typedef enum { INDEXING_CHECK_CELL_COMBINATIONS = 256, INDEXING_CHECK_CELL_AXES = 512, INDEXING_CHECK_PEAKS = 1024, + INDEXING_USE_LATTICE_TYPE = 2048, } IndexingMethod; diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c index 4f7b0c3c..43bfdea6 100644 --- a/libcrystfel/src/mosflm.c +++ b/libcrystfel/src/mosflm.c @@ -3,13 +3,13 @@ * * Invoke the DPS auto-indexing algorithm through MOSFLM * - * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY, - * a research centre of the Helmholtz Association. + * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY, + * a research centre of the Helmholtz Association. * Copyright © 2012 Richard Kirian * * Authors: * 2010 Richard Kirian - * 2010-2012 Thomas White + * 2010-2013 Thomas White * * This file is part of CrystFEL. * @@ -149,6 +149,12 @@ static int check_cell(struct mosflm_private *mp, struct image *image, return 0; } + if ( mp->indm & INDEXING_USE_LATTICE_TYPE ) { + LatticeType latt; + latt = cell_get_lattice_type(mp->template); + cell_set_lattice_type(out, latt); + } + crystal_set_cell(cr, out); if ( mp->indm & INDEXING_CHECK_PEAKS ) { @@ -409,7 +415,9 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm) break; case 2 : - if ( mosflm->mp->template != NULL ) { + if ( (mosflm->mp->indm & INDEXING_USE_LATTICE_TYPE) + && (mosflm->mp->template != NULL) ) + { const char *symm; symm = spacegroup_for_lattice(mosflm->mp->template); snprintf(tmp, 255, "SYMM %s\n", symm); @@ -517,8 +525,7 @@ static int mosflm_readable(struct image *image, struct mosflm_data *mosflm) switch ( type ) { - case MOSFLM_INPUT_LINE : - + case MOSFLM_INPUT_LINE : block_buffer = malloc(i+1); memcpy(block_buffer, mosflm->rbuffer, i); block_buffer[i] = '\0'; @@ -532,12 +539,12 @@ static int mosflm_readable(struct image *image, struct mosflm_data *mosflm) endbit_length = i+2; break; - case MOSFLM_INPUT_PROMPT : + case MOSFLM_INPUT_PROMPT : mosflm_send_next(image, mosflm); endbit_length = i+7; break; - default : + default : /* Obviously, this never happens :) */ ERROR("Unrecognised MOSFLM input mode! " -- cgit v1.2.3