aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-10-11 16:33:21 +0200
committerThomas White <taw@physics.org>2013-10-11 16:33:21 +0200
commit2a1a42e23f35ae745881188654240bd571dd0fdf (patch)
tree0b5ab7665a296f500b80ec40e9a890490eccecb2 /src
parent46dcc94ec094d061724930c85944af7ea6dfb0f8 (diff)
partial_sim: Show overall numbers
Diffstat (limited to 'src')
-rw-r--r--src/partial_sim.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index bbdc1550..7a3517a3 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -639,6 +639,10 @@ int main(int argc, char *argv[])
if ( phist_file != NULL ) {
+ double overall_max = 0.0;
+ double overall_mean = 0.0;
+ long long int overall_total = 0;
+
fh = fopen(phist_file, "w");
if ( fh != NULL ) {
@@ -647,6 +651,13 @@ int main(int argc, char *argv[])
double rcen;
+ if ( qargs.p_max[i] > overall_max ) {
+ overall_max = qargs.p_max[i];
+ }
+
+ overall_mean += qargs.p_hist[i];
+ overall_total += qargs.n_ref[i];
+
rcen = i/(double)NBINS*qargs.max_q
+ qargs.max_q/(2.0*NBINS);
fprintf(fh, "%.2f %7li %.3f %.3f\n", rcen/1.0e9,
@@ -658,6 +669,13 @@ int main(int argc, char *argv[])
fclose(fh);
+ overall_mean /= overall_total;
+
+ STATUS("Overall max partiality = %.2f\n", overall_max);
+ STATUS("Overall mean partiality = %.2f\n", overall_mean);
+ STATUS("Total number of reflections = %lli\n",
+ overall_total);
+
} else {
ERROR("Failed to open file '%s' for writing.\n",
phist_file);