From b97b7f02373229765038a181dfb03c15b4fc5b87 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 30 Mar 2009 12:22:19 +0100 Subject: Restore chunk which got clobbered by 69d1342278729353799d0fee646e0f44517ebed8 --- src/dirax.c | 21 ++++++++++++++++----- 1 file 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); -- cgit v1.2.3