From 2fcc4e3721b3ff5006f2d40176577ee2ce57de17 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 3 May 2018 17:08:17 +0200 Subject: Add SCALE_VERBOSE_ERRORS --- src/post-refinement.c | 2 +- src/scaling.c | 5 ++--- src/scaling.h | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/post-refinement.c b/src/post-refinement.c index 4e83eacc..bde9c02c 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -727,7 +727,7 @@ static void do_pr_refine(Crystal *cr, const RefList *full, try_reindex(cr, full, sym, amb, scaleflags); - if ( scale_one_crystal(cr, full, scaleflags) ) { + if ( scale_one_crystal(cr, full, scaleflags | SCALE_VERBOSE_ERRORS) ) { ERROR("Bad scaling at start of refinement.\n"); return; } diff --git a/src/scaling.c b/src/scaling.c index 94d885ea..5fbf541a 100644 --- a/src/scaling.c +++ b/src/scaling.c @@ -198,7 +198,6 @@ void scale_all(Crystal **crystals, int n_crystals, int nthreads, int scaleflags) /* Calculates G and B, by which cr's reflections should be multiplied to fit reference */ int scale_one_crystal(Crystal *cr, const RefList *listR, int flags) { - int complain_loudly = 0; const Reflection *reflS; RefListIterator *iter; int max_n = 256; @@ -289,7 +288,7 @@ int scale_one_crystal(Crystal *cr, const RefList *listR, int flags) } if ( n < 2 ) { - if ( complain_loudly ) { + if ( flags & SCALE_VERBOSE_ERRORS ) { ERROR("Not enough reflections for scaling (had %i, but %i remain)\n", nb, n); if ( n_esdR ) ERROR("%i reference reflection esd\n", n_esdR); if ( n_esdS ) ERROR("%i subject reflection esd\n", n_esdS); @@ -320,7 +319,7 @@ int scale_one_crystal(Crystal *cr, const RefList *listR, int flags) if ( isnan(G) ) { - if ( complain_loudly ) { + if ( flags & SCALE_VERBOSE_ERRORS ) { ERROR("Scaling gave NaN (%i pairs)\n", n); if ( n < 10 ) { int i; diff --git a/src/scaling.h b/src/scaling.h index a4ec6931..8c2e7ef2 100644 --- a/src/scaling.h +++ b/src/scaling.h @@ -42,6 +42,7 @@ enum ScaleFlags { SCALE_NONE = 0, SCALE_NO_B = 1<<0, /* Don't use Debye-Waller part */ + SCALE_VERBOSE_ERRORS = 1<<1, }; extern int scale_one_crystal(Crystal *cr, const RefList *reference, int flags); -- cgit v1.2.3