diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/process_image.c | 11 |
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])); |