aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-04-02 12:22:17 -0700
committerThomas White <taw@physics.org>2015-04-20 15:50:40 +0200
commit0ac1beb40fabc28aa4d400776196962dfd9f9506 (patch)
tree22b514df6e601d336e253c41e849b6bc49f12012
parent45d57be2c483b7c976fbcab94d9dc2b81b29dd23 (diff)
indexamajig: Add --no-refine
-rw-r--r--doc/man/indexamajig.15
-rw-r--r--src/indexamajig.c3
-rw-r--r--src/process_image.c61
-rw-r--r--src/process_image.h1
4 files changed, 40 insertions, 30 deletions
diff --git a/doc/man/indexamajig.1 b/doc/man/indexamajig.1
index 9b587a88..75fa3e6c 100644
--- a/doc/man/indexamajig.1
+++ b/doc/man/indexamajig.1
@@ -337,6 +337,11 @@ Fix the beam and crystal paramters to the given values. The profile radius is g
.IP
You do not have to use all three of these options together. For example, if the automatic profile radius determination is not working well for your data set, you could fix that alone and continue using the default values for the other parameters (which might be automatically determined in future versions of CrystFEL, but are not currently).
+.PD 0
+.IP \fB--no-refine
+.PD
+Skip the prediction refinement step.
+
.SH IDENTIFYING SINGLE PATTERNS IN THE INPUT FILE
By default indexamajig processes all diffraction patterns ("events") in each of the data files listed in the input list. It is however, possible, to only process single events in a multi-event file, by adding in the list an event description string after the data filename. The event description always includes a first section with alphanumeric strings separated by forward slashes ("/") and a second section with integer numbers also separated by forward slashes. The two sections are in turn separated by a double forward slash ('//'). Any of the two sections can be empty, but the double forward slash separator must always be present. Indexamajig matches the strings and the numbers in the event description with the event placeholders ('%') present respectively in the 'data' and 'dim' properties defined in the geometry file, and tries to retrieve the full HDF path to the event data and the the its location in a multi-dimensional data space. Consider the following examples:
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;
};