diff options
author | Thomas White <taw@physics.org> | 2018-09-27 14:39:50 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-09-27 14:40:34 +0200 |
commit | 5aa5754866bacfc28e2a6308534413ce11b46a07 (patch) | |
tree | 1df3aa6a18a790bd42e2c214a1e10876fd7e93fa /libcrystfel | |
parent | abc9ed8e31fde81f893043ba67c41d18629747ed (diff) |
xds: Fix space groups for lattices
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/xds.c | 26 |
1 files changed, 16 insertions, 10 deletions
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; |