aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/merge.c9
-rw-r--r--src/merge.h2
-rw-r--r--src/partialator.c10
3 files changed, 14 insertions, 7 deletions
diff --git a/src/merge.c b/src/merge.c
index 9ff64b57..4f2fa9a9 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -61,6 +61,7 @@ struct merge_queue_args
int n_started;
PartialityModel pmodel;
double push_res;
+ int use_weak;
};
@@ -114,6 +115,11 @@ static void run_merge_job(void *vwargs, int cookie)
if ( get_partiality(refl) < MIN_PART_MERGE ) continue;
+ if ( !wargs->qargs->use_weak
+ && (get_intensity(refl) < 3.0*get_esd_intensity(refl)) ) {
+ continue;
+ }
+
get_indices(refl, &h, &k, &l);
pthread_rwlock_rdlock(&wargs->qargs->full_lock);
f = find_refl(full, h, k, l);
@@ -197,7 +203,7 @@ static void finalise_merge_job(void *vqargs, void *vwargs)
RefList *merge_intensities(Crystal **crystals, int n, int n_threads,
PartialityModel pmodel, int min_meas,
- double push_res)
+ double push_res, int use_weak)
{
RefList *full;
RefList *full2;
@@ -217,6 +223,7 @@ RefList *merge_intensities(Crystal **crystals, int n, int n_threads,
qargs.crystals = crystals;
qargs.pmodel = pmodel;
qargs.push_res = push_res;
+ qargs.use_weak = use_weak;
pthread_rwlock_init(&qargs.full_lock, NULL);
run_threads(n_threads, run_merge_job, create_merge_job,
diff --git a/src/merge.h b/src/merge.h
index b8af63b8..1911584f 100644
--- a/src/merge.h
+++ b/src/merge.h
@@ -41,6 +41,6 @@
extern RefList *merge_intensities(Crystal **crystals, int n, int n_threads,
PartialityModel pmodel, int min_meas,
- double push_res);
+ double push_res, int use_weak);
#endif /* MERGE */
diff --git a/src/partialator.c b/src/partialator.c
index 81c5ab37..26c72696 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -189,13 +189,13 @@ static void write_split(Crystal **crystals, int n_crystals, const char *outfile,
}
snprintf(tmp, 1024, "%s1", outfile);
split = merge_intensities(crystals1, n_crystals1, nthreads,
- pmodel, min_measurements, push_res);
+ pmodel, min_measurements, push_res, 1);
STATUS("Writing two-way split to %s ", tmp);
write_reflist_2(tmp, split, sym);
reflist_free(split);
snprintf(tmp, 1024, "%s2", outfile);
split = merge_intensities(crystals2, n_crystals2, nthreads,
- pmodel, min_measurements, push_res);
+ pmodel, min_measurements, push_res, 1);
STATUS("and %s\n", tmp);
write_reflist_2(tmp, split, sym);
reflist_free(split);
@@ -276,7 +276,7 @@ static void write_custom_split(struct custom_split *csplit, int dsn,
STATUS("Writing dataset '%s' to %s (%i crystals)\n",
csplit->dataset_names[dsn], tmp, n_crystalsn);
split = merge_intensities(crystalsn, n_crystalsn, nthreads,
- pmodel, min_measurements, push_res);
+ pmodel, min_measurements, push_res, 1);
write_reflist_2(tmp, split, sym);
reflist_free(split);
@@ -995,7 +995,7 @@ int main(int argc, char *argv[])
/* Make initial estimates */
full = merge_intensities(crystals, n_crystals, nthreads, pmodel,
- min_measurements, push_res);
+ min_measurements, push_res, 1);
check_rejection(crystals, n_crystals, full);
@@ -1020,7 +1020,7 @@ int main(int argc, char *argv[])
/* Re-estimate all the full intensities */
reflist_free(full);
full = merge_intensities(crystals, n_crystals, nthreads,
- pmodel, min_measurements, push_res);
+ pmodel, min_measurements, push_res, 1);
write_pgraph(full, crystals, n_crystals, i+1);