diff options
Diffstat (limited to 'src/scaling-report.c')
-rw-r--r-- | src/scaling-report.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/scaling-report.c b/src/scaling-report.c index 89b2f3f2..85ed0ad2 100644 --- a/src/scaling-report.c +++ b/src/scaling-report.c @@ -196,6 +196,7 @@ static void partiality_graph(cairo_t *cr, Crystal **crystals, int n, double pcalcmin[nbins]; double pcalcmax[nbins]; int num_nondud; + gsl_rng *rng; show_text_simple(cr, "Observed partiality", -20.0, g_height/2.0, NULL, -M_PI_2, J_CENTER); @@ -223,6 +224,10 @@ static void partiality_graph(cairo_t *cr, Crystal **crystals, int n, num_nondud++; } + /* The reflections chosen for the graph will be the same every time + * (given the same sequence of input reflections, scalabilities etc) */ + rng = gsl_rng_alloc(gsl_rng_mt19937); + cairo_set_source_rgb(cr, 0.0, 0.7, 0.0); prob = 1.0 / num_nondud; for ( i=0; i<n; i++ ) { @@ -279,13 +284,15 @@ static void partiality_graph(cairo_t *cr, Crystal **crystals, int n, bin = nbins * pcalc; - if ( random_flat(1.0) < prob ) { + if ( random_flat(rng, 1.0) < prob ) { plot_point(cr, g_width, g_height, pcalc, pobs); } } } + gsl_rng_free(rng); + cairo_new_path(cr); cairo_rectangle(cr, 0.0, 0.0, g_width, g_height); cairo_clip(cr); |