aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-06-06 10:57:11 +0200
committerThomas White <taw@physics.org>2012-10-02 15:02:11 +0200
commit32fdb97adf4f03e0c3ddceb96e4fe6111c4125c0 (patch)
tree73ad39f4d89c608099329eb79de64df9d5227ecd /libcrystfel
parent766d90e7d92ee0e10877e90466829ff3f4925269 (diff)
WIP
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/cell.c3
-rw-r--r--libcrystfel/src/mosflm.c57
2 files changed, 48 insertions, 12 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c
index 1cd6fb88..8f380128 100644
--- a/libcrystfel/src/cell.c
+++ b/libcrystfel/src/cell.c
@@ -1231,6 +1231,9 @@ UnitCell *load_cell_from_pdb(const char *filename)
memcpy(bes, line+40, 7); bes[7] = '\0';
memcpy(gas, line+47, 7); gas[7] = '\0';
+ STATUS("'%s' '%s' '%s'\n", as, bs, cs);
+ STATUS("'%s' '%s' '%s'\n", als, bes, gas);
+
r = sscanf(as, "%f", &a);
r += sscanf(bs, "%f", &b);
r += sscanf(cs, "%f", &c);
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index ed118aa4..a2d8520e 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -272,14 +272,54 @@ static void mosflm_sendline(const char *line, struct mosflm_data *mosflm)
}
+static const char *spacegroup_for_lattice(UnitCell *cell)
+{
+ LatticeType latt;
+ char centering;
+
+ latt = cell_get_lattice_type(cell);
+ centering = cell_get_centering(cell);
+
+ switch ( latt )
+ {
+ case L_TRICLINIC :
+ g = "1";
+ break;
+
+ case L_MONOCLINIC :
+ g = "2";
+ break;
+
+ case L_ORTHORHOMBIC :
+ g = "222";
+ break;
+
+ case L_TETRAGONAL :
+ g = "4";
+ break;
+
+ case L_RHOMBOHEDRAL :
+ g = "3";
+ break;
+
+ case L_HEXAGONAL :
+ g = "6";
+ break;
+
+ case L_CUBIC :
+ g = "23";
+ break;
+
+
+ return "P1";
+}
+
+
static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm)
{
char tmp[256];
- char symm[32];
- const char *sg;
double wavelength;
double a, b, c, alpha, beta, gamma;
- int i, j;
switch ( mosflm->step ) {
@@ -305,15 +345,8 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm)
case 3 :
if ( mosflm->target_cell != NULL ) {
- sg = cell_get_spacegroup(mosflm->target_cell);
- /* Remove white space from space group */
- j = 0;
- for ( i=0; i<strlen(sg); i++ ) {
- if (sg[i] != ' ') {
- symm[j++] = sg[i];
- }
- }
- symm[j] = '\0';
+ const char *symm;
+ symm = spacegroup_for_lattice(mosflm->target_cell);
snprintf(tmp, 255, "SYMM %s\n", symm);
mosflm_sendline(tmp, mosflm);
} else {