// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include "../common/Reflection.h" #include "../common/CrystalLattice.h" #include "../common/DiffractionGeometry.h" struct IntegrationOutcome { DiffractionGeometry geom; CrystalLattice latt; std::vector reflections; std::optional mosaicity_deg; std::optional image_scale_cc; std::optional image_scale_cc_n; std::optional image_scale_g; std::optional image_scale_wedge_deg; }; // How far apart, in frames, two partials of one raw hkl may sit and still belong to the same rocking // event. The quantity being bridged is an ANGLE - a reflecting range, a tenth to half a degree - so // spelling it as a frame count makes the bridge grow with the slicing: at 1 deg per frame the two // frames that were always allowed are 2 deg of dead rotation, as wide as a whole event, and two // genuine Ewald crossings fuse into one "full". Half a degree of bridge instead, floored at one frame // (never cut an event at its own neighbours) and capped at the two frames that were always used. For // any wedge of 0.25 deg or less the quotient is at least two and the cap returns the literal 2.0f, so // finely sliced data is bridged exactly as before. inline float RockingEventFrameGap(float wedge_deg) { return std::min(2.0f, std::max(1.0f, 0.5f / wedge_deg)); }