aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-11-22 16:49:49 +0100
committerThomas White <taw@physics.org>2018-11-22 16:50:32 +0100
commit6e9655241ff531b300d38d3e2f5a1e5c7d69f7b3 (patch)
tree1ebaec1fbefa11bbb6e8b6ea1fbcdccfaffa6252 /src
parenta166b0ae68b99bea3f2e08cc508a863a0f36073b (diff)
Don't weight reflections by partiality in residual
Because we want under-prediction to be penalised just as much as over-prediction
Diffstat (limited to 'src')
-rw-r--r--src/merge.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/merge.c b/src/merge.c
index 1aaa272f..787afca3 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -368,7 +368,7 @@ double residual(Crystal *cr, const RefList *full, int free,
refl != NULL;
refl = next_refl(refl, iter) )
{
- double p, w, corr, res;
+ double w, corr, res;
signed int h, k, l;
Reflection *match;
double I_full;
@@ -384,13 +384,10 @@ double residual(Crystal *cr, const RefList *full, int free,
if ( get_redundancy(match) < 2 ) continue;
- p = get_partiality(refl);
- //if ( p < 0.2 ) continue;
-
corr = get_lorentz(refl) / (G * exp(-B*res*res));
int1 = get_intensity(refl) * corr;
- int2 = p*I_full;
- w = p;
+ int2 = get_partiality(refl)*I_full;
+ w = 1.0;
num += fabs(int1 - int2) * w;
den += fabs(int1 + int2) * w/2.0;