From 1503edf2fac6e42287483a0aa34ff629d6f0994d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 17 Feb 2017 16:20:47 +0100 Subject: Clean up angles --- src/post-refinement.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/post-refinement.c b/src/post-refinement.c index 33611d84..9b6eb82c 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -302,6 +302,7 @@ static void do_pr_refine(Crystal *cr, const RefList *full, int n_params = 0; int n_iter = 0; int status; + double ang1, ang2; if ( verbose ) { STATUS("\nPR initial: dev = %10.5e, free dev = %10.5e\n", @@ -355,9 +356,9 @@ static void do_pr_refine(Crystal *cr, const RefList *full, STATUS("status = %i (%s)\n", status, gsl_strerror(status)); } - double tang; - tang = fabs(gsl_vector_get(min->x, 0)) + fabs(gsl_vector_get(min->x, 1)); - if ( rad2deg(tang) > 5.0 ) { + ang1 = gsl_vector_get(min->x, 0); + ang2 = gsl_vector_get(min->x, 1); + if ( rad2deg(fabs(ang1)+fabs(ang2)) > 5.0 ) { ERROR("More than 5 degrees total rotation!\n"); residual_f_priv.verbose = 1; double res = residual_f(min->x, &residual_f_priv); @@ -370,8 +371,7 @@ static void do_pr_refine(Crystal *cr, const RefList *full, /* Apply the final shifts */ UnitCell *cnew; - cnew = rotate_cell_xy(crystal_get_cell(cr), gsl_vector_get(min->x, 0), - gsl_vector_get(min->x, 1)); + cnew = rotate_cell_xy(crystal_get_cell(cr), ang1, ang2); cell_free(crystal_get_cell(cr)); crystal_set_cell(cr, cnew); -- cgit v1.2.3