aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dirax.c21
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);