diff options
author | Thomas White <taw@physics.org> | 2014-04-08 15:17:47 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-04-08 15:17:47 +0200 |
commit | b4fdd6e5244eae54ba0ebd98be3946b08c3431f8 (patch) | |
tree | ba4ff4b2c058888a72ebe0513fd918249f051dc4 | |
parent | 1ac35ea6f23464d55fffd36cca4a4b2c745252ec (diff) |
compare_hkl: Add --highres and --lowres
-rw-r--r-- | src/compare_hkl.c | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c index ab7b821c..d2173aff 100644 --- a/src/compare_hkl.c +++ b/src/compare_hkl.c @@ -3,11 +3,11 @@ * * Compare reflection lists * - * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: - * 2010-2013 Thomas White <taw@physics.org> + * 2010-2014 Thomas White <taw@physics.org> * 2013 Lorenzo Galli <lorenzo.galli@desy.de> * * This file is part of CrystFEL. @@ -102,8 +102,10 @@ static void show_help(const char *s) " --ignore-negs Ignore reflections with negative intensities.\n" " --zero-negs Set negative intensities to zero.\n" " --sigma-cutoff=<n> Discard reflections with I/sigma(I) < n.\n" -" --rmin=<res> Set a lower resolution limit (m^-1).\n" -" --rmax=<res> Set an upper resolution limit (m^-1).\n" +" --rmin=<res> Low resolution cutoff (1/d in m^-1).\n" +" --rmax=<res> High resolution cutoff (1/d in m^-1).\n" +" --lowres=<n> Low resolution cutoff in (d in A).\n" +" --highres=<n> High resolution cutoff in (d in A).\n" " --intensity-shells Use shells of intensity instead of resolution.\n" "\n" " -h, --help Display this help message.\n" @@ -875,6 +877,28 @@ static void do_fom(RefList *list1, RefList *list2, UnitCell *cell, } +static void check_highres() +{ + static int have = 0; + if ( have ) { + ERROR("You cannot use --rmax and --highres at the same time.\n"); + exit(1); + } + have = 1; +} + + +static void check_lowres() +{ + static int have = 0; + if ( have ) { + ERROR("You cannot use --rmin and --lowres at the same time.\n"); + exit(1); + } + have = 1; +} + + int main(int argc, char *argv[]) { int c; @@ -906,6 +930,7 @@ int main(int argc, char *argv[]) char *shell_file = NULL; double min_I = +INFINITY; double max_I = -INFINITY; + float highres, lowres; /* Long options */ const struct option longopts[] = { @@ -918,6 +943,8 @@ int main(int argc, char *argv[]) {"sigma-cutoff", 1, NULL, 5}, {"nshells", 1, NULL, 6}, {"shell-file", 1, NULL, 7}, + {"highres", 1, NULL, 8}, + {"lowres", 1, NULL, 9}, {"ignore-negs", 0, &config_ignorenegs, 1}, {"zero-negs", 0, &config_zeronegs, 1}, {"intensity-shells", 0, &config_intshells, 1}, @@ -951,6 +978,7 @@ int main(int argc, char *argv[]) break; case 2 : + check_lowres(); if ( sscanf(optarg, "%e", &rmin_fix) != 1 ) { ERROR("Invalid value for --rmin\n"); return 1; @@ -958,6 +986,7 @@ int main(int argc, char *argv[]) break; case 3 : + check_highres(); if ( sscanf(optarg, "%e", &rmax_fix) != 1 ) { ERROR("Invalid value for --rmax\n"); return 1; @@ -986,6 +1015,24 @@ int main(int argc, char *argv[]) shell_file = strdup(optarg); break; + case 8 : + check_highres(); + if ( sscanf(optarg, "%e", &highres) != 1 ) { + ERROR("Invalid value for --highres\n"); + return 1; + } + rmax_fix = 1.0 / (highres/1e10); + break; + + case 9 : + check_lowres(); + if ( sscanf(optarg, "%e", &lowres) != 1 ) { + ERROR("Invalid value for --lowres\n"); + return 1; + } + rmin_fix = 1.0 / (lowres/1e10); + break; + case '?' : break; |