From 9feb67ff1535974f9c9970b9af1780990c9398b7 Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 10:51:07 +0100 Subject: added point group dictionary, lambda, unit cell parameters to xds.c --- libcrystfel/src/xds.c | 100 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 12 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 786e2ae0..58a42657 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -377,10 +377,12 @@ static void write_spot(struct image *image, const char *filename) } -static char *write_inp(struct image *image) +static char *write_inp(struct image *image, struct xds_private *xp) { FILE *fh; char *filename; + LatticeType latt; + double a, b, c, al, be, ga; filename = malloc(1024); if ( filename == NULL ) return NULL; @@ -399,16 +401,16 @@ static char *write_inp(struct image *image) fprintf(fh, "ORGY= 1500\n"); fprintf(fh, "DETECTOR_DISTANCE= 99.00\n"); //IMPORTANT fprintf(fh, "OSCILLATION_RANGE= 0.300\n"); - fprintf(fh, "X-RAY_WAVELENGTH= 1.32\n"); // IMPORTANT - fprintf(fh, "NAME_TEMPLATE_OF_DATA_FRAMES=/home/dikay/insu/data_exp1/ins_ssad_1_???.img \n"); + fprintf(fh, "X-RAY_WAVELENGTH= %.6f\n", image->lambda*1e10); + fprintf(fh, "NAME_TEMPLATE_OF_DATA_FRAMES=/home/ins_ssad_1_???.img \n"); fprintf(fh, "DATA_RANGE=1 1\n"); fprintf(fh, "SPOT_RANGE=1 1\n"); - fprintf(fh, "SPACE_GROUP_NUMBER= 94\n"); //CatB 94 - fprintf(fh, "UNIT_CELL_CONSTANTS= 126.2 126.2 54.2 90 90 90\n"); //CatB 125.4 125.4 54.56 90 90 90 - //fprintf(fh, "SPACE_GROUP_NUMBER=194\n"); //PS1 194 - //fprintf(fh, "UNIT_CELL_CONSTANTS=281 281 165.2 90 90 120\n"); //PS1 281 281 165.2 90 90 120 - //fprintf(fh, "SPACE_GROUP_NUMBER= 0\n"); //LYS 96 - //fprintf(fh, "UNIT_CELL_CONSTANTS= 0 0 0 0 0 0\n"); //LYS 77.32 77.32 38.16 90 90 90 + fprintf(fh, "SPACE_GROUP_NUMBER= %i\n", latt); + cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); + fprintf(fh, "UNIT_CELL_CONSTANTS= %.6f %.6f %.6f %.6f %.6f %.6f P\n", + a*1e10, b*1e10, c*1e10,rad2deg(al), rad2deg(be), rad2deg(ga)); + //fprintf(fh, "SPACE_GROUP_NUMBER= 0\n"); + //fprintf(fh, "UNIT_CELL_CONSTANTS= 0 0 0 0 0 0\n"); fprintf(fh, "NX= 3000\n"); fprintf(fh, "NY= 3000\n"); fprintf(fh, "QX= 0.07\n"); @@ -432,6 +434,81 @@ static char *write_inp(struct image *image) return filename; } +/* Turn what we know about the unit cell into something which we can give to + * XDS 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 *g = NULL; + char *result; + + latt = cell_get_lattice_type(cell); + centering = cell_get_centering(cell); + + switch ( latt ) + { + case L_TRICLINIC : + g = "1"; + break; + + case L_MONOCLINIC : + if ( centering != 'P' ) { + g = "3"; + } else { + g = "5"; + } + break; + + case L_ORTHORHOMBIC : + if ( centering != 'P' ) { + g = "16";} + else if ( centering != 'C' ) { + g = "20";} + else if ( centering != 'F' ) { + g = "22"; + } else { + g = "23"; + } + break; + + case L_TETRAGONAL : + if ( centering != 'P' ) { + g = "75"; + } else { + g = "79"; + break; + + case L_RHOMBOHEDRAL : + if ( centering != 'P' ) { + g = "143"; + } else { + g = "146"; + break; + + case L_HEXAGONAL : + g = "168"; + break; + + case L_CUBIC : + if ( centering != 'P' ) { + g = "195"; } + else if ( centering != 'F' ) { + g = "196"; + } else { + g = "197"; + } + break; + } + assert(g != NULL); + + result = malloc(32); + if ( result == NULL ) return NULL; + + //snprintf(result, 31, "%c%s", centering, g); + + return result; +} int run_xds(struct image *image, IndexingPrivate *priv) { @@ -451,9 +528,8 @@ int run_xds(struct image *image, IndexingPrivate *priv) xds->target_cell = xp->cell; - write_inp(image); - inp_filename = write_inp(image); - + write_inp(image, xp); + if ( inp_filename == NULL ) { ERROR("Failed to write XDS.INP file for XDS.\n"); return 0; -- cgit v1.2.3 From c52aaa6253a4987a0f4e392f9e16f0ad4f5e6cc4 Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 11:14:22 +0100 Subject: fixed } --- libcrystfel/src/xds.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 58a42657..2e8ac225 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -441,7 +441,6 @@ static const char *spacegroup_for_lattice(UnitCell *cell) LatticeType latt; char centering; char *g = NULL; - char *result; latt = cell_get_lattice_type(cell); centering = cell_get_centering(cell); @@ -453,9 +452,11 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_MONOCLINIC : - if ( centering != 'P' ) { + if ( centering != 'P' ) + { g = "3"; - } else { + } else + { g = "5"; } break; @@ -475,8 +476,11 @@ static const char *spacegroup_for_lattice(UnitCell *cell) case L_TETRAGONAL : if ( centering != 'P' ) { g = "75"; - } else { + } + else + { g = "79"; + } break; case L_RHOMBOHEDRAL : @@ -484,6 +488,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) g = "143"; } else { g = "146"; + } break; case L_HEXAGONAL : @@ -492,22 +497,18 @@ static const char *spacegroup_for_lattice(UnitCell *cell) case L_CUBIC : if ( centering != 'P' ) { - g = "195"; } + g = "195"; + } else if ( centering != 'F' ) { g = "196"; } else { g = "197"; } break; - } + } assert(g != NULL); - result = malloc(32); - if ( result == NULL ) return NULL; - - //snprintf(result, 31, "%c%s", centering, g); - - return result; + return g; } int run_xds(struct image *image, IndexingPrivate *priv) -- cgit v1.2.3 From 6501edc62d77bb2bf9095bfcc834bb5d68e7ba0f Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 12:28:47 +0100 Subject: ? --- libcrystfel/src/xds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 2e8ac225..e88b1995 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -381,7 +381,7 @@ static char *write_inp(struct image *image, struct xds_private *xp) { FILE *fh; char *filename; - LatticeType latt; + char *spacegroup_for_lattice; double a, b, c, al, be, ga; filename = malloc(1024); @@ -405,7 +405,7 @@ static char *write_inp(struct image *image, struct xds_private *xp) fprintf(fh, "NAME_TEMPLATE_OF_DATA_FRAMES=/home/ins_ssad_1_???.img \n"); fprintf(fh, "DATA_RANGE=1 1\n"); fprintf(fh, "SPOT_RANGE=1 1\n"); - fprintf(fh, "SPACE_GROUP_NUMBER= %i\n", latt); + fprintf(fh, "SPACE_GROUP_NUMBER= %s\n", spacegroup_for_lattice); cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); fprintf(fh, "UNIT_CELL_CONSTANTS= %.6f %.6f %.6f %.6f %.6f %.6f P\n", a*1e10, b*1e10, c*1e10,rad2deg(al), rad2deg(be), rad2deg(ga)); -- cgit v1.2.3 From 8eb104ce1ee5a7acb46dfb8ea18c6cc08ed7b11b Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 13:52:54 +0100 Subject: ? --- libcrystfel/src/xds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index e88b1995..4034a8e4 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -381,7 +381,7 @@ static char *write_inp(struct image *image, struct xds_private *xp) { FILE *fh; char *filename; - char *spacegroup_for_lattice; + const char *spacegroup_for_lattice; double a, b, c, al, be, ga; filename = malloc(1024); @@ -405,6 +405,7 @@ static char *write_inp(struct image *image, struct xds_private *xp) fprintf(fh, "NAME_TEMPLATE_OF_DATA_FRAMES=/home/ins_ssad_1_???.img \n"); fprintf(fh, "DATA_RANGE=1 1\n"); fprintf(fh, "SPOT_RANGE=1 1\n"); + //symm = spacegroup_for_lattice(xds->xp->template); fprintf(fh, "SPACE_GROUP_NUMBER= %s\n", spacegroup_for_lattice); cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); fprintf(fh, "UNIT_CELL_CONSTANTS= %.6f %.6f %.6f %.6f %.6f %.6f P\n", -- cgit v1.2.3 From b6f9a2f6b7efe10b7d2746e907210d9248ffe9fe Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 19 Feb 2013 14:35:00 +0100 Subject: Tidy up etc --- libcrystfel/src/xds.c | 144 ++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 76 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 4034a8e4..84cf828a 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -253,25 +253,30 @@ static int read_cell(const char *filename, struct image *image, do { rval = fgets(line, 1023, fh); + if ( rval == NULL ) return 0; } while ( strcmp(line, " # COORDINATES OF REC. BASIS VECTOR" " LENGTH 1/LENGTH\n") != 0 ); /* Free line after chunk */ rval = fgets(line, 1023, fh); + if ( rval == NULL ) return 0; rval = fgets(line, 1023, fh); + if ( rval == NULL ) return 0; memcpy(asx, line+7, 10); asx[10] = '\0'; memcpy(asy, line+17, 10); asy[10] = '\0'; memcpy(asz, line+27, 10); asz[10] = '\0'; rval = fgets(line, 1023, fh); + if ( rval == NULL ) return 0; memcpy(bsx, line+7, 10); bsx[10] = '\0'; memcpy(bsy, line+17, 10); bsy[10] = '\0'; memcpy(bsz, line+27, 10); bsz[10] = '\0'; rval = fgets(line, 1023, fh); + if ( rval == NULL ) return 0; memcpy(csx, line+7, 10); csx[10] = '\0'; memcpy(csy, line+17, 10); csy[10] = '\0'; @@ -377,64 +382,6 @@ static void write_spot(struct image *image, const char *filename) } -static char *write_inp(struct image *image, struct xds_private *xp) -{ - FILE *fh; - char *filename; - const char *spacegroup_for_lattice; - double a, b, c, al, be, ga; - - filename = malloc(1024); - if ( filename == NULL ) return NULL; - - snprintf(filename, 1023, "XDS.INP"); - - fh = fopen(filename, "w"); - if ( !fh ) { - ERROR("Couldn't open temporary file '%s'\n", filename); - free(filename); - return NULL; - } - - fprintf(fh, "JOB= IDXREF\n"); - fprintf(fh, "ORGX= 1500\n"); - fprintf(fh, "ORGY= 1500\n"); - fprintf(fh, "DETECTOR_DISTANCE= 99.00\n"); //IMPORTANT - fprintf(fh, "OSCILLATION_RANGE= 0.300\n"); - fprintf(fh, "X-RAY_WAVELENGTH= %.6f\n", image->lambda*1e10); - fprintf(fh, "NAME_TEMPLATE_OF_DATA_FRAMES=/home/ins_ssad_1_???.img \n"); - fprintf(fh, "DATA_RANGE=1 1\n"); - fprintf(fh, "SPOT_RANGE=1 1\n"); - //symm = spacegroup_for_lattice(xds->xp->template); - fprintf(fh, "SPACE_GROUP_NUMBER= %s\n", spacegroup_for_lattice); - cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); - fprintf(fh, "UNIT_CELL_CONSTANTS= %.6f %.6f %.6f %.6f %.6f %.6f P\n", - a*1e10, b*1e10, c*1e10,rad2deg(al), rad2deg(be), rad2deg(ga)); - //fprintf(fh, "SPACE_GROUP_NUMBER= 0\n"); - //fprintf(fh, "UNIT_CELL_CONSTANTS= 0 0 0 0 0 0\n"); - fprintf(fh, "NX= 3000\n"); - fprintf(fh, "NY= 3000\n"); - fprintf(fh, "QX= 0.07\n"); - fprintf(fh, "QY= 0.07\n"); - fprintf(fh, "INDEX_ORIGIN=0 0 0\n"); - fprintf(fh, "DIRECTION_OF_DETECTOR_X-AXIS=1 0 0\n"); - fprintf(fh, "DIRECTION_OF_DETECTOR_Y-AXIS=0 1 0\n"); - fprintf(fh, "INCIDENT_BEAM_DIRECTION=0 0 1\n"); - fprintf(fh, "ROTATION_AXIS=0 1 0\n"); - fprintf(fh, "DETECTOR= CSPAD\n"); - fprintf(fh, "MINIMUM_VALID_PIXEL_VALUE= 1\n"); - fprintf(fh, "OVERLOAD= 200000000\n"); - fprintf(fh, "INDEX_ERROR= 0.4\n"); - //fprintf(fh, "INDEX_QUALITY= 0.5\n"); - //fprintf(fh, "REFINE(IDXREF)= ALL\n"); - //fprintf(fh, "MINIMUM_NUMBER_OF_PIXELS_IN_A_SPOT= 1\n"); - //fprintf(fh, "MAXIMUM_ERROR_OF_SPOT_POSITION= 20.0\n"); - - fclose(fh); - - return filename; -} - /* Turn what we know about the unit cell into something which we can give to * XDS to make it give us only indexing results compatible with the cell. */ static const char *spacegroup_for_lattice(UnitCell *cell) @@ -453,21 +400,20 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_MONOCLINIC : - if ( centering != 'P' ) + if ( centering != 'P' ) { g = "3"; - } else - { + } else { g = "5"; } break; case L_ORTHORHOMBIC : if ( centering != 'P' ) { - g = "16";} - else if ( centering != 'C' ) { - g = "20";} - else if ( centering != 'F' ) { + g = "16"; + } else if ( centering != 'C' ) { + g = "20"; + } else if ( centering != 'F' ) { g = "22"; } else { g = "23"; @@ -477,9 +423,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) case L_TETRAGONAL : if ( centering != 'P' ) { g = "75"; - } - else - { + } else { g = "79"; } break; @@ -489,7 +433,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) g = "143"; } else { g = "146"; - } + } break; case L_HEXAGONAL : @@ -499,19 +443,70 @@ static const char *spacegroup_for_lattice(UnitCell *cell) case L_CUBIC : if ( centering != 'P' ) { g = "195"; - } - else if ( centering != 'F' ) { + } else if ( centering != 'F' ) { g = "196"; } else { g = "197"; } break; - } + } assert(g != NULL); return g; } + +static int write_inp(struct image *image, struct xds_private *xp) +{ + FILE *fh; + double a, b, c, al, be, ga; + + fh = fopen("XDS.INP", "w"); + if ( !fh ) { + ERROR("Couldn't open XDS.INP\n"); + return 1; + } + + fprintf(fh, "JOB= IDXREF\n"); + fprintf(fh, "ORGX= 1500\n"); + fprintf(fh, "ORGY= 1500\n"); + fprintf(fh, "DETECTOR_DISTANCE= 99.00\n"); //IMPORTANT + fprintf(fh, "OSCILLATION_RANGE= 0.300\n"); + fprintf(fh, "X-RAY_WAVELENGTH= %.6f\n", image->lambda*1e10); + fprintf(fh, "NAME_TEMPLATE_OF_DATA_FRAMES=/home/ins_ssad_1_???.img \n"); + fprintf(fh, "DATA_RANGE=1 1\n"); + fprintf(fh, "SPOT_RANGE=1 1\n"); + fprintf(fh, "SPACE_GROUP_NUMBER= %s\n", + spacegroup_for_lattice(xp->cell)); + cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); + fprintf(fh, "UNIT_CELL_CONSTANTS= %.6f %.6f %.6f %.6f %.6f %.6f P\n", + a*1e10, b*1e10, c*1e10,rad2deg(al), rad2deg(be), rad2deg(ga)); + //fprintf(fh, "SPACE_GROUP_NUMBER= 0\n"); + //fprintf(fh, "UNIT_CELL_CONSTANTS= 0 0 0 0 0 0\n"); + fprintf(fh, "NX= 3000\n"); + fprintf(fh, "NY= 3000\n"); + fprintf(fh, "QX= 0.07\n"); + fprintf(fh, "QY= 0.07\n"); + fprintf(fh, "INDEX_ORIGIN=0 0 0\n"); + fprintf(fh, "DIRECTION_OF_DETECTOR_X-AXIS=1 0 0\n"); + fprintf(fh, "DIRECTION_OF_DETECTOR_Y-AXIS=0 1 0\n"); + fprintf(fh, "INCIDENT_BEAM_DIRECTION=0 0 1\n"); + fprintf(fh, "ROTATION_AXIS=0 1 0\n"); + fprintf(fh, "DETECTOR= CSPAD\n"); + fprintf(fh, "MINIMUM_VALID_PIXEL_VALUE= 1\n"); + fprintf(fh, "OVERLOAD= 200000000\n"); + fprintf(fh, "INDEX_ERROR= 0.4\n"); + //fprintf(fh, "INDEX_QUALITY= 0.5\n"); + //fprintf(fh, "REFINE(IDXREF)= ALL\n"); + //fprintf(fh, "MINIMUM_NUMBER_OF_PIXELS_IN_A_SPOT= 1\n"); + //fprintf(fh, "MAXIMUM_ERROR_OF_SPOT_POSITION= 20.0\n"); + + fclose(fh); + + return 0; +} + + int run_xds(struct image *image, IndexingPrivate *priv) { unsigned int opts; @@ -519,7 +514,6 @@ int run_xds(struct image *image, IndexingPrivate *priv) int rval; int n; struct xds_data *xds; - char *inp_filename; struct xds_private *xp = (struct xds_private *)priv; xds = malloc(sizeof(struct xds_data)); @@ -530,9 +524,7 @@ int run_xds(struct image *image, IndexingPrivate *priv) xds->target_cell = xp->cell; - write_inp(image, xp); - - if ( inp_filename == NULL ) { + if ( write_inp(image, xp) ) { ERROR("Failed to write XDS.INP file for XDS.\n"); return 0; } -- cgit v1.2.3 From 37747e4e80d98a0c8d2e1baa32c9524608009536 Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 15:11:18 +0100 Subject: XDS.INP --- libcrystfel/src/xds.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 84cf828a..a70caaf5 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -452,7 +452,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) } assert(g != NULL); - return g; + return 0; } @@ -464,7 +464,7 @@ static int write_inp(struct image *image, struct xds_private *xp) fh = fopen("XDS.INP", "w"); if ( !fh ) { ERROR("Couldn't open XDS.INP\n"); - return 1; + return 0; } fprintf(fh, "JOB= IDXREF\n"); @@ -478,8 +478,9 @@ static int write_inp(struct image *image, struct xds_private *xp) fprintf(fh, "SPOT_RANGE=1 1\n"); fprintf(fh, "SPACE_GROUP_NUMBER= %s\n", spacegroup_for_lattice(xp->cell)); + printf("%s\n", spacegroup_for_lattice(xp->cell)); cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); - fprintf(fh, "UNIT_CELL_CONSTANTS= %.6f %.6f %.6f %.6f %.6f %.6f P\n", + fprintf(fh, "UNIT_CELL_CONSTANTS= %.2f %.2f %.2f %.2f %.2f %.2f\n", a*1e10, b*1e10, c*1e10,rad2deg(al), rad2deg(be), rad2deg(ga)); //fprintf(fh, "SPACE_GROUP_NUMBER= 0\n"); //fprintf(fh, "UNIT_CELL_CONSTANTS= 0 0 0 0 0 0\n"); @@ -524,7 +525,9 @@ int run_xds(struct image *image, IndexingPrivate *priv) xds->target_cell = xp->cell; - if ( write_inp(image, xp) ) { + write_inp(image, xp); + + if ( write_inp == NULL ) { ERROR("Failed to write XDS.INP file for XDS.\n"); return 0; } -- cgit v1.2.3 From 6da7b7f8aff35afddaaf075a7009345cc0544673 Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 16:14:25 +0100 Subject: XDS.INP trials --- libcrystfel/src/xds.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index a70caaf5..e749eef6 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -400,8 +400,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_MONOCLINIC : - if ( centering != 'P' ) - { + if ( centering != 'P' ) { g = "3"; } else { g = "5"; @@ -452,7 +451,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) } assert(g != NULL); - return 0; + return g; } -- cgit v1.2.3 From 1d429a4fa72e1426d661d6281e5f869cc0bd1f08 Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 16:21:26 +0100 Subject: XDS.INP fixed space group number --- libcrystfel/src/xds.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index e749eef6..48ea9351 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -400,7 +400,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_MONOCLINIC : - if ( centering != 'P' ) { + if ( centering == 'P' ) { g = "3"; } else { g = "5"; @@ -408,11 +408,11 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_ORTHORHOMBIC : - if ( centering != 'P' ) { + if ( centering == 'P' ) { g = "16"; - } else if ( centering != 'C' ) { + } else if ( centering == 'C' ) { g = "20"; - } else if ( centering != 'F' ) { + } else if ( centering == 'F' ) { g = "22"; } else { g = "23"; @@ -420,7 +420,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_TETRAGONAL : - if ( centering != 'P' ) { + if ( centering == 'P' ) { g = "75"; } else { g = "79"; @@ -428,7 +428,7 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_RHOMBOHEDRAL : - if ( centering != 'P' ) { + if ( centering == 'P' ) { g = "143"; } else { g = "146"; @@ -440,9 +440,9 @@ static const char *spacegroup_for_lattice(UnitCell *cell) break; case L_CUBIC : - if ( centering != 'P' ) { + if ( centering == 'P' ) { g = "195"; - } else if ( centering != 'F' ) { + } else if ( centering == 'F' ) { g = "196"; } else { g = "197"; -- cgit v1.2.3 From e4616b7007239e4b56dc293a832144d6f3cb5350 Mon Sep 17 00:00:00 2001 From: Cornelius Gati Date: Tue, 19 Feb 2013 16:23:26 +0100 Subject: deleted printf space group number --- libcrystfel/src/xds.c | 1 - 1 file changed, 1 deletion(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c index 48ea9351..098de504 100644 --- a/libcrystfel/src/xds.c +++ b/libcrystfel/src/xds.c @@ -477,7 +477,6 @@ static int write_inp(struct image *image, struct xds_private *xp) fprintf(fh, "SPOT_RANGE=1 1\n"); fprintf(fh, "SPACE_GROUP_NUMBER= %s\n", spacegroup_for_lattice(xp->cell)); - printf("%s\n", spacegroup_for_lattice(xp->cell)); cell_get_parameters(xp->cell, &a, &b, &c, &al, &be, &ga); fprintf(fh, "UNIT_CELL_CONSTANTS= %.2f %.2f %.2f %.2f %.2f %.2f\n", a*1e10, b*1e10, c*1e10,rad2deg(al), rad2deg(be), rad2deg(ga)); -- cgit v1.2.3