aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-16 13:07:03 +0100
committerThomas White <taw@physics.org>2021-03-16 14:12:09 +0100
commit515720440f2af4fbd0fd3fe7637b0190a810ebde (patch)
tree975043f4e901cd5a11eaa4e810f4f4378e5b6184 /src
parente6c26cfd40f0a372a530380ec8b7817645265681 (diff)
get_hkl: Fix logic for loading unit cell
Diffstat (limited to 'src')
-rw-r--r--src/get_hkl.c27
1 files changed, 17 insertions, 10 deletions
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);