From b1a6c7a794e922c8c0e7532fa23f85f6068e5e11 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 27 Jul 2018 15:29:37 +0200 Subject: indexamajig: Complain if profile radius determination fails --- libcrystfel/src/predict-refine.c | 8 +++++--- libcrystfel/src/predict-refine.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c index 61a94e05..cccd5d0b 100644 --- a/libcrystfel/src/predict-refine.c +++ b/libcrystfel/src/predict-refine.c @@ -319,7 +319,7 @@ static int pair_peaks(struct image *image, Crystal *cr, } -void refine_radius(Crystal *cr, struct image *image) +int refine_radius(Crystal *cr, struct image *image) { int n, n_acc; struct reflpeak *rps; @@ -328,13 +328,13 @@ void refine_radius(Crystal *cr, struct image *image) /* Maximum possible size */ rps = malloc(image_feature_count(image->features) * sizeof(struct reflpeak)); - if ( rps == NULL ) return; + if ( rps == NULL ) return 1; reflist = reflist_new(); n_acc = pair_peaks(image, cr, reflist, rps); if ( n_acc < 3 ) { free(rps); - return; + return 1; } crystal_set_reflections(cr, reflist); update_predictions(cr); @@ -347,6 +347,8 @@ void refine_radius(Crystal *cr, struct image *image) reflist_free(reflist); free(rps); + + return 0; } diff --git a/libcrystfel/src/predict-refine.h b/libcrystfel/src/predict-refine.h index c763d2ca..fe700f47 100644 --- a/libcrystfel/src/predict-refine.h +++ b/libcrystfel/src/predict-refine.h @@ -39,7 +39,7 @@ struct image; extern int refine_prediction(struct image *image, Crystal *cr); -extern void refine_radius(Crystal *cr, struct image *image); +extern int refine_radius(Crystal *cr, struct image *image); #endif /* PREDICT_REFINE_H */ -- cgit v1.2.3