aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-02-01 15:55:35 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:12 +0100
commitc92e7fbe4315f43488bfc96044124cc813da9f2a (patch)
tree4ef4aa6c7fdab3a57c485970cd3a49c300e47727
parent671c1cef62c90851baa40dd3d6888af538c76bf3 (diff)
Allow MOSFLM to index without a unit cell
-rw-r--r--src/mosflm.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/mosflm.c b/src/mosflm.c
index 11642cc8..7b4253cb 100644
--- a/src/mosflm.c
+++ b/src/mosflm.c
@@ -307,26 +307,35 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm)
break;
case 2 :
- cell_get_parameters(mosflm->target_cell, &a, &b, &c,
- &alpha, &beta, &gamma);
- snprintf(tmp, 255, "CELL %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n",
- a*1e10, b*1e10, c*1e10,
- rad2deg(alpha), rad2deg(beta), rad2deg(gamma));
- mosflm_sendline(tmp, mosflm);
+ if ( mosflm->target_cell != NULL ) {
+ cell_get_parameters(mosflm->target_cell, &a, &b, &c,
+ &alpha, &beta, &gamma);
+ snprintf(tmp, 255,
+ "CELL %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f\n",
+ a*1e10, b*1e10, c*1e10,
+ rad2deg(alpha), rad2deg(beta), rad2deg(gamma));
+ mosflm_sendline(tmp, mosflm);
+ } else {
+ mosflm_sendline("# Do nothing\n", mosflm);
+ }
break;
case 3 :
- 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];
+ 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';
+ snprintf(tmp, 255, "SYMM %s\n", symm);
+ mosflm_sendline(tmp, mosflm);
+ } else {
+ mosflm_sendline("SYMM P1\n", mosflm);
}
- symm[j] = '\0';
- snprintf(tmp, 255, "SYMM %s\n", symm);
- mosflm_sendline(tmp, mosflm);
break;
case 4 :