aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-06 11:18:05 +0100
committerThomas White <taw@physics.org>2017-03-08 16:53:19 +0100
commitad305e5a1a84a5e83edbdf30e3aba5265ca40665 (patch)
treebff78bf022c89b2165725a4e7f26c492e54e67b2 /libcrystfel
parent61565336125a999790fb4c36219e9c46c5eb30cc (diff)
Check unit cell parameters after prediction refinement
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/index.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index 89a98920..028ba5e9 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -334,11 +334,34 @@ static int try_indexer(struct image *image, IndexingMethod indm,
crystal_set_mosaicity(cr, 0.0);
/* Prediction refinement if requested */
- if ( (indm & INDEXING_REFINE)
- && (refine_prediction(image, cr) != 0) )
- {
- crystal_set_user_flag(cr, 1);
- n_bad++;
+ if ( indm & INDEXING_REFINE ) {
+
+ UnitCell *out;
+
+ if ( refine_prediction(image, cr) ) {
+ crystal_set_user_flag(cr, 1);
+ n_bad++;
+ }
+
+ if ( (indm & INDEXING_CHECK_CELL_COMBINATIONS)
+ || (indm & INDEXING_CHECK_CELL_AXES) )
+ {
+
+ /* Check that the cell parameters are still
+ * within the tolerance */
+ out = match_cell(crystal_get_cell(cr),
+ ipriv->target_cell, 0,
+ ipriv->tolerance, 0);
+
+ if ( out == NULL ) {
+ crystal_set_user_flag(cr, 1);
+ n_bad++;
+ }
+
+ cell_free(out);
+
+ }
+
}
}