From 0ac1beb40fabc28aa4d400776196962dfd9f9506 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 2 Apr 2015 12:22:17 -0700 Subject: indexamajig: Add --no-refine --- src/process_image.c | 61 +++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'src/process_image.c') diff --git a/src/process_image.c b/src/process_image.c index 12cc5bc3..0c897df4 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -53,6 +53,30 @@ #include "predict-refine.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; + } + + /* Reset the profile radius and estimate again with better geometry */ + crystal_set_profile_radius(cr, 0.02e9); + 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); +} + + void process_image(const struct index_args *iargs, struct pattern_args *pargs, Stream *st, int cookie, const char *tmpdir, int results_pipe, int serial) @@ -199,45 +223,22 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, } } - /* Measure R before refinement */ - 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); } - - old_R = crystal_get_profile_radius(image.crystals[i]); - - /* Reset the profile radius and estimate again with - * better geometry */ - crystal_set_profile_radius(image.crystals[i], 0.02e9); - refine_radius(image.crystals[i], &image); - - new_R = crystal_get_profile_radius(image.crystals[i]); - - snprintf(notes, 1024, "predict_refine/R old " - "= %.5f new = %.5f nm^-1", - old_R/1e9, new_R/1e9); - crystal_add_notes(image.crystals[i], notes); - } } else { for ( i=0; ipredict_refine ) { + refine_prediction(&image, image.crystals[i]); + } } } -- cgit v1.2.3