diff options
author | Yaroslav Gevorkov <yaroslav.gevorkov@desy.de> | 2019-11-08 18:22:57 +0100 |
---|---|---|
committer | Yaroslav Gevorkov <yaroslav.gevorkov@desy.de> | 2019-11-13 14:11:58 +0100 |
commit | cf9651d68e04970063762d17f95814942f0518b5 (patch) | |
tree | 2f9c533a44cea9845d241afd6ecd6c0ccfd98f93 | |
parent | 095bd6bb86b893c61a238f343765d04d3fb038a4 (diff) |
add option --pinkIndexer-override-visible-energy-range
-rw-r--r-- | libcrystfel/src/pinkindexer.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libcrystfel/src/pinkindexer.c b/libcrystfel/src/pinkindexer.c index caa91762..8736e75d 100644 --- a/libcrystfel/src/pinkindexer.c +++ b/libcrystfel/src/pinkindexer.c @@ -404,16 +404,21 @@ static void show_help() " Disable internal check for correct indexing\n" " solutions\n" " --pinkIndexer-override-photon-energy\n" -" Mean wavelength in A to use for indexing.\n" +" Mean energy in eV to use for indexing.\n" " --pinkIndexer-override-bandwidth\n" -" Bandwidth in (delta lambda)/(lambda) to use for indexing.\n" +" Bandwidth in (delta energy)/(mean energy) to use for indexing.\n" +" --pinkIndexer-override-visible-energy-range=n1-n2\n" +" Overrides photon energy and bandwidth according to a range of \n" +" energies that have high enough intensity to produce \"visible\" \n" +" Bragg spots on the detector.\n" +" Lower and higher range are separated by a minus sign (no whitespace).\n" ); } static error_t parse_arg(int key, char *arg, struct argp_state *state) { - float tmp; + float tmp, tmp2; struct pinkIndexer_options **opts_ptr = state->input; switch ( key ) { @@ -522,6 +527,18 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state) return EINVAL; } break; + case 13 : + if (sscanf(arg, "%f-%f", &tmp, &tmp2) != 2) + { + ERROR("Invalid value for --pinkIndexer-override-visible-energy-range\n"); + return EINVAL; + } + (*opts_ptr)->overridenPhotonEnergy = (tmp + tmp2)/2; + (*opts_ptr)->overridenBandwidth = (tmp2 - tmp)/(*opts_ptr)->overridenPhotonEnergy; + if((*opts_ptr)->overridenBandwidth < 0){ + (*opts_ptr)->overridenBandwidth *= -1; + } + break; } return 0; @@ -561,6 +578,8 @@ static struct argp_option options[] = { {"pinkIndexer-override-bandwidth", 12, "overridenBandwidth", OPTION_HIDDEN, NULL}, + {"pinkIndexer-override-visible-energy-range", 13, "overridenVisibleEnergyRange", OPTION_HIDDEN, NULL}, + {0} }; |