diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index bfdc3224..bc138536 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -69,7 +69,7 @@ void print_usage() { std::cout << " --adaptive-spots Self-calibrating detection (DEFAULT): the strong-pixel threshold comes from each image's own per-resolution-ring noise instead of the fixed --spot-threshold, so one setting adapts across datasets (no per-dataset --spot-threshold/--spot-sigma tuning)." << std::endl; std::cout << " --no-adaptive-spots Turn adaptive detection off and use the fixed --spot-threshold / --spot-sigma finder instead" << std::endl; std::cout << " --spot-false-pixels Adaptive detection operating point: expected noise pixels tolerated per frame (default: 100; implies --adaptive-spots)" << std::endl; - std::cout << " --spot-high-resolution High resolution limit for spot finding. If omitted, stills extend as far as the detector reaches (no resolution clipping) and rotation data keeps a 1.5 A limit." << std::endl; + std::cout << " --spot-high-resolution High resolution limit for spot finding. If omitted, stills extend as far as the detector reaches (no resolution clipping) and rotation data keeps a 1.5 A limit; give 0 for no limit on either." << std::endl; std::cout << " --spot-low-resolution Low resolution limit for spot finding, in A (default: 50; lower it, e.g. 24, to exclude the direct-beam halo on weakly-diffracting serial data)" << std::endl; std::cout << " --max-spots Max spot count (default: 250)" << std::endl; std::cout << " --detect-ice-rings[=on|off] Flag ice-ring spots (de-prioritised in indexing) and exclude ice-ring reflections from scaling/merging; overrides the dataset/master-file setting (default: use dataset value)" << std::endl; @@ -542,6 +542,9 @@ int main(int argc, char **argv) { GeomRefinementAlgorithmEnum refinement_algorithm = GeomRefinementAlgorithmEnum::BeamCenter; std::optional d_min_spot_finding; // unset -> as far as the detector reaches + // Whether --spot-high-resolution was given at all. Unset covers two different requests - "the user + // said nothing", where rotation applies its own default, and "the user asked for no limit". + bool d_min_spot_finding_given = false; float d_max_spot_finding = 0; // 0 = keep the SpotFindingSettings default (50 A) std::optional d_min_scale_merge; std::optional resolution_cutoff_method; // --resolution-cutoff cc-logistic|off @@ -769,6 +772,7 @@ int main(int argc, char **argv) { // optional the rest of the code understands. Passing the 0 through instead reached // ResolutionShells (via the spot plot), which rejects a zero d_min and threw away every image. const auto d_min = parse_number_arg(optarg, "--spot-high-resolution", logger, 0.0f); + d_min_spot_finding_given = true; if (d_min > 0.0f) { d_min_spot_finding = d_min; logger.Info("High resolution limit for spot finding set to {:.2f} A", d_min); @@ -1504,7 +1508,7 @@ int main(int argc, char **argv) { spot_settings.min_pix_per_spot = min_pix_per_spot; if (rotation_indexing && !spot_settings.min_pix_per_spot.has_value()) spot_settings.min_pix_per_spot = 2; - if (rotation_indexing && !d_min_spot_finding.has_value()) + if (rotation_indexing && !d_min_spot_finding.has_value() && !d_min_spot_finding_given) d_min_spot_finding = 1.5f; spot_settings.adaptive_threshold = adaptive_spots.value_or(true); spot_settings.high_resolution_limit = d_min_spot_finding;