From 32fdb97adf4f03e0c3ddceb96e4fe6111c4125c0 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 6 Jun 2012 10:57:11 +0200 Subject: WIP --- libcrystfel/src/cell.c | 3 +++ libcrystfel/src/mosflm.c | 57 ++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 12 deletions(-) (limited to 'libcrystfel') 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; itarget_cell); snprintf(tmp, 255, "SYMM %s\n", symm); mosflm_sendline(tmp, mosflm); } else { -- cgit v1.2.3