aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-11-23 11:28:35 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:07 +0100
commit68b987cfdf00a50189fd996bc7a3bcfa8d4578ce (patch)
treef32d420c2dd0682d4aedf2a52d7e99ac65185bdb /src/post-refinement.c
parent3d9e2ac8c606c4fcf37ddd49a1be4712851bc21e (diff)
Estimate using successfully integrated reflections only
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 69a9563c..835c4330 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -220,9 +220,10 @@ void apply_shift(struct image *image, int k, double shift)
double mean_partial_dev(struct image *image, struct cpeak *spots, int n,
const char *sym, double *i_full, FILE *graph)
{
- int h;
+ int h, n_used;
double delta_I = 0.0;
+ n_used = 0;
for ( h=0; h<n; h++ ) {
signed int hind, kind, lind;
@@ -251,6 +252,7 @@ double mean_partial_dev(struct image *image, struct cpeak *spots, int n,
get_asymm(hind, kind, lind, &ha, &ka, &la, sym);
I_full = lookup_intensity(i_full, ha, ka, la);
delta_I += fabs(I_partial - spots[h].p * I_full);
+ n_used++;
if ( graph != NULL ) {
fprintf(graph, "%3i %3i %3i %5.2f (at %5.2f,%5.2f)"
@@ -261,7 +263,7 @@ double mean_partial_dev(struct image *image, struct cpeak *spots, int n,
}
- return delta_I / (double)n;
+ return delta_I / (double)n_used;
}