From 4cae1180965b83cfabb1e603bd64245f73b43067 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 24 Feb 2010 11:53:20 +0100 Subject: Handle missing molecule.pdb a little better (can do better still, though) --- src/process_hkl.c | 4 +++- src/reflections.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/process_hkl.c b/src/process_hkl.c index 12427a1a..abb4422f 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -337,7 +337,9 @@ int main(int argc, char *argv[]) } if ( output != NULL ) { - write_reflections(output, counts, ref, 0, mol->cell); + UnitCell *cell = NULL; + if ( mol != NULL ) cell = mol->cell; + write_reflections(output, counts, ref, 0, cell); } STATUS("There were %u patterns.\n", n_patterns); diff --git a/src/reflections.c b/src/reflections.c index c9d83710..93cecca9 100644 --- a/src/reflections.c +++ b/src/reflections.c @@ -64,7 +64,11 @@ void write_reflections(const char *filename, unsigned int *counts, F = lookup_intensity(ref, h, k, l) / N; if ( zone_axis && (l != 0) ) continue; - s = 2.0*resolution(cell, h, k, l); + if ( cell != NULL ) { + s = 2.0*resolution(cell, h, k, l); + } else { + s = 0.0; + } /* h, k, l, I, sigma(I), s */ fprintf(fh, "%3i %3i %3i %f %f %f\n", h, k, l, F, 0.0, s/1.0e9); -- cgit v1.2.3