aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-03 11:45:03 +0100
committerThomas White <taw@physics.org>2017-03-03 11:46:04 +0100
commit9674c801f9eae6a807ecaf12b119aa3f6ee6fd77 (patch)
tree1036fe6d2e4cb8b89e74e5b8b797d36931762bed /src
parent81bbf308d43c5f74ce1e550eba1652a47b6d2841 (diff)
partialator: Better handling of very small number of crystals
Diffstat (limited to 'src')
-rw-r--r--src/merge.c5
-rw-r--r--src/partialator.c6
2 files changed, 7 insertions, 4 deletions
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);