From 40dd7ff04a44688544e22cc3a0384bef808abc64 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 18 Nov 2015 17:07:32 +0100 Subject: Move B factor limit to general rejection function --- src/partialator.c | 7 +++---- src/rejection.c | 6 +++++- src/rejection.h | 3 ++- src/scaling.c | 9 +-------- src/scaling.h | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/partialator.c b/src/partialator.c index 6de69cd2..23f0c089 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -1009,7 +1009,7 @@ int main(int argc, char *argv[]) /* Initial rejection, figures of merit etc */ full = merge_intensities(crystals, n_crystals, nthreads, pmodel, min_measurements, push_res, 1); - check_rejection(crystals, n_crystals, full); + check_rejection(crystals, n_crystals, full, max_B); show_all_residuals(crystals, n_crystals, full); write_pgraph(full, crystals, n_crystals, 0); @@ -1019,8 +1019,7 @@ int main(int argc, char *argv[]) STATUS("Scaling and refinement cycle %i of %i\n", i+1, n_iter); if ( !no_scale ) { - scale_all(crystals, n_crystals, nthreads, pmodel, - max_B); + scale_all(crystals, n_crystals, nthreads, pmodel); reflist_free(full); full = merge_intensities(crystals, n_crystals, nthreads, pmodel, min_measurements, @@ -1036,7 +1035,7 @@ int main(int argc, char *argv[]) push_res, 1); } - check_rejection(crystals, n_crystals, full); + check_rejection(crystals, n_crystals, full, max_B); reflist_free(full); full = merge_intensities(crystals, n_crystals, nthreads, pmodel, min_measurements, diff --git a/src/rejection.c b/src/rejection.c index e9496932..441a83e6 100644 --- a/src/rejection.c +++ b/src/rejection.c @@ -192,7 +192,7 @@ static void show_duds(Crystal **crystals, int n_crystals) } -void check_rejection(Crystal **crystals, int n, RefList *full) +void check_rejection(Crystal **crystals, int n, RefList *full, double max_B) { int i; int n_acc = 0; @@ -200,7 +200,11 @@ void check_rejection(Crystal **crystals, int n, RefList *full) /* Check according to CCs FIXME: Disabled */ //if ( full != NULL ) check_ccs(crystals, n, full); + for ( i=0; i max_B ) { + crystal_set_user_flag(crystals[i], PRFLAG_BIGB); + } if ( crystal_get_user_flag(crystals[i]) == 0 ) n_acc++; } diff --git a/src/rejection.h b/src/rejection.h index ec529941..8979313b 100644 --- a/src/rejection.h +++ b/src/rejection.h @@ -38,6 +38,7 @@ #include "crystal.h" extern void early_rejection(Crystal **crystals, int n); -extern void check_rejection(Crystal **crystals, int n, RefList *full); +extern void check_rejection(Crystal **crystals, int n, RefList *full, + double max_B); #endif /* REJECTION_H */ diff --git a/src/scaling.c b/src/scaling.c index b3b9137e..5bfba451 100644 --- a/src/scaling.c +++ b/src/scaling.c @@ -317,7 +317,6 @@ struct scale_args RefList *full; Crystal *crystal; PartialityModel pmodel; - double max_B; }; @@ -335,11 +334,6 @@ static void scale_crystal(void *task, int id) { struct scale_args *pargs = task; do_scale_refine(pargs->crystal, pargs->full, pargs->pmodel); - - /* Reject if B factor modulus is very large */ - if ( fabs(crystal_get_Bfac(pargs->crystal)) > pargs->max_B ) { - crystal_set_user_flag(pargs->crystal, PRFLAG_BIGB); - } } @@ -395,7 +389,7 @@ static double total_log_r(Crystal **crystals, int n_crystals, RefList *full, /* Perform iterative scaling, all the way to convergence */ void scale_all(Crystal **crystals, int n_crystals, int nthreads, - PartialityModel pmodel, double max_B) + PartialityModel pmodel) { struct scale_args task_defaults; struct queue_args qargs; @@ -403,7 +397,6 @@ void scale_all(Crystal **crystals, int n_crystals, int nthreads, task_defaults.crystal = NULL; task_defaults.pmodel = pmodel; - task_defaults.max_B = max_B; qargs.task_defaults = task_defaults; qargs.n_crystals = n_crystals; diff --git a/src/scaling.h b/src/scaling.h index f8eb4e9e..534043d9 100644 --- a/src/scaling.h +++ b/src/scaling.h @@ -42,6 +42,6 @@ extern double log_residual(Crystal *cr, const RefList *full, int free, int *pn_used, const char *filename); extern void scale_all(Crystal **crystals, int n_crystals, int nthreads, - PartialityModel pmodel, double max_B); + PartialityModel pmodel); #endif /* SCALING_H */ -- cgit v1.2.3