aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-06-25 16:33:44 +0200
committerThomas White <taw@physics.org>2015-06-25 16:36:33 +0200
commit33a0ef4d46dff8281743359697178085fa551049 (patch)
tree830ef8024d1fc49d9e5c61a3ed16ef5181304be3
parent3bd690ded0b78ae41f6e3cd34196b0e3287e10f3 (diff)
Set MOSFLM default flags to include cell parameters, and add some checks
-rw-r--r--libcrystfel/src/index.c4
-rw-r--r--libcrystfel/src/index.h3
-rw-r--r--libcrystfel/src/mosflm.c14
3 files changed, 18 insertions, 3 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index 2512414d..944c3f10 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -121,7 +121,9 @@ IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
if ( in != indm[n] ) {
ERROR("Note: flags were altered to take into account "
- "the limitations of the indexing method.\n");
+ "the information provided and/or the limitations "
+ "of the indexing method.\nPlease check the "
+ "methods listed above carefully.\n");
}
for ( i=0; i<n; i++ ) {
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index 12c13df8..8d5964e4 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -46,7 +46,8 @@
#define INDEXING_DEFAULTS_MOSFLM (INDEXING_MOSFLM | INDEXING_CHECK_PEAKS \
| INDEXING_CHECK_CELL_COMBINATIONS \
- | INDEXING_USE_LATTICE_TYPE)
+ | INDEXING_USE_LATTICE_TYPE \
+ | INDEXING_USE_CELL_PARAMETERS)
/* Axis check is needed for XDS, because it likes to permute the axes */
#define INDEXING_DEFAULTS_XDS (INDEXING_XDS | INDEXING_USE_LATTICE_TYPE \
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index c384fec2..4eac7874 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -852,11 +852,13 @@ IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell,
/* Check if cell parameters are needed/provided */
if ( *indm & INDEXING_CHECK_CELL_COMBINATIONS ) need_cell = 1;
if ( *indm & INDEXING_CHECK_CELL_AXES ) need_cell = 1;
+ if ( *indm & INDEXING_USE_CELL_PARAMETERS ) need_cell = 1;
if ( need_cell && !cell_has_parameters(cell) ) {
ERROR("Altering your MOSFLM flags because cell parameters were"
" not provided.\n");
*indm &= ~INDEXING_CHECK_CELL_COMBINATIONS;
*indm &= ~INDEXING_CHECK_CELL_AXES;
+ *indm &= ~INDEXING_USE_CELL_PARAMETERS;
}
/* Check if lattice type information is needed/provided */
@@ -869,7 +871,7 @@ IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell,
/* Flags that MOSFLM knows about */
*indm &= INDEXING_METHOD_MASK | INDEXING_CHECK_CELL_COMBINATIONS
| INDEXING_CHECK_CELL_AXES | INDEXING_CHECK_PEAKS
- | INDEXING_USE_LATTICE_TYPE| INDEXING_USE_CELL_PARAMETERS;;
+ | INDEXING_USE_LATTICE_TYPE| INDEXING_USE_CELL_PARAMETERS;
if ( (*indm & INDEXING_USE_LATTICE_TYPE)
&& !((*indm & INDEXING_CHECK_CELL_COMBINATIONS)
@@ -884,7 +886,17 @@ IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell,
"If this is a problem, consider using "
"mosflm-axes-latt or mosflm-comb-latt instead of "
"mosflm-raw-latt.\n", indexer_str(*indm));
+ /* It'll be OK if INDEXING_CHECK_CELL_PARAMETERS and
+ * MOSFLM 7.2.0 or later, but that's getting a bit too
+ * complicated to explain to the user. */
+ }
+ if ( (*indm & INDEXING_USE_CELL_PARAMETERS)
+ && !((*indm & INDEXING_CHECK_CELL_COMBINATIONS)
+ || (*indm & INDEXING_CHECK_CELL_AXES)) )
+ {
+ ERROR("WARNING: Using 'mosflm-raw' but providing cell "
+ "parameters as prior information to mosflm.\n");
}
mp = malloc(sizeof(struct mosflm_private));