aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-07-27 15:29:37 +0200
committerThomas White <taw@physics.org>2018-07-27 15:29:37 +0200
commitb1a6c7a794e922c8c0e7532fa23f85f6068e5e11 (patch)
tree7e89c57fdfb2684c0ef2bd68d37446cddfa0d5e4 /libcrystfel
parentdac777332aa8bbdd7ea0f08e241aa31262d9092c (diff)
indexamajig: Complain if profile radius determination fails
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/predict-refine.c8
-rw-r--r--libcrystfel/src/predict-refine.h2
2 files changed, 6 insertions, 4 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 */