Orateur
Description
We present a new AreaDetector plugin that performs fast, robust 2D beam characterization using nonlinear least squares fitting, designed for beam diagnostics and focusing. The plugin fits flexible beam models (elliptical and rotated Gaussian, with optional Voigt-like extensions) directly on camera images and exposes key beam parameters such as centroid, widths, rotation, amplitude, and background, together with statistically meaningful uncertainties derived from covariance estimation. In addition, the framework is designed to be extended with a Kalman-filter–based prediction layer, which will provide warm-start initial conditions and fuse sequential measurements into a smooth beam-state estimate, improving robustness in continuous scans and mitigating noise and short-timescale jitter. The plugin already computes goodness-of-fit metrics and residual maps, enabling automated assessment of beam quality and the detection of non-Gaussian features and aberrations. Integrated as an AreaDetector component, it can run in (near) real time, stream results via EPICS, and serve as a “smart sensor” for higher-level alignment and optimization algorithms (e.g. gradient-based, simplex, or Bayesian optimization). This architecture turns raw camera images into reliable, uncertainty-aware beam descriptors that can be directly consumed by automated commissioning workflows and beamline control scripts, providing a practical path toward more stable, faster, and quantitatively transparent beam alignment and focus adjustment.