aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/geometry.c2
-rw-r--r--src/post-refinement.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index 43cf25f2..7f5e8635 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -523,6 +523,8 @@ static double do_integral(double q2, double zl, double R,
const double N = 1.5; /* Pointiness of spectrum */
FILE *fh = NULL;
+ assert(R*R < q2);
+
/* Range over which P is different from zero */
k0 = (R*R - q2)/(2.0*(zl+R));
k1 = (R*R - q2)/(2.0*(zl-R));
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 318d1733..da3f6683 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -294,6 +294,11 @@ static double residual_f(const gsl_vector *v, void *pp)
struct image im;
Crystal *cr;
double res;
+ int i;
+
+ for ( i=0; i<v->size; i++ ) {
+ if ( gsl_vector_get(v, i) > 100.0 ) return INFINITY;
+ }
cr = crystal_copy(pv->cr);
im = *crystal_get_image(cr);