aboutsummaryrefslogtreecommitdiff
path: root/src/hrs-scaling.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-09-29 16:17:12 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:38 +0100
commit51177ac637ecc41adffb7a73f118911862bf162d (patch)
treedf22c68b4c576457cc12291deca4410e0a8a4ef1 /src/hrs-scaling.c
parente872c19300aa50169a76bc95f215fe67c358a1a8 (diff)
Multiply the right way round
Diffstat (limited to 'src/hrs-scaling.c')
-rw-r--r--src/hrs-scaling.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 8cf5e8b8..1d91fb3a 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -83,16 +83,16 @@ static double iterate_scale(struct image *images, int n, RefList *reference)
Ihl = get_intensity(refl) / get_partiality(refl);
num += Ih * Ihl;
- den += Ihl * Ihl;
+ den += Ih * Ih;
}
new_sf = num / den;
if ( !isnan(new_sf) && !isinf(new_sf) ) {
- corr = image->osf - new_sf;
+ corr = fabs(image->osf - new_sf);
image->osf = new_sf;
}
- if ( fabs(corr) > max_shift ) max_shift = fabs(corr);
+ if ( corr > max_shift ) max_shift = corr;
}