From 19f977c6d62ffca9f13bcdefef32b5b27a326b7a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 26 Jun 2014 11:22:24 +0200 Subject: Rationalise counting of filtered eigenvalues --- src/partialator.c | 11 ++++++++++- src/post-refinement.c | 14 ++++++++++---- src/post-refinement.h | 1 + src/scaling-report.c | 3 --- src/scaling-report.h | 7 ++++--- 5 files changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/partialator.c b/src/partialator.c index 8823990f..2ef01dba 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -129,7 +129,10 @@ static void done_image(void *vqargs, void *task) struct refine_args *pargs = task; qargs->n_done++; - qargs->srdata->n_filtered += pargs->prdata.n_filtered; + if ( pargs->prdata.refined ) { + qargs->srdata->n_refined += pargs->prdata.refined; + qargs->srdata->n_filtered += pargs->prdata.n_filtered; + } progress_bar(qargs->n_done, qargs->n_crystals, "Refining"); free(task); @@ -150,6 +153,7 @@ static void refine_all(Crystal **crystals, int n_crystals, task_defaults.full = full; task_defaults.crystal = NULL; task_defaults.pmodel = pmodel; + task_defaults.prdata.refined = 0; task_defaults.prdata.n_filtered = 0; qargs.task_defaults = task_defaults; @@ -164,6 +168,10 @@ static void refine_all(Crystal **crystals, int n_crystals, run_threads(nthreads, refine_image, get_image, done_image, &qargs, n_crystals, 0, 0, 0); + + STATUS("%5.2f eigenvalues filtered on final iteration per successfully " + "refined crystal\n", + (double)srdata->n_filtered/srdata->n_refined); } @@ -462,6 +470,7 @@ int main(int argc, char *argv[]) srdata.n = n_crystals; srdata.full = full; srdata.n_filtered = 0; + srdata.n_refined = 0; sr = sr_titlepage(crystals, n_crystals, "scaling-report.pdf", infile, cmdline); diff --git a/src/post-refinement.c b/src/post-refinement.c index 535f7cff..5de8a246 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -469,7 +469,7 @@ static gsl_vector *solve_svd(gsl_vector *v, gsl_matrix *M, int *n_filt, /* Perform one cycle of post refinement on 'image' against 'full' */ static double pr_iterate(Crystal *cr, const RefList *full, - PartialityModel pmodel, struct prdata *prdata) + PartialityModel pmodel, int *n_filtered) { gsl_matrix *M; gsl_vector *v; @@ -482,6 +482,8 @@ static double pr_iterate(Crystal *cr, const RefList *full, int nref = 0; const int verbose = 0; + *n_filtered = 0; + reflections = crystal_get_reflections(cr); M = gsl_matrix_calloc(NUM_PARAMS, NUM_PARAMS); @@ -574,7 +576,7 @@ static double pr_iterate(Crystal *cr, const RefList *full, } max_shift = 0.0; - shifts = solve_svd(v, M, &prdata->n_filtered, verbose); + shifts = solve_svd(v, M, n_filtered, verbose); if ( shifts != NULL ) { for ( param=0; paramcr); } - - STATUS("%i filtered total, %5.2f filtered per crystal\n", - d->n_filtered, (double)d->n_filtered / d->n); } diff --git a/src/scaling-report.h b/src/scaling-report.h index 5f6e2cb4..55037038 100644 --- a/src/scaling-report.h +++ b/src/scaling-report.h @@ -3,11 +3,11 @@ * * Write a nice PDF of scaling parameters * - * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY, - * a research centre of the Helmholtz Association. + * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, + * a research centre of the Helmholtz Association. * * Authors: - * 2011-2012 Thomas White + * 2011-2014 Thomas White * * This file is part of CrystFEL. * @@ -46,6 +46,7 @@ struct srdata RefList *full; int n_filtered; + int n_refined; }; #if defined(HAVE_CAIRO) && defined(HAVE_PANGO) && defined(HAVE_PANGOCAIRO) -- cgit v1.2.3