aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/post-refinement.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 7e5420d3..bc276fa7 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -324,6 +324,12 @@ static double residual_f(const gsl_vector *v, void *pp)
crystal_set_image(cr, &im);
apply_parameters(v, pv->initial, pv->rv, cr);
+ if ( fabs(crystal_get_profile_radius(cr)) > 5e9 ) {
+ crystal_free(cr);
+ if ( pv->verbose ) STATUS("radius > 5e9\n");
+ return GSL_NAN;
+ }
+
if ( im.lambda <= 0.0 ) {
crystal_free(cr);
if ( pv->verbose ) STATUS("lambda < 0\n");
@@ -857,6 +863,10 @@ static void do_pr_refine(Crystal *cr, const RefList *full,
write_specgraph(cr, full, cycle, serial);
}
+ if ( crystal_get_profile_radius(cr) > 5e9 ) {
+ ERROR("Very large radius: crystal %i\n", serial);
+ }
+
gsl_multimin_fminimizer_free(min);
gsl_vector_free(priv.initial);
gsl_vector_free(priv.vals);