aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-03-12 13:33:23 +0100
committerThomas White <taw@physics.org>2015-03-12 16:37:25 +0100
commit8b79062865999a02ca8c049030531829abb1060d (patch)
treed4014d03fdca9f1086d05ffc183bbe485228df26 /src
parentd17da445040ac23aec7770c214ab0bdbf315f959 (diff)
Keep the centre of the B factor distribution at zero
Diffstat (limited to 'src')
-rw-r--r--src/hrs-scaling.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 141139d5..4d03f6b0 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -501,8 +501,9 @@ RefList *scale_intensities(Crystal **crystals, int n, int n_threads,
do {
double total_sf = 0.0;
+ double total_B = 0.0;
int n_sf = 0;
- double norm_sf;
+ double norm_sf, norm_B;
int j;
for ( j=0; j<n; j++ ) {
@@ -517,16 +518,19 @@ RefList *scale_intensities(Crystal **crystals, int n, int n_threads,
/* Normalise the scale factors */
for ( j=0; j<n; j++ ) {
- double osf = crystal_get_osf(crystals[j]);
if ( crystal_get_user_flag(crystals[j]) == 0 ) {
- total_sf += osf;
+ total_sf += crystal_get_osf(crystals[j]);
+ total_B += crystal_get_Bfac(crystals[j]);
n_sf++;
}
}
norm_sf = total_sf / n_sf;
+ norm_B = total_B / n_sf;
for ( j=0; j<n; j++ ) {
crystal_set_osf(crystals[j],
crystal_get_osf(crystals[j])/norm_sf);
+ crystal_set_Bfac(crystals[j],
+ crystal_get_Bfac(crystals[j])-norm_B);
}
done = test_convergence(old_osfs, old_Bs, old_flags,