aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/predict-refine.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-06-21 11:00:34 +0200
committerThomas White <taw@physics.org>2024-06-21 11:00:34 +0200
commit17471dc1c38f77d9c5930d0cbe15e4bc8e12d16c (patch)
tree2d5d29847da813ef29a5d56ab96885618877cc41 /libcrystfel/src/predict-refine.c
parentecd51ad7d010177e6e5cab5f19ad357bc0327d7a (diff)
Defer writing Mille data until crystal is accepted
Previously, the Mille data was written before the final checks of the indexing solution (e.g. the peak alignment check). This added junk data to the Mille files. Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/99
Diffstat (limited to 'libcrystfel/src/predict-refine.c')
-rw-r--r--libcrystfel/src/predict-refine.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c
index adbb418f..cc740db3 100644
--- a/libcrystfel/src/predict-refine.c
+++ b/libcrystfel/src/predict-refine.c
@@ -872,6 +872,7 @@ int refine_prediction(struct image *image, Crystal *cr,
crystal_add_notes(cr, tmp);
if ( mille != NULL ) {
+ crystfel_mille_delete_last_record(mille);
profile_start("mille-calc");
write_mille(mille, n, crystal_get_cell(cr), rps, image,
max_mille_level, Minvs);
@@ -887,18 +888,10 @@ int refine_prediction(struct image *image, Crystal *cr,
n = pair_peaks(image, cr, NULL, rps);
free_rps_noreflist(rps, n);
+
if ( n < 3 ) {
- if ( mille != NULL ) {
- crystfel_mille_delete_last_record(mille);
- }
return 1;
+ } else {
+ return 0;
}
-
- if ( mille != NULL ) {
- profile_start("mille-write");
- crystfel_mille_write_record(mille);
- profile_end("mille-write");
- }
-
- return 0;
}