aboutsummaryrefslogtreecommitdiff
path: root/src/process_image.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-03-17 17:26:07 +0100
committerThomas White <taw@physics.org>2015-04-20 15:50:39 +0200
commitc18a02f6e07ad21fee5c7e6a1fc0e6f64efba17c (patch)
treeed1c40981a93eaacbc8dd16a38d8eb7cb08d9e19 /src/process_image.c
parente9bdc3984e6693aff913e37c0d6afebec6511530 (diff)
Throw out crystals which could not be refined
Diffstat (limited to 'src/process_image.c')
-rw-r--r--src/process_image.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/process_image.c b/src/process_image.c
index 6ad5c00e..da9f3f4a 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -282,9 +282,9 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
}
free(rn);
- pargs->n_crystals = image.n_crystals;
for ( i=0; i<image.n_crystals; i++ ) {
crystal_set_image(image.crystals[i], &image);
+ crystal_set_user_flag(image.crystals[i], 0);
}
/* Set beam/crystal parameters */
@@ -330,6 +330,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
if ( refine_prediction(&image, image.crystals[i]) ) {
ERROR("Prediction refinement failed.\n");
+ crystal_set_user_flag(image.crystals[i], 1);
continue;
}
@@ -382,6 +383,14 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
get_event_string(image.event));
}
+ /* Count crystals which are still good */
+ pargs->n_crystals = 0;
+ for ( i=0; i<image.n_crystals; i++ ) {
+ if ( crystal_get_user_flag(image.crystals[i]) == 0 ) {
+ pargs->n_crystals++;
+ }
+ }
+
for ( i=0; i<image.n_crystals; i++ ) {
cell_free(crystal_get_cell(image.crystals[i]));
reflist_free(crystal_get_reflections(image.crystals[i]));