From 62bdc9676bfe6a5df976b90cc8e8fdce569ac0ea Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 3 Feb 2016 01:54:49 +0100 Subject: Set initial prediction parameters even when not doing prediction refinement Silly bug fix. Beamtime programming FTL. --- libcrystfel/src/index.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 11931b01..6b530b61 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -236,6 +236,7 @@ static int try_indexer(struct image *image, IndexingMethod indm, IndexingPrivate *ipriv) { int i, r; + int n_bad = 0; switch ( indm & INDEXING_METHOD_MASK ) { @@ -272,27 +273,27 @@ static int try_indexer(struct image *image, IndexingMethod indm, } - if ( indm & INDEXING_REFINE ) { + for ( i=0; icrystals[image->n_crystals-i-1]; - crystal_set_image(cr, image); - crystal_set_user_flag(cr, 0); - crystal_set_profile_radius(cr, 0.02e9); - crystal_set_mosaicity(cr, 0.0); - if ( refine_prediction(image, cr) != 0 ) { - crystal_set_user_flag(cr, 1); - n_bad++; - } + Crystal *cr = image->crystals[image->n_crystals-i-1]; + crystal_set_image(cr, image); + crystal_set_user_flag(cr, 0); + crystal_set_profile_radius(cr, 0.02e9); + 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++; } - remove_flagged_crystals(image); + } - if ( n_bad == r ) return 0; + remove_flagged_crystals(image); - } + if ( n_bad == r ) return 0; return r; } -- cgit v1.2.3