diff options
author | Thomas White <taw@physics.org> | 2015-07-07 14:16:14 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-07-07 14:16:39 +0200 |
commit | 0bcfe3cdf917ae53764c423c7af865352af47920 (patch) | |
tree | b20b1cbf3732c31101c72ab98b66fb958329d136 | |
parent | 732d177f54c3c9d060992a9c4831401a4c926b6d (diff) |
partialator: Increase maximum B factor to 1000 A^2, and normalise B factors
-rw-r--r-- | src/partialator.c | 22 | ||||
-rw-r--r-- | src/rejection.c | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/partialator.c b/src/partialator.c index ef81ab43..46353c25 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -436,6 +436,27 @@ static void write_pgraph(RefList *full, Crystal **crystals, int n_crystals, } +static void normalise_scales(Crystal **crystals, int n_crystals) +{ + int i; + int n = 0; + double sum_B = 0.0; + double mean_B; + + for ( i=0; i<n_crystals; i++ ) { + if ( crystal_get_user_flag(crystals[i]) != 0 ) continue; + sum_B += crystal_get_Bfac(crystals[i]); + n++; + } + mean_B = sum_B / n; + STATUS("Mean B = %e A^2\n", mean_B*1e20); + for ( i=0; i<n_crystals; i++ ) { + double B = crystal_get_Bfac(crystals[i]); + crystal_set_Bfac(crystals[i], B-mean_B); + } +} + + int main(int argc, char *argv[]) { int c; @@ -820,6 +841,7 @@ int main(int argc, char *argv[]) show_duds(crystals, n_crystals); check_rejection(crystals, n_crystals, full); + normalise_scales(crystals, n_crystals); /* Re-estimate all the full intensities */ reflist_free(full); diff --git a/src/rejection.c b/src/rejection.c index a565fec3..f0d6dd3e 100644 --- a/src/rejection.c +++ b/src/rejection.c @@ -175,7 +175,7 @@ void check_rejection(Crystal **crystals, int n, RefList *full) for ( i=0; i<n; i++ ) { /* Reject if B factor modulus is very large */ - if ( fabs(crystal_get_Bfac(crystals[i])) > 1e-18 ) { + if ( fabs(crystal_get_Bfac(crystals[i])) > 1e-17 ) { crystal_set_user_flag(crystals[i], 1); } |