From fb42533ca6f9077c6b1a03ad9cc76d73a53fb9f1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 20 Nov 2009 15:15:02 +0100 Subject: Tidy up and fix --- src/diffraction.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/diffraction.c') diff --git a/src/diffraction.c b/src/diffraction.c index 87f2a5f7..6bb48332 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -129,7 +129,7 @@ static double complex water_factor(struct threevec q, double en) /* Density of water molecules */ molecules_per_m3 = WATER_DENSITY * (AVOGADRO / WATER_MOLAR_MASS); - + /* Number of water molecules per slice */ molecules_per_m = (2*rb*2*rc) * molecules_per_m3 / N_WATER_SLICES; @@ -168,8 +168,11 @@ void get_diffraction(struct image *image, UnitCell *cell) /* Generate the array of reciprocal space vectors in image->qvecs */ get_ewald(image); - image->molecule = load_molecule(); - if ( image->molecule == NULL ) return; + + if ( image->molecule == NULL ) { + image->molecule = load_molecule(); + if ( image->molecule == NULL ) return; + } cell_get_cartesian(cell, &ax, &ay, &az, &bx, &by, &bz, -- cgit v1.2.3