aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-02-17 15:52:50 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:41 +0100
commit10760e1c4ea851b00173d0105a8aa8b22461a52f (patch)
tree3f25decee582600811254f8e719a1ad42ca1abe7
parentd7974392f765b29e0d0f73cf884bb8cdc3087314 (diff)
Minimisation fixes
-rw-r--r--libcrystfel/src/geometry.c2
-rw-r--r--src/post-refinement.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index 0694169c..43cf25f2 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -265,7 +265,7 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst,
kmin = 1.0/(image->lambda + image->lambda*image->bw);
knom = 1.0/image->lambda;
kmax = 1.0/(image->lambda - image->lambda*image->bw);
- if ( (k1>kmax) || (k0<kmin) ) return NULL;
+ if ( (updateme == NULL) && ((k1>kmax) || (k0<kmin)) ) return NULL;
/* Calculate excitation error */
dcs = distance3d(0.0, 0.0, -knom, xl, yl, zl);
diff --git a/src/post-refinement.c b/src/post-refinement.c
index d1f0be53..ac142ac3 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -177,24 +177,24 @@ static UnitCell *rotate_cell_xy(const UnitCell *cell, double ang1, double ang2)
csx = xnew; csy = ynew; csz = znew;
/* "a" around y */
- xnew = asx*cos(ang1) + asz*sin(ang2);
+ xnew = asx*cos(ang2) + asz*sin(ang2);
ynew = asy;
znew = -asx*sin(ang2) + asz*cos(ang2);
asx = xnew; asy = ynew; asz = znew;
/* "b" around y */
- xnew = bsx*cos(ang1) + bsz*sin(ang2);
+ xnew = bsx*cos(ang2) + bsz*sin(ang2);
ynew = bsy;
znew = -bsx*sin(ang2) + bsz*cos(ang2);
bsx = xnew; bsy = ynew; bsz = znew;
/* "c" around y */
- xnew = csx*cos(ang1) + csz*sin(ang2);
+ xnew = csx*cos(ang2) + csz*sin(ang2);
ynew = csy;
znew = -csx*sin(ang2) + csz*cos(ang2);
csx = xnew; csy = ynew; csz = znew;
- cell_set_reciprocal(o, asx, asy, asy, bsx, bsy, bsz, csx, csy, csz);
+ cell_set_reciprocal(o, asx, asy, asz, bsx, bsy, bsz, csx, csy, csz);
return o;
}
@@ -346,7 +346,7 @@ static void do_pr_refine(Crystal *cr, const RefList *full,
rad2deg(gsl_vector_get(min->x, 1)), res);
}
- status = gsl_multimin_test_size(min->size, 1.0e-8);
+ status = gsl_multimin_test_size(min->size, 1.0e-5);
} while ( status == GSL_CONTINUE && n_iter < 100 );