From c9c756db807f3ea22dcf2d01401a4ce69f73f4df Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 29 Jan 2016 18:23:48 +0100 Subject: Perform prediction refinement straight after indexing This allows indexing to be attempted again (either a new method or with "retry") if the prediction refinement fails, increasing overall indexing rate. Side-effect: there are some hoops which would need to be jumped through to store the profile radius before refinement and hence enable scripts/plot-predict-refine to work. For now, we'll ignore this as it's clear that the prediction refinement is working. --- src/process_image.c | 78 +++++++++-------------------------------------------- 1 file changed, 13 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/process_image.c b/src/process_image.c index 5d4212e2..9b0d79d8 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -54,29 +54,6 @@ #include "im-sandbox.h" -static void try_refine_autoR(struct image *image, Crystal *cr) -{ - double old_R, new_R; - char notes[1024]; - - refine_radius(cr, image); - old_R = crystal_get_profile_radius(cr); - - if ( refine_prediction(image, cr) ) { - crystal_set_user_flag(cr, 1); - return; - } - - /* Estimate radius again with better geometry */ - refine_radius(cr, image); - new_R = crystal_get_profile_radius(cr); - - snprintf(notes, 1024, "predict_refine/R old = %.5f new = %.5f nm^-1", - old_R/1e9, new_R/1e9); - crystal_add_notes(cr, notes); -} - - static float **backup_image_data(float **dp, struct detector *det) { float **bu; @@ -130,7 +107,6 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, int r; int ret; char *rn; - int n_crystals_left; float **prefilter; int any_crystals; @@ -218,6 +194,18 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, return; } + /* Set beam parameters */ + if ( iargs->fix_divergence >= 0.0 ) { + image.div = iargs->fix_divergence; + } else { + image.div = 0.0; + } + if ( iargs->fix_bandwidth >= 0.0 ) { + image.bw = iargs->fix_bandwidth; + } else { + image.bw = 0.00000001; + } + /* Index the pattern */ index_pattern(&image, iargs->indm, iargs->ipriv); @@ -229,22 +217,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, } free(rn); - for ( i=0; ifix_divergence >= 0.0 ) { - image.div = iargs->fix_divergence; - } else { - image.div = 0.0; - } - if ( iargs->fix_bandwidth >= 0.0 ) { - image.bw = iargs->fix_bandwidth; - } else { - image.bw = 0.00000001; - } if ( iargs->fix_profile_r >= 0.0 ) { for ( i=0; ifix_profile_r < 0.0 ) { - for ( i=0; ipredict_refine ) { - try_refine_autoR(&image, image.crystals[i]); - } else { - refine_radius(image.crystals[i], &image); - } + refine_radius(image.crystals[i], &image); } - - } else { - - for ( i=0; ipredict_refine ) { - refine_prediction(&image, image.crystals[i]); - } - } - - } - - /* If there are no crystals left, set the indexing flag back to zero */ - n_crystals_left = 0; - for ( i=0; i