From 515720440f2af4fbd0fd3fe7637b0190a810ebde Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 16 Mar 2021 13:07:03 +0100 Subject: get_hkl: Fix logic for loading unit cell --- src/get_hkl.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/get_hkl.c') diff --git a/src/get_hkl.c b/src/get_hkl.c index ed3d7c39..71de316d 100644 --- a/src/get_hkl.c +++ b/src/get_hkl.c @@ -797,24 +797,25 @@ int main(int argc, char *argv[]) } - if ( (highres < INFINITY) || have_cutoff_aniso || (lowres > 0.0) ) { - - if ( cellfile == NULL ) { - ERROR("You must provide a unit cell when using " - "--cutoff-angstroms, --highres or --lowres.\n"); - return 1; - } - + if ( cellfile != NULL ) { cell = load_cell_from_file(cellfile); if ( cell == NULL ) { ERROR("Failed to load cell from '%s'\n", cellfile); return 1; } free(cellfile); - } - input = apply_resolution_cutoff(input, lowres, highres, cell); + if ( (highres < INFINITY) || (lowres > 0.0) ) { + if ( cell == NULL ) { + ERROR("You must provide a unit cell when using " + "--highres or --lowres\n"); + return 1; + } else { + input = apply_resolution_cutoff(input, lowres, highres, + cell); + } + } if ( have_cutoff_aniso ) { @@ -826,6 +827,12 @@ int main(int argc, char *argv[]) double csx, csy, csz; double as, bs, cs; + if ( cell == NULL ) { + ERROR("You must provide a unit cell when using " + "--cutoff-angstroms\n"); + return 1; + } + cell_get_reciprocal(cell, &asx, &asy, &asz, &bsx, &bsy, &bsz, &csx, &csy, &csz); -- cgit v1.2.3