aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-08-01 16:32:49 +0200
committerThomas White <taw@physics.org>2013-08-01 16:32:49 +0200
commitd001bcca749215e41a79a0de32e4cc049ace8b86 (patch)
treeb098f602f4c77f6ce51e66e50ed3e74ca7df2684 /src
parent0d9370a585d27aedd2cdf0d3b082be1cfca8e5e8 (diff)
Use a struct to contain information for scaling report
Diffstat (limited to 'src')
-rw-r--r--src/partialator.c11
-rw-r--r--src/scaling-report.c15
-rw-r--r--src/scaling-report.h15
3 files changed, 27 insertions, 14 deletions
diff --git a/src/partialator.c b/src/partialator.c
index a282744e..6b29a74f 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -333,6 +333,7 @@ int main(int argc, char *argv[])
PartialityModel pmodel = PMODEL_SPHERE;
int min_measurements = 2;
char *rval;
+ struct srdata srdata;
/* Long options */
const struct option longopts[] = {
@@ -611,9 +612,13 @@ int main(int argc, char *argv[])
full = scale_intensities(crystals, n_crystals, reference,
nthreads, noscale, pmodel, min_measurements);
+ srdata.crystals = crystals;
+ srdata.n = n_crystals;
+ srdata.full = full;
+
sr = sr_titlepage(crystals, n_crystals, "scaling-report.pdf",
infile, cmdline);
- sr_iteration(sr, 0, crystals, n_crystals, full);
+ sr_iteration(sr, 0, &srdata);
/* Iterate */
for ( i=0; i<n_iter; i++ ) {
@@ -646,7 +651,9 @@ int main(int argc, char *argv[])
reference, nthreads, noscale, pmodel,
min_measurements);
- sr_iteration(sr, i+1, crystals, n_crystals, full);
+ srdata.full = full;
+
+ sr_iteration(sr, i+1, &srdata);
}
diff --git a/src/scaling-report.c b/src/scaling-report.c
index 8e70af50..acb007ae 100644
--- a/src/scaling-report.c
+++ b/src/scaling-report.c
@@ -817,8 +817,7 @@ SRContext *sr_titlepage(Crystal **crystals, int n,
}
-void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
- RefList *full)
+void sr_iteration(SRContext *sr, int iteration, struct srdata *d)
{
int i;
char page_title[1024];
@@ -834,7 +833,7 @@ void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
cairo_save(sr->cr);
cairo_translate(sr->cr, 480.0, 350.0);
- scale_factor_histogram(sr->cr, crystals, n,
+ scale_factor_histogram(sr->cr, d->crystals, d->n,
"Distribution of overall scale factors");
cairo_restore(sr->cr);
@@ -842,7 +841,7 @@ void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
cairo_save(sr->cr);
cairo_translate(sr->cr, 70.0, 330.0);
- partiality_graph(sr->cr, crystals, n, full);
+ partiality_graph(sr->cr, d->crystals, d->n, d->full);
cairo_save(sr->cr);
cairo_move_to(sr->cr, 0.0, 0.0);
@@ -853,7 +852,7 @@ void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
cairo_stroke(sr->cr);
cairo_set_dash(sr->cr, NULL, 0, 0.0);
cairo_translate(sr->cr, 0.0, -150.0);
- partiality_histogram(sr->cr, crystals, n, full, 1, 0);
+ partiality_histogram(sr->cr, d->crystals, d->n, d->full, 1, 0);
cairo_restore(sr->cr);
cairo_save(sr->cr);
@@ -866,13 +865,13 @@ void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
cairo_set_dash(sr->cr, NULL, 0, 0.0);
cairo_translate(sr->cr, 230.0, 200.0);
cairo_rotate(sr->cr, -M_PI_2);
- partiality_histogram(sr->cr, crystals, n, full, 0, 1);
+ partiality_histogram(sr->cr, d->crystals, d->n, d->full, 0, 1);
cairo_restore(sr->cr);
cairo_restore(sr->cr);
if ( iteration == 0 ) {
- find_most_sampled_reflections(full, 9,
+ find_most_sampled_reflections(d->full, 9,
sr->ms_h, sr->ms_k, sr->ms_l);
}
@@ -885,7 +884,7 @@ void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
cairo_save(sr->cr);
cairo_translate(sr->cr, 400.0+140.0*x, 60.0+80.0*y);
- intensity_histogram(sr->cr, crystals, n, full,
+ intensity_histogram(sr->cr, d->crystals, d->n, d->full,
sr->ms_h[i], sr->ms_k[i], sr->ms_l[i]);
cairo_restore(sr->cr);
diff --git a/src/scaling-report.h b/src/scaling-report.h
index 5b153377..473e1759 100644
--- a/src/scaling-report.h
+++ b/src/scaling-report.h
@@ -38,6 +38,15 @@
typedef struct _srcontext SRContext; /* Opaque */
+/* Information is logged in this structure */
+struct srdata
+{
+ int n_no_refine; /* Number that couldn't be refined */
+ Crystal **crystals;
+ int n;
+ RefList *full;
+};
+
#ifdef HAVE_CAIRO
extern SRContext *sr_titlepage(Crystal **crystals, int n,
@@ -45,8 +54,7 @@ extern SRContext *sr_titlepage(Crystal **crystals, int n,
const char *stream_filename,
const char *cmdline);
-extern void sr_iteration(SRContext *sr, int iteration,
- Crystal **crystals, int n, RefList *full);
+extern void sr_iteration(SRContext *sr, int iteration, struct srdata *d);
extern void sr_finish(SRContext *sr);
@@ -58,8 +66,7 @@ SRContext *sr_titlepage(Crystal **crystals, int n, const char *filename,
return NULL;
}
-void sr_iteration(SRContext *sr, int iteration, Crystal **crystals, int n,
- RefList *full)
+void sr_iteration(SRContext *sr, int iteration, struct srdata *d)
{
}