Build Packages / build:viewer-tgz:cpu (push) Successful in 19m32s
Build Packages / build:windows:nocuda (push) Successful in 19m57s
Build Packages / build:viewer-tgz:cuda (push) Successful in 22m45s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 22m38s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 23m24s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 28m8s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 28m9s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 28m18s
Build Packages / XDS test (durin plugin) (push) Successful in 11m10s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 20m21s
Build Packages / build:windows:cuda (push) Successful in 22m5s
Build Packages / build:rpm (rocky9) (push) Successful in 20m57s
Build Packages / Generate python client (push) Successful in 34s
Build Packages / Build documentation (push) Successful in 1m29s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (ubuntu2204) (push) Successful in 25m41s
Build Packages / DIALS test (push) Successful in 21m19s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 21m34s
Build Packages / build:rpm (rocky8) (push) Successful in 27m4s
Build Packages / XDS test (neggia plugin) (push) Successful in 10m19s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 10m58s
Build Packages / Unit tests (push) Successful in 1h17m36s
Image buffer: the per-image CBOR metadata headroom had been re-derived from the online reflection cap alone, which cut it from 4 MiB to 2.55 MB while the measured worst case - reflections plus the capped spot list plus the three azimuthal arrays - is 2.9 MB, so the receiver dropped the frames with the most to say. Restore it and give it a name that both the code and its guard test read: written down twice, the two had drifted and the test kept passing against the value the code had left. Spot finding: an unset low_resolution_limit means no limit at that end, as an unset high_resolution_limit already did. An optional rather than a zero sentinel, because zero is not a natural "no limit" here - every pixel lies above it, so the plain comparison masked the whole image instead of none of it, and nothing validated the zero. The API field is no longer required; a zero is folded into the unset case at the boundary, where older clients still send it, so one spelling reaches the analysis code. The FPGA takes its fixed-point ceiling instead, since ap_ufixed<16,9> wraps above 512 A and would have masked everything. image_preprocessing: check the CUDA calls on the fused decode path - the one new GPU file with none, and the path fed by bytes we did not produce. An unchecked synchronise returned the host-written sentinel as if it were a measurement, so the decode looked successful and the fallback to the host decoder never fired. rugnux: --stride no longer writes one past the end of the per-image arrays, whose count floored where the worker loop ceils, and the written process file links the images actually processed rather than the first N - each frame's picture now sits next to its own analysis. Powder calibration: the face-centred calibrants no longer list their systematically absent rings, so the distance fit starts from a reflection that exists rather than an extinct one; the triclinic calibrant covers both signs of h and k instead of a single octant, which is only valid for a diagonal metric. The test asserted the old behaviour - one ring formula for every cubic standard - and is rewritten. CBOR: skip an unknown tagged value in the end block, as the other four blocks already do. One advance lands on the tagged item rather than past it, so an older reader fed a newer end message threw and never finalized its file. Viewer: a settings value the setter rejects no longer escapes as an uncaught throw from a worker slot, and the field offers only what the setter accepts. Space-group search: judge stage B on the same "present" cut stage A already computes. Merged sigma is floored so no reflection reads above ISa, so on a low-ISa merge the fixed cut left both stage B tests unsatisfiable - every screw axis passed unchallenged and the centering rescue switched itself off on exactly the weak data it exists for. Where the fixed cut is the smaller of the two they are equal and this is inert: over the 37-crystal rotation battery every crystal reports the identical space group and identical merge statistics, so it is a no-op there and the low-ISa case it targets remains unmeasured. rugnux: --polarization reaches --mode azint, which parsed the flag and then dropped it; that mode also applies the same polarization default as every other mode. Acknowledge the ACTS/traccc project, whose sparse connected-component labelling both spot extractors take their algorithm from, with its citation and its license. The rc.161 change list is brought back to one line per entry, and the user-visible changes that were missing from it added. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
47 lines
2.7 KiB
C++
47 lines
2.7 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <cstdint>
|
|
|
|
struct SpotFindingSettings {
|
|
bool enable = true;
|
|
float signal_to_noise_threshold = 4.0; // STRONG_PIXEL in XDS
|
|
int64_t photon_count_threshold = 10; // Threshold in photon counts
|
|
// Minimum connected pixels per spot. std::nullopt = choose it per image: on the stills indexing
|
|
// path the frame is indexed at min-pix 3/2/1 and the one maximising indexed count x indexed fraction
|
|
// is kept (see MXAnalysisWithoutFPGA::Analyze); a value fixes it. Defaults to a concrete value, so
|
|
// the online receiver and the FPGA path keep the single-pass fixed behaviour unless set otherwise.
|
|
std::optional<int64_t> min_pix_per_spot = 2;
|
|
int64_t max_pix_per_spot = 50; // Maximum pixels per spot
|
|
// High-resolution limit for spot finding [A]. std::nullopt = as far as the detector reaches, i.e. no
|
|
// resolution clipping of the detection at all (DiffractionExperiment::GetDetectorMaxResolution_A
|
|
// supplies the number where one is needed, e.g. for the spot plot's shells).
|
|
std::optional<float> high_resolution_limit;
|
|
// Low-resolution limit for spot finding [A]. std::nullopt = no limit at the low-resolution end, the
|
|
// mirror of high_resolution_limit above. Optional rather than a zero sentinel because zero is not a
|
|
// natural "no limit" here: every pixel has d above it, so the plain comparison would mask the whole
|
|
// image rather than none of it. Defaults to a concrete value, which is where the detection normally
|
|
// stops - the direct beam and its halo sit beyond it.
|
|
std::optional<float> low_resolution_limit = 50.0;
|
|
float cutoff_spot_count_low_res = 5.0;
|
|
std::optional<float> high_res_gap_Q_recipA = 1.5; // 0.25 * 2 * pi
|
|
|
|
// Half-width of the ice-ring exclusion band in q (2*pi/d). Measured hexagonal-ice ring FWHM on the
|
|
// JUNGFRAU is ~0.06 q, so the band half-width is ~0.03; 0.02 under-covered the strong low-res rings.
|
|
float ice_ring_width_Q_recipA = 0.03;
|
|
|
|
bool indexing = true;
|
|
bool quick_integration = true;
|
|
|
|
// Self-calibrating detection (offline/rugnux path): when true, the fixed photon_count_threshold is
|
|
// replaced by a per-resolution-ring threshold set from the image's own noise (see
|
|
// AdaptiveSpotFinderCPU), so the same setting adapts across datasets with no per-dataset tuning.
|
|
// false_pixels_per_frame is the one portable knob: the expected number of noise pixels tolerated
|
|
// per frame (the threshold's operating point), ~100 for a multi-megapixel detector.
|
|
bool adaptive_threshold = false;
|
|
float false_pixels_per_frame = 100.0f;
|
|
};
|