aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/partialator.c6
-rw-r--r--src/post-refinement.c15
-rw-r--r--src/post-refinement.h2
-rw-r--r--src/rejection.c9
-rw-r--r--src/rejection.h3
5 files changed, 18 insertions, 17 deletions
diff --git a/src/partialator.c b/src/partialator.c
index 5032296f..de08df34 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -983,7 +983,7 @@ int main(int argc, char *argv[])
full = merge_intensities(crystals, n_crystals, nthreads, pmodel,
min_measurements, push_res);
- check_rejection(crystals, n_crystals, full, max_B);
+ check_rejection(crystals, n_crystals, full);
write_pgraph(full, crystals, n_crystals, 0);
@@ -999,7 +999,7 @@ int main(int argc, char *argv[])
/* Refine all crystals to get the best fit */
refine_all(crystals, n_crystals, full, nthreads, pmodel,
- no_scale, no_pr,
+ no_scale, no_pr, max_B,
&init_dev, &init_free_dev,
&init_log_dev, &init_free_log_dev,
&final_dev, &final_free_dev,
@@ -1014,7 +1014,7 @@ int main(int argc, char *argv[])
STATUS("Overall log free residual: initial = %e, final = %e\n",
init_free_log_dev, final_free_log_dev);
- check_rejection(crystals, n_crystals, full, max_B);
+ check_rejection(crystals, n_crystals, full);
normalise_scales(crystals, n_crystals);
/* Re-estimate all the full intensities */
diff --git a/src/post-refinement.c b/src/post-refinement.c
index fba301e6..9d1aa7a2 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -919,7 +919,8 @@ static void do_pr_refine(Crystal *cr, const RefList *full,
static struct prdata pr_refine(Crystal *cr, const RefList *full,
- PartialityModel pmodel, int no_scale, int no_pr)
+ PartialityModel pmodel, int no_scale, int no_pr,
+ double max_B)
{
int verbose = 0;
struct prdata prdata;
@@ -936,6 +937,12 @@ static struct prdata pr_refine(Crystal *cr, const RefList *full,
do_scale_refine(cr, full, pmodel, verbose);
}
+ /* Reject if B factor modulus is very large */
+ if ( fabs(crystal_get_Bfac(cr)) > max_B ) {
+ crystal_set_user_flag(cr, PRFLAG_BIGB);
+ return prdata;
+ }
+
if ( verbose ) {
write_residual_graph(cr, full);
}
@@ -968,6 +975,7 @@ struct refine_args
PartialityModel pmodel;
int no_scale;
int no_pr;
+ double max_B;
struct prdata prdata;
};
@@ -996,7 +1004,7 @@ static void refine_image(void *task, int id)
Crystal *cr = pargs->crystal;
pargs->prdata = pr_refine(cr, pargs->full, pargs->pmodel,
- pargs->no_scale, pargs->no_pr);
+ pargs->no_scale, pargs->no_pr, pargs->max_B);
}
@@ -1050,7 +1058,7 @@ static void done_image(void *vqargs, void *task)
void refine_all(Crystal **crystals, int n_crystals,
RefList *full, int nthreads, PartialityModel pmodel,
- int no_scale, int no_pr,
+ int no_scale, int no_pr, double max_B,
double *initial_residual, double *initial_free_residual,
double *initial_log_residual, double *initial_free_log_residual,
double *final_residual, double *final_free_residual,
@@ -1066,6 +1074,7 @@ void refine_all(Crystal **crystals, int n_crystals,
task_defaults.prdata.n_filtered = 0;
task_defaults.no_scale = no_scale;
task_defaults.no_pr = no_pr;
+ task_defaults.max_B = max_B;
task_defaults.prdata.initial_residual = 0.0;
task_defaults.prdata.initial_free_residual = 0.0;
task_defaults.prdata.initial_log_residual = 0.0;
diff --git a/src/post-refinement.h b/src/post-refinement.h
index f00a11ec..9c0f9984 100644
--- a/src/post-refinement.h
+++ b/src/post-refinement.h
@@ -76,7 +76,7 @@ extern const char *str_prflag(enum prflag flag);
extern void refine_all(Crystal **crystals, int n_crystals,
RefList *full, int nthreads, PartialityModel pmodel,
- int no_scale, int no_pr,
+ int no_scale, int no_pr, double max_B,
double *initial_residual,
double *initial_free_residual,
double *initial_log_residual,
diff --git a/src/rejection.c b/src/rejection.c
index ef185034..fbee6f72 100644
--- a/src/rejection.c
+++ b/src/rejection.c
@@ -193,7 +193,7 @@ static void show_duds(Crystal **crystals, int n_crystals)
}
-void check_rejection(Crystal **crystals, int n, RefList *full, double max_B)
+void check_rejection(Crystal **crystals, int n, RefList *full)
{
int i;
int n_acc = 0;
@@ -202,14 +202,7 @@ void check_rejection(Crystal **crystals, int n, RefList *full, double max_B)
//if ( full != NULL ) check_ccs(crystals, n, full);
for ( i=0; i<n; i++ ) {
-
- /* Reject if B factor modulus is very large */
- if ( fabs(crystal_get_Bfac(crystals[i])) > max_B ) {
- crystal_set_user_flag(crystals[i], PRFLAG_BIGB);
- }
-
if ( crystal_get_user_flag(crystals[i]) == 0 ) n_acc++;
-
}
show_duds(crystals, n);
diff --git a/src/rejection.h b/src/rejection.h
index 8979313b..ec529941 100644
--- a/src/rejection.h
+++ b/src/rejection.h
@@ -38,7 +38,6 @@
#include "crystal.h"
extern void early_rejection(Crystal **crystals, int n);
-extern void check_rejection(Crystal **crystals, int n, RefList *full,
- double max_B);
+extern void check_rejection(Crystal **crystals, int n, RefList *full);
#endif /* REJECTION_H */