Declarative Parameter Management for Automated Beamline Data Analysis: The Spice Concept
Automated data analysis at synchrotron beamlines is often limited by the complexity of managing many processing parameters across large sets of related measurements. Although the conversion of raw detector data into physically meaningful representations is largely deterministic, existing approaches typically embed parameter handling directly in analysis scripts, making automation, reusability, and reproducibility difficult. We introduce the spice concept, a declarative approach for managing analysis parameters in a scan-aware manner. Spice separates parameter definitions from the analysis code and organises their validity along the chronological sequence of scans using explicit update boundaries. This allows parameters to be applied consistently across multiple scans while still supporting local adjustments where necessary. Using X-ray diffraction as an example, we demonstrate how spice enables a clear separation between routine, instrument-specific data preparation ("cooking") and the subsequent scientific interpretation. We describe an implementation within the Nx5d framework and discuss how the approach supports reproducible analysis, automated reprocessing, and provenance tracking. The spice concept provides a general architectural pattern for scalable and maintainable data processing at scientific installations.