diff options
author | Thomas White <taw27@cam.ac.uk> | 2009-03-30 12:22:19 +0100 |
---|---|---|
committer | Thomas White <taw27@cam.ac.uk> | 2009-03-30 12:22:19 +0100 |
commit | b97b7f02373229765038a181dfb03c15b4fc5b87 (patch) | |
tree | 841c6c23e54ea3d100c3353e13a5021207f29ad3 | |
parent | d3ea8291ad68bf22123b8c16e6eb19a428b05329 (diff) |
Restore chunk which got clobbered by 69d1342278729353799d0fee646e0f44517ebed8
-rw-r--r-- | src/dirax.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/dirax.c b/src/dirax.c index 6e97d21..5063c60 100644 --- a/src/dirax.c +++ b/src/dirax.c @@ -405,6 +405,7 @@ void dirax_invoke(ControlContext *ctx) Reflection *ref; unsigned int opts; int saved_stderr; + int n; if ( ctx->dirax ) { dirax_rerun(ctx); @@ -419,11 +420,21 @@ void dirax_invoke(ControlContext *ctx) return; } fprintf(fh, "%f\n", 0.5); /* Lie about the wavelength. */ - ref = ctx->reflectionlist->reflections; - while ( ref ) { - fprintf(fh, "%10f %10f %10f %8f\n", ref->x/1e10, ref->y/1e10, - ref->z/1e10, ref->intensity); - ref = ref->next; + + n = ctx->reflectionlist->n_reflections; + printf("DX: There are %i reflections - ", n); + if ( n > 1000 ) { + printf("sending a random selection to DirAx\n"); + dirax_send_random_selection(ctx->reflectionlist, n, fh); + } else { + printf("sending them all to DirAx\n"); + ref = ctx->reflectionlist->reflections; + while ( ref ) { + fprintf(fh, "%10f %10f %10f %8f\n", + ref->x/1e10, ref->y/1e10, + ref->z/1e10, ref->intensity); + ref = ref->next; + } } fclose(fh); |