From 2473e03cf76c48f1ae2bef23d41e43349119f795 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 3 Aug 2026 22:07:58 +0200 Subject: [PATCH] rugnux: default --spot-sigma to 4.0, the value the viewer already uses The two front ends disagreed on the fixed-threshold spot finder: rugnux started from 3.0, jfjoch_viewer from the SpotFindingSettings default of 4.0, so the same file processed either way could give different spots. Inert on the default path - the adaptive finder derives its threshold from each image's own per-resolution-ring noise and never reads signal_to_noise_threshold (only ImageSpotFinderCPU/GPU and DetModuleSpotFinder do). It changes behaviour only under --no-adaptive-spots, and there it now matches the viewer. Co-Authored-By: Claude Opus 5 (1M context) --- docs/RUGNUX.md | 2 +- rugnux/rugnux_cli.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/RUGNUX.md b/docs/RUGNUX.md index 9e66da96..0a6fe4df 100644 --- a/docs/RUGNUX.md +++ b/docs/RUGNUX.md @@ -202,7 +202,7 @@ Spot finding: | Option | Description | | --- | --- | -| `--spot-sigma ` | Noise sigma level for spot finding (default: 3.0) | +| `--spot-sigma ` | Noise sigma level for spot finding (default: 4.0) | | `--spot-threshold ` | Photon-count threshold for spot finding (default: 10) | | `--adaptive-spots` | Self-calibrating detection (**default**, stills and rotation alike): 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) | | `--no-adaptive-spots` | Turn adaptive detection off and use the fixed `--spot-threshold` / `--spot-sigma` finder | diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index 78ad2594..71c3a34b 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -61,7 +61,7 @@ void print_usage() { std::cout << std::endl; std::cout << " Spot finding" << std::endl; - std::cout << " --spot-sigma Noise sigma level for spot finding (default: 3.0)" << std::endl; + std::cout << " --spot-sigma Noise sigma level for spot finding (default: 4.0)" << std::endl; std::cout << " --spot-threshold Photon count threshold for spot finding (default: 10)" << std::endl; std::cout << " --min-pix-per-spot Minimum connected strong pixels per spot. If omitted, min-pix is chosen PER IMAGE (stills indexing): the frame is indexed at min-pix 3/2/1 and the one maximising indexed count x indexed fraction is kept. Give an explicit value to force a fixed min-pix instead." << std::endl; 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; @@ -528,7 +528,7 @@ static int RunRugnux(int argc, char **argv) { std::optional space_group_number; std::optional fixed_reference_unit_cell; std::optional max_spot_count_override; - float sigma_spot_finding = 3.0; + float sigma_spot_finding = 4.0; int64_t photon_count_threshold_spot_finding = 10; std::optional min_pix_per_spot; // unset -> adaptive per image; a value -> fixed min-pix std::optional adaptive_spots; // unset -> on, for both workflows