aboutsummaryrefslogtreecommitdiff
path: root/src/scaling.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-10-26 15:51:29 +0200
committerThomas White <taw@physics.org>2018-02-27 17:12:41 +0100
commitdc854c240913d4c179f49c35f7b869e2c39b86c7 (patch)
tree159a94333cce8f237093e6b4621cde869871ddb4 /src/scaling.c
parentcbee076c3608dc19027f8f49c67ff01aef2e5b3f (diff)
Store scale factor in linear form
Diffstat (limited to 'src/scaling.c')
-rw-r--r--src/scaling.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scaling.c b/src/scaling.c
index 0908cfb3..c7c608fe 100644
--- a/src/scaling.c
+++ b/src/scaling.c
@@ -183,7 +183,7 @@ static double scale_iterate(Crystal *cr, const RefList *full,
}
- fx = G + log(p) - log(L) - B*s*s + log(I_full);
+ fx = -log(G) + log(p) - log(L) - B*s*s + log(I_full);
delta_I = log(I_partial) - fx;
v_c = w * delta_I * gradients[k];
v_curr = gsl_vector_get(v, k);
@@ -549,7 +549,7 @@ void scale_all_to_reference(Crystal **crystals, int n_crystals,
for ( i=0; i<n_crystals; i++ ) {
double G;
linear_scale(crystal_get_reflections(crystals[i]), reference, &G);
- crystal_set_osf(crystals[i], -log(G));
+ crystal_set_osf(crystals[i], G);
crystal_set_Bfac(crystals[i], 0.0);
}
}