// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include #include "../../common/SpotToSave.h" std::optional FitProfileRadius_MAD(const std::vector& spots); // Intrinsic excitation-error (mosaicity+divergence) width from the indexed-spot spread. When a finite // energy bandwidth is given, its radial smear (bandwidth_sigma*lambda/(2 d^2)) is deconvolved out, so // the result is the intrinsic width and bandwidth is not double-counted by prediction (which re-adds // it). bandwidth_sigma = 0 reproduces the plain RMS (monochromatic / rotation). std::optional FitProfileRadius(const std::vector& spots, float bandwidth_sigma = 0.0f, float wavelength_A = 0.0f);