aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/partialator.c22
-rw-r--r--src/rejection.c2
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);
}