aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-02-17 16:20:47 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:41 +0100
commit1503edf2fac6e42287483a0aa34ff629d6f0994d (patch)
tree7c083f94f978e079d2ddd1dca8b078c208669dcd /src/post-refinement.c
parent0b06adaf57633239dc04a5ab5d31bcbe1036651c (diff)
Clean up angles
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c10
1 files changed, 5 insertions, 5 deletions
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);