Add opt-in local-SNR spot gate and acceptance-fraction knob (serial stills)

Two opt-in tools for weak serial-stills tuning; both default-off, so the
default pipeline is bit-identical (verified: a serial-stills reference run
reproduces HEAD's 7.85% indexing rate exactly).

--local-snr <sigma> (AdaptiveSpotFinderCPU::FilterByLocalSNR): after the loose
per-ring adaptive threshold builds connected-component spots, drop any spot that
does not stand this many sigmas above its OWN LOCAL background (robust median/MAD
of a square annulus), not just the azimuthal ring mean. On structured-background
(XFEL) frames the ring mean underestimates the local diffuse level in some
sectors, so the ring threshold floods; a real Bragg peak still stands many local
sigmas proud. Validated on XFEL stills to separate real peaks from flood at the
pixel level (real median local-SNR ~70 vs flood ~2.6; SNR>=5 keeps ~99.8% of
real peaks, ~14% of flood). GPU-portable (a per-spot local reduction). NOTE: on
the current serial-stills battery it is index-rate/CC1/2 neutral -- the flood that
survives as CC clusters overlaps weak-real spots, and only lattice-fit separates
those -- but it is the correct tool for genuinely floody data (ice/jet/loosened
detector) and the right substrate for the online FPGA path.

--min-indexed-fraction <f>: exposes the previously hardcoded 0.20 minimum
indexed-spot fraction (AnalyzeIndexing) as a per-run setting. Lowering it admits
weaker/sparser crystals; on flooded XFEL data the extra lattices are spurious
(pair with --min-image-cc to gate them), on clean synchrotron data there are no
marginal frames so it is a no-op -- useful as a gating-experiment primitive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-24 11:12:22 +02:00
co-authored by Claude Opus 4.8
parent 503bd36738
commit ca7cbe206a
9 changed files with 107 additions and 3 deletions
+9
View File
@@ -28,6 +28,15 @@ int64_t IndexingSettings::GetViableCellMinSpots() const {
return viable_cell_min_spots;
}
IndexingSettings &IndexingSettings::MinIndexedSpotFraction(float input) {
min_indexed_spot_fraction = input;
return *this;
}
float IndexingSettings::GetMinIndexedSpotFraction() const {
return min_indexed_spot_fraction;
}
IndexingSettings &IndexingSettings::Algorithm(IndexingAlgorithmEnum input) {
switch (input) {
case IndexingAlgorithmEnum::Auto: