// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include // A frame's background as a function of q, from a peak-excluded background per resolution ring of the // whole detector (the adaptive spot finder's GetRingBackground): ring i holds low_q + (i + 0.5) * dq, // entries past the first q_bins are further azimuthal bins and are averaged in, and a ring with no // value (NAN) is bridged by its neighbours. Between rings the value is interpolated linearly; beyond // the first and the last ring the end value is held, which has no curvature. struct RingBackground { std::vector q, b; RingBackground(const std::vector &ring_bkg, int32_t q_bins, float low_q, float dq); [[nodiscard]] bool empty() const { return q.size() < 2; } [[nodiscard]] double At(double q_recipA) const; };