aboutsummaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorRichard A. Kirian <rkirian@asu.edu>2011-11-01 14:35:43 -0700
committerThomas White <taw@physics.org>2012-02-22 15:27:39 +0100
commitfaa1558ccc34e9920954bf20af9d2e29a6f59df3 (patch)
tree2ed74bc02c8b23fb21536b8664fe368c486721f1 /src/index.c
parentb7da56e7061e3c5f742c00ac11411ddee7b1185b (diff)
Better sanity check (Miller indices should be ~integers)
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/index.c b/src/index.c
index ced8bbb8..d5e76c50 100644
--- a/src/index.c
+++ b/src/index.c
@@ -205,17 +205,15 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
if ( new_cell == NULL ) continue;
/* Sanity check */
- image->reflections = find_intersections(image,
- new_cell);
- if ( !config_insane &&
- !peak_sanity_check(image->reflections,
- image->features) )
- {
+ image->reflections = find_intersections(image, new_cell);
+ image->indexed_cell = new_cell;
+
+ if ( !config_insane && !peak_sanity_check(image) ) {
cell_free(new_cell);
+ image->indexed_cell = NULL;
continue;
}
- image->indexed_cell = new_cell;
goto done; /* Success */
}