From 9674c801f9eae6a807ecaf12b119aa3f6ee6fd77 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 3 Mar 2017 11:45:03 +0100 Subject: partialator: Better handling of very small number of crystals --- src/merge.c | 5 +---- src/partialator.c | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/merge.c b/src/merge.c index 8d1fae0f..9734c469 100644 --- a/src/merge.c +++ b/src/merge.c @@ -237,10 +237,7 @@ RefList *merge_intensities(Crystal **crystals, int n, int n_threads, Reflection *refl; RefListIterator *iter; - if ( n == 0 ) { - ERROR("No crystals!\n"); - return NULL; - } + if ( n == 0 ) return NULL; full = reflist_new(); diff --git a/src/partialator.c b/src/partialator.c index 09feebb4..569145e8 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -191,6 +191,12 @@ 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, 1); + + if ( split == NULL ) { + ERROR("Not enough crystals for two way split!\n"); + return; + } + STATUS("Writing two-way split to %s ", tmp); write_reflist_2(tmp, split, sym); reflist_free(split); -- cgit v1.2.3