diff options
author | Thomas White <taw@physics.org> | 2018-07-27 15:29:37 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-07-27 15:29:37 +0200 |
commit | b1a6c7a794e922c8c0e7532fa23f85f6068e5e11 (patch) | |
tree | 7e89c57fdfb2684c0ef2bd68d37446cddfa0d5e4 | |
parent | dac777332aa8bbdd7ea0f08e241aa31262d9092c (diff) |
indexamajig: Complain if profile radius determination fails
-rw-r--r-- | libcrystfel/src/predict-refine.c | 8 | ||||
-rw-r--r-- | libcrystfel/src/predict-refine.h | 2 | ||||
-rw-r--r-- | src/process_image.c | 4 |
3 files changed, 9 insertions, 5 deletions
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 */ diff --git a/src/process_image.c b/src/process_image.c index b0a03e46..94c0dc26 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -317,7 +317,9 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, if ( iargs->fix_profile_r < 0.0 ) { for ( i=0; i<image.n_crystals; i++ ) { - refine_radius(image.crystals[i], &image); + if ( refine_radius(image.crystals[i], &image) ) { + ERROR("WARNING: Radius determination failed\n"); + } } } |