diff options
author | Thomas White <taw@physics.org> | 2015-04-02 12:22:17 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-04-20 15:50:40 +0200 |
commit | 0ac1beb40fabc28aa4d400776196962dfd9f9506 (patch) | |
tree | 22b514df6e601d336e253c41e849b6bc49f12012 /src | |
parent | 45d57be2c483b7c976fbcab94d9dc2b81b29dd23 (diff) |
indexamajig: Add --no-refine
Diffstat (limited to 'src')
-rw-r--r-- | src/indexamajig.c | 3 | ||||
-rw-r--r-- | src/process_image.c | 61 | ||||
-rw-r--r-- | src/process_image.h | 1 |
3 files changed, 35 insertions, 30 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index e9f3d3d3..eb619a87 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -147,6 +147,7 @@ static void show_help(const char *s) " --no-peaks-in-stream Do not record peak search results in the stream.\n" " --no-refls-in-stream Do not record integrated reflections in the stream.\n" " --int-diag=<cond> Show debugging information about reflections.\n" +" --no-refine Skip the prediction refinement step.\n" ); } @@ -242,6 +243,7 @@ int main(int argc, char *argv[]) iargs.fix_profile_r = -1.0; iargs.fix_bandwidth = -1.0; iargs.fix_divergence = -1.0; + iargs.predict_refine = 1; /* Long options */ const struct option longopts[] = { @@ -268,6 +270,7 @@ int main(int argc, char *argv[]) {"no-use-saturated", 0, &iargs.use_saturated, 0}, {"no-revalidate", 0, &iargs.no_revalidate, 1}, {"check-hdf5-snr", 0, &iargs.check_hdf5_snr, 1}, + {"no-refine", 0, &iargs.predict_refine, 0}, /* Long-only options which don't actually do anything */ {"no-sat-corr", 0, &iargs.satcorr, 0}, 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; i<image.n_crystals; i++ ) { - refine_radius(image.crystals[i], &image); - } - - /* Integrate all the crystals at once - need all the crystals so that - * overlaps can be detected. */ if ( iargs->fix_profile_r < 0.0 ) { for ( i=0; i<image.n_crystals; i++ ) { - - double old_R, new_R; - char notes[1024]; - - if ( refine_prediction(&image, image.crystals[i]) ) { - crystal_set_user_flag(image.crystals[i], 1); - continue; + if ( iargs->predict_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; i<image.n_crystals; i++ ) { - refine_prediction(&image, image.crystals[i]); + if ( iargs->predict_refine ) { + refine_prediction(&image, image.crystals[i]); + } } } diff --git a/src/process_image.h b/src/process_image.h index 68254485..de364772 100644 --- a/src/process_image.h +++ b/src/process_image.h @@ -86,6 +86,7 @@ struct index_args float fix_profile_r; float fix_bandwidth; float fix_divergence; + int predict_refine; }; |