aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compare_hkl.c3
-rw-r--r--src/statistics.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c
index 1eae1849..4ab2dc70 100644
--- a/src/compare_hkl.c
+++ b/src/compare_hkl.c
@@ -21,6 +21,7 @@
#include <unistd.h>
#include <getopt.h>
#include <assert.h>
+#include <gsl/gsl_errno.h>
#include "utils.h"
#include "statistics.h"
@@ -440,6 +441,8 @@ int main(int argc, char *argv[])
}
reflist_free(ratio);
+ gsl_set_error_handler_off();
+
STATUS("%i reflections in '%s' had I < 3.0*sigma(I)\n", rej1, afile);
STATUS("%i reflections in '%s' had I < 3.0*sigma(I)\n", rej2, bfile);
diff --git a/src/statistics.c b/src/statistics.c
index da9a06c6..2312c4a7 100644
--- a/src/statistics.c
+++ b/src/statistics.c
@@ -418,7 +418,10 @@ static double r_minimised(RefList *list1, double *arr2, double *scalep, int fom)
double lo, up;
/* Iterate */
- gsl_min_fminimizer_iterate(s);
+ if ( gsl_min_fminimizer_iterate(s) ) {
+ ERROR("Failed to find scale factor.\n");
+ return NAN;
+ }
/* Get the current estimate */
scale = gsl_min_fminimizer_x_minimum(s);