aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-02-03 01:54:49 +0100
committerThomas White <taw@physics.org>2016-02-03 01:54:49 +0100
commit62bdc9676bfe6a5df976b90cc8e8fdce569ac0ea (patch)
treeef2973ebf226cb3ea9c3d0afa0ae21152e434f76 /libcrystfel
parent842eac4b578d8d64c594fd87becf5bb552b44884 (diff)
Set initial prediction parameters even when not doing prediction refinement
Silly bug fix. Beamtime programming FTL.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/index.c33
1 files 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; i<r; i++ ) {
- /* Attempt prediction refinement */
- int n_bad = 0;
- for ( i=0; i<r; i++ ) {
- 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);
- 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;
}