aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-03-17 14:34:42 +0100
committerThomas White <taw@physics.org>2015-04-20 15:50:39 +0200
commit83e259f5ab54c848e80c33060a48dea379d38f6f (patch)
tree9a5971ab25cd8e6835bb25715c2b41ab94090f2e /src/post-refinement.c
parent3a1864f93caff3629f64cf4ae8e8fe778c216910 (diff)
Make panel assignments invariant during prediction- and post-refinement
Reflections appearing and disappearing are problematic when trying to do a least-squares refinement. Therefore, assume that reflections stay on panel and keep them under consideration even if their partialities go to zero (i.e. they drift off Bragg). This should stabilise both refinements, and simplifies quite a lot of code. Collateral "damage": the old "select_intersection()" is now gone.
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 96c0de12..745e5bd7 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -614,33 +614,17 @@ struct prdata pr_refine(Crystal *cr, const RefList *full,
double bsx, bsy, bsz;
double csx, csy, csz;
double dev;
- int n_total;
- int n_gained = 0;
- int n_lost = 0;
- n_total = num_reflections(crystal_get_reflections(cr));
cell_get_reciprocal(crystal_get_cell(cr), &asx, &asy, &asz,
&bsx, &bsy, &bsz, &csx, &csy, &csz);
pr_iterate(cr, full, pmodel, &prdata.n_filtered);
- update_partialities_2(cr, pmodel, &n_gained, &n_lost,
- &mean_p_change);
+ update_partialities(cr, pmodel);
if ( verbose ) {
dev = guide_dev(cr, full);
- STATUS("PR Iteration %2i: mean p change = %10.2f"
- " dev = %10.5e, %i gained, %i lost, %i total\n",
- i+1, mean_p_change, dev,
- n_gained, n_lost, n_total);
- }
-
- if ( 3*n_lost > n_total ) {
- revert_crystal(cr, backup);
- update_partialities_2(cr, pmodel, &n_gained, &n_lost,
- &mean_p_change);
- crystal_set_user_flag(cr, 4);
- break;
+ STATUS("PR Iteration %2i: dev = %10.5e\n", i+1, dev);
}
i++;