diff options
author | Thomas White <taw@physics.org> | 2017-12-12 16:15:38 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-27 17:12:42 +0100 |
commit | f77e60c21e9b5f02fa265b258d07010debbfcee3 (patch) | |
tree | 3eb9e292b899a1fc67896d67e79999f31f9cb6aa /src/post-refinement.c | |
parent | 55a8a64893ad2a6d303e4f33271e830a4f3da8f9 (diff) |
Don't complain loudly about scaling failures during refinement
As long as it doesn't end up somewhere bad, it can probe where it likes.
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r-- | src/post-refinement.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c index 7402b91c..ccaee00d 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -81,7 +81,7 @@ const char *str_prflag(enum prflag flag) double residual(Crystal *cr, const RefList *full, int free, - int *pn_used, const char *filename) + int *pn_used, const char *filename, int complain) { Reflection *refl; RefListIterator *iter; @@ -92,7 +92,7 @@ double residual(Crystal *cr, const RefList *full, int free, double B = crystal_get_Bfac(cr); UnitCell *cell = crystal_get_cell(cr); - if ( linear_scale(full, crystal_get_reflections(cr), &G) ) { + if ( linear_scale(full, crystal_get_reflections(cr), &G, complain) ) { return INFINITY; } @@ -308,12 +308,12 @@ static double residual_f(const gsl_vector *v, void *pp) update_predictions(cr); calculate_partialities(cr, PMODEL_XSPHERE); - res = residual(cr, pv->full, 0, NULL, NULL); + res = residual(cr, pv->full, 0, NULL, NULL, 0); if ( isnan(res) ) { ERROR("NaN residual\n"); ERROR("G=%e, B=%e\n", crystal_get_osf(cr), crystal_get_Bfac(cr)); - residual(cr, pv->full, 0, NULL, "nan-residual.dat"); + residual(cr, pv->full, 0, NULL, "nan-residual.dat", 1); abort(); } @@ -385,8 +385,8 @@ static void do_pr_refine(Crystal *cr, const RefList *full, double G; double residual_start, residual_free_start; - residual_start = residual(cr, full, 0, NULL, NULL); - residual_free_start = residual(cr, full, 1, NULL, NULL); + residual_start = residual(cr, full, 0, NULL, NULL, 1); + residual_free_start = residual(cr, full, 1, NULL, NULL, 1); if ( verbose ) { STATUS("\nPR initial: dev = %10.5e, free dev = %10.5e\n", @@ -458,7 +458,7 @@ static void do_pr_refine(Crystal *cr, const RefList *full, apply_parameters(min->x, initial, rv, cr); update_predictions(cr); calculate_partialities(cr, PMODEL_XSPHERE); - r = linear_scale(full, crystal_get_reflections(cr), &G); + r = linear_scale(full, crystal_get_reflections(cr), &G, 1); if ( r == 0 ) { crystal_set_osf(cr, G); } else { @@ -467,8 +467,8 @@ static void do_pr_refine(Crystal *cr, const RefList *full, if ( verbose ) { STATUS("PR final: dev = %10.5e, free dev = %10.5e\n", - residual(cr, full, 0, NULL, NULL), - residual(cr, full, 1, NULL, NULL)); + residual(cr, full, 0, NULL, NULL, 1), + residual(cr, full, 1, NULL, NULL, 1)); } gsl_multimin_fminimizer_free(min); |