diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/partialator.c | 20 | ||||
-rw-r--r-- | src/rejection.c | 4 | ||||
-rw-r--r-- | src/rejection.h | 3 |
3 files changed, 21 insertions, 6 deletions
diff --git a/src/partialator.c b/src/partialator.c index d6606ef4..079d4d46 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -310,7 +310,8 @@ static void show_help(const char *s) " --push-res=<n> Merge higher than apparent resolution cutoff.\n" " -j <n> Run <n> analyses in parallel.\n" " --no-free Disable cross-validation (testing only).\n" -" --custom-split List of files for custom dataset splitting.\n"); +" --custom-split List of files for custom dataset splitting.\n" +" --max-rel-B Maximum allowable relative |B| factor.\n"); } @@ -620,6 +621,7 @@ int main(int argc, char *argv[]) int no_free = 0; char *csplit_fn = NULL; struct custom_split *csplit = NULL; + double max_B = 1e-18; /* Long options */ const struct option longopts[] = { @@ -640,6 +642,8 @@ int main(int argc, char *argv[]) {"push-res", 1, NULL, 5}, {"res-push", 1, NULL, 5}, /* compat */ {"custom-split", 1, NULL, 6}, + {"max-rel-B" , 1, NULL, 7}, + {"max-rel-b" , 1, NULL, 7}, /* compat */ {"no-scale", 0, &no_scale, 1}, {"no-pr", 0, &no_pr, 1}, @@ -754,6 +758,16 @@ int main(int argc, char *argv[]) csplit_fn = strdup(optarg); break; + case 7 : + errno = 0; + max_B = strtod(optarg, &rval); + if ( *rval != '\0' ) { + ERROR("Invalid value for --max-rel-B.\n"); + return 1; + } + max_B = max_B * 1e-20; + break; + case 0 : break; @@ -969,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); + check_rejection(crystals, n_crystals, full, max_B); write_pgraph(full, crystals, n_crystals, 0); @@ -991,7 +1005,7 @@ int main(int argc, char *argv[]) STATUS("Overall free residual: initial = %e, final = %e\n", init_free_dev, final_free_dev); - check_rejection(crystals, n_crystals, full); + check_rejection(crystals, n_crystals, full, max_B); normalise_scales(crystals, n_crystals); /* Re-estimate all the full intensities */ diff --git a/src/rejection.c b/src/rejection.c index cea43701..ef185034 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) +void check_rejection(Crystal **crystals, int n, RefList *full, double max_B) { int i; int n_acc = 0; @@ -204,7 +204,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])) > max_B ) { crystal_set_user_flag(crystals[i], PRFLAG_BIGB); } 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 */ |