aboutsummaryrefslogtreecommitdiff
path: root/src
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
parentcbee076c3608dc19027f8f49c67ff01aef2e5b3f (diff)
Store scale factor in linear form
Diffstat (limited to 'src')
-rw-r--r--src/merge.c2
-rw-r--r--src/partialator.c4
-rw-r--r--src/post-refinement.c2
-rw-r--r--src/rejection.c2
-rw-r--r--src/scaling.c4
5 files changed, 7 insertions, 7 deletions
diff --git a/src/merge.c b/src/merge.c
index 17e57c90..33221bda 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -189,7 +189,7 @@ static void run_merge_job(void *vwargs, int cookie)
}
/* Total (multiplicative) correction factor */
- corr = exp(-G) * exp(B*res*res) * get_lorentz(refl)
+ corr = (1.0/G) * exp(B*res*res) * get_lorentz(refl)
/ get_partiality(refl);
if ( isnan(corr) ) {
ERROR("NaN corr:\n");
diff --git a/src/partialator.c b/src/partialator.c
index af04d935..033efe27 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -637,7 +637,7 @@ static void write_to_pgraph(FILE *fh, RefList *list, RefList *full, Crystal *cr,
pcalc = get_partiality(refl);
/* Observed partiality */
- corr = exp(-G) * exp(B*res*res) * get_lorentz(refl);
+ corr = (1.0/G) * exp(B*res*res) * get_lorentz(refl);
Ipart = get_intensity(refl) * corr;
pobs = Ipart / get_intensity(match);
@@ -689,7 +689,7 @@ static void write_specgraph(RefList *full, Crystal *crystal, int in)
match = find_refl(full, h, k, l);
if ( match == NULL ) continue;
- corr = exp(-G) * exp(B*res*res) * get_lorentz(refl);
+ corr = (1.0/G) * exp(B*res*res) * get_lorentz(refl);
Ipart = get_intensity(refl) * corr;
Ifull = get_intensity(match);
esd = get_esd_intensity(match);
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 5624b15d..579db7e4 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -115,7 +115,7 @@ double residual(Crystal *cr, const RefList *full, int free,
p = get_partiality(refl);
//if ( p < 0.2 ) continue;
- corr = exp(-G) * exp(B*res*res) * get_lorentz(refl);
+ corr = (1.0/G) * exp(B*res*res) * get_lorentz(refl);
int1 = get_intensity(refl) * corr;
int2 = p*I_full;
w = 1.0;
diff --git a/src/rejection.c b/src/rejection.c
index 10f13f9c..a44b697f 100644
--- a/src/rejection.c
+++ b/src/rejection.c
@@ -137,7 +137,7 @@ static void check_cc(Crystal *cr, RefList *full)
pcalc = get_partiality(refl);
/* Observed partiality */
- corr = exp(-G) * exp(B*res*res) * get_lorentz(refl);
+ corr = (1.0/G) * exp(B*res*res) * get_lorentz(refl);
Ipart = get_intensity(refl) * corr;
pobs = Ipart / get_intensity(match);
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);
}
}