aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-08-29 16:31:59 +0200
committerThomas White <taw@physics.org>2012-10-02 15:02:12 +0200
commitcf1ed4e4fb4004e89f2e307931a1de4c024e13de (patch)
treef9a250e3f2e49b53c538156009d80e31f37fab16
parent7a7202862defd2b3638fbe16b7ec315c6c871321 (diff)
Send setting information to MOSFLM
-rw-r--r--libcrystfel/src/mosflm.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index e81f20b6..d5356bab 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -272,15 +272,19 @@ static void mosflm_sendline(const char *line, struct mosflm_data *mosflm)
}
+/* Turn what we know about the unit cell into something which we can give to
+ * MOSFLM to make it give us only indexing results compatible with the cell. */
static const char *spacegroup_for_lattice(UnitCell *cell)
{
LatticeType latt;
char centering;
+ char ua;
char *g = NULL;
char *result;
latt = cell_get_lattice_type(cell);
centering = cell_get_centering(cell);
+ ua = cell_get_unique_axis(cell);
switch ( latt )
{
@@ -289,7 +293,10 @@ static const char *spacegroup_for_lattice(UnitCell *cell)
break;
case L_MONOCLINIC :
- g = "2";
+ /* "2 1 1", "1 2 1" or "1 1 2" depending on unique axis */
+ if ( ua == 'a' ) g = "2 1 1";
+ if ( ua == 'b' ) g = "1 2 1";
+ if ( ua == 'c' ) g = "1 1 2";
break;
case L_ORTHORHOMBIC :
@@ -297,7 +304,10 @@ static const char *spacegroup_for_lattice(UnitCell *cell)
break;
case L_TETRAGONAL :
- g = "4";
+ /* "4 1 1", "1 4 1" or "1 1 4" depending on unique axis */
+ if ( ua == 'a' ) g = "4 1 1";
+ if ( ua == 'b' ) g = "1 4 1";
+ if ( ua == 'c' ) g = "1 1 4";
break;
case L_RHOMBOHEDRAL :
@@ -305,7 +315,10 @@ static const char *spacegroup_for_lattice(UnitCell *cell)
break;
case L_HEXAGONAL :
- g = "6";
+ /* "6 1 1", "1 6 1" or "1 1 6" depending on unique axis */
+ if ( ua == 'a' ) g = "6 1 1";
+ if ( ua == 'b' ) g = "1 6 1";
+ if ( ua == 'c' ) g = "6";
break;
case L_CUBIC :
@@ -317,7 +330,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell)
result = malloc(32);
if ( result == NULL ) return NULL;
- snprintf(result, 31, "%c %s", centering, g);
+ snprintf(result, 31, "%c%s", centering, g);
return result;
}