diff options
author | Thomas White <taw@physics.org> | 2015-06-19 17:00:38 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-06-19 17:00:38 +0200 |
commit | f146a02bd410ce93f8efded573393f1e861c5f11 (patch) | |
tree | 2d69d4c5b147804af36fd2bc5a08a3cb4fbad9b5 /libcrystfel/src | |
parent | 5cb8ef0ac40c7968e2c61a79465eb9f6d9c43786 (diff) |
Tidy up new MOSFLM code
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/mosflm.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c index 2755e574..afdfdb11 100644 --- a/libcrystfel/src/mosflm.c +++ b/libcrystfel/src/mosflm.c @@ -519,7 +519,8 @@ static char *spacegroup_for_lattice(UnitCell *cell) static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm) { - char tmp[256], *symm; + char tmp[256]; + char cen; double wavelength; double a = 0, b = 0, c = 0, alpha = 0, beta = 0, gamma = 0; @@ -535,6 +536,7 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm) if ( (mosflm->mp->indm & INDEXING_USE_LATTICE_TYPE) && (mosflm->mp->template != NULL) ) { + char *symm; if ( cell_get_lattice_type(mosflm->mp->template) == L_RHOMBOHEDRAL ) { @@ -577,22 +579,22 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm) break; case 8 : - symm = NULL; - if (mosflm->mp->indm & INDEXING_USE_CELL_PARAMETERS) { - cell_get_parameters(mosflm->mp->template, &a, &b, &c, &alpha, &beta, &gamma); - symm = spacegroup_for_lattice(mosflm->mp->template); + if ( mosflm->mp->indm & INDEXING_USE_CELL_PARAMETERS ) { + cell_get_parameters(mosflm->mp->template, + &a, &b, &c, &alpha, &beta, &gamma); + cen = cell_get_centering(mosflm->mp->template); } else { - symm = strdup("P"); - a = 0; // This disables prior-cell algorithm in MOSFLM + cen = 'P'; + a = 0; /* Disables prior-cell algorithm in MOSFLM */ } - // Old MOSFLM simply ignores CELL and CENTERING subkeywords. - // So this doesn't do any harm. TODO: but still better to show WARNING if MOSFLM is old. - snprintf(tmp, 255, "AUTOINDEX DPS FILE %s IMAGE 1 MAXCELL 1000 REFINE " - "CELL %.1f %.1f %.1f %.1f %.1f %.1f CENTERING %c\n", - mosflm->sptfile, 1E10 * a, 1E10 * b, 1E10 * c, - alpha / M_PI * 180, beta / M_PI *180, gamma / M_PI * 180, symm[0]); - free(symm); - + /* Old MOSFLM simply ignores CELL and CENTERING subkeywords. + * So this doesn't do any harm. + * TODO: but still better to show WARNING if MOSFLM is old. */ + snprintf(tmp, 255, "AUTOINDEX DPS FILE %s IMAGE 1 MAXCELL 1000" + "REFINE " + "CELL %.1f %.1f %.1f %.1f %.1f %.1f CENTERING %c\n", + mosflm->sptfile, a*1e10, b*1e10, c*1e10, + rad2deg(alpha), rad2deg(beta), rad2deg(gamma), cen); mosflm_sendline(tmp, mosflm); break; |