From 3438527c657d898f76658b464f018a045861af85 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 22 Apr 2024 16:26:33 +0200 Subject: asdf: Force cell to be right-handed after refinement In some rare cases, the cell changes from right to left handed during the vector refinement stage of asdf, while ending up at an apparently correct indexing solution. This commit just flips the axis round when necessary, in the same way that asdf already does in an earlier stage. I haven't done a proper survey, but I can say that the image I used to isolate and test this issue had very low resolution while still being what we would call "indexable". The left-handed cells appeared for six out of the 12173 hits in that run, or slightly below 0.05%. So, it's rare but not totally impossible. --- libcrystfel/src/indexers/asdf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libcrystfel/src/indexers/asdf.c b/libcrystfel/src/indexers/asdf.c index 6cfd741a..c136efc1 100644 --- a/libcrystfel/src/indexers/asdf.c +++ b/libcrystfel/src/indexers/asdf.c @@ -577,6 +577,7 @@ static int refine_asdf_cell(struct asdf_cell *c, gsl_vector **reflections, calc_reciprocal(c->reciprocal, c->axes); + force_right_handed(c); double a[3]; for ( i = 0; i < 3; i++ ) { a[i] = gsl_blas_dnrm2(c->axes[i]); -- cgit v1.2.3