Commit 42438f09 authored by Thomas White's avatar Thomas White
Browse files

compare_hkl: Don't crash if scale factor can't be found

parent 192b3acc
......@@ -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);
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment