From 5aa5754866bacfc28e2a6308534413ce11b46a07 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 27 Sep 2018 14:39:50 +0200 Subject: xds: Fix space groups for lattices --- libcrystfel/src/xds.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 01c12dca..cc8d48d2 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -235,13 +235,15 @@ static const char *spacegroup_for_lattice(UnitCell *cell) switch ( latt ) { case L_TRICLINIC : - g = "1"; + if ( centering == 'P' ) { + g = "1"; + } break; case L_MONOCLINIC : if ( centering == 'P' ) { g = "3"; - } else { + } else if ( centering == 'C' ) { g = "5"; } break; @@ -253,7 +255,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) g = "20"; } else if ( centering == 'F' ) { g = "22"; - } else { + } else if ( centering == 'I' ) { g = "23"; } break; @@ -261,21 +263,21 @@ static const char *spacegroup_for_lattice(UnitCell *cell) case L_TETRAGONAL : if ( centering == 'P' ) { g = "75"; - } else { + } else if ( centering == 'I' ) { g = "79"; } break; case L_RHOMBOHEDRAL : - if ( centering == 'P' ) { - g = "143"; - } else { + if ( centering == 'R' ) { g = "146"; } break; case L_HEXAGONAL : - g = "168"; + if ( centering == 'P' ) { + g = "168"; + } break; case L_CUBIC : @@ -283,12 +285,11 @@ static const char *spacegroup_for_lattice(UnitCell *cell) g = "195"; } else if ( centering == 'F' ) { g = "196"; - } else { + } else if ( centering == 'I' ) { g = "197"; } break; } - assert(g != NULL); return g; } @@ -442,6 +443,11 @@ void *xds_prepare(IndexingMethod *indm, UnitCell *cell) return NULL; } + if ( (cell != NULL) && (spacegroup_for_lattice(cell) == NULL) ) { + ERROR("Don't know how to ask XDS for your cell.\n"); + return NULL; + } + xp = calloc(1, sizeof(*xp)); if ( xp == NULL ) return NULL; -- cgit v1.2.3