A Dynamic Amplitude-Correcting Gradient Estimation Technique to Align X-ray Focusing Optics
High-brightness X-rays, as produced at synchrotrons and X-ray free electron laser (XFEL) facilities, are used to characterize materials in a variety of scientific experiments. In most cases, effective use of the high-energy light requires precisely-aligned focusing optics; one example being a compound refractive lens (CRL). To align a CRL, the position and rotation must be optimized along four axes. In practice, this is a labor-intensive, time-consuming manual process that can monopolize scarce experimental time at the necessary X-ray facilities. Models of the expected Xray transmission function suggest that this task can be automated; however, the temporally-varying intensity at X-ray free electron laser facilities preclude the direct use of standard implementations of optimization solvers such as steepest descent algorithms. In this paper, we propose a novel technique to estimate the gradient of noisy functions with temporally-varying amplitudes. We construct this dynamicamplitude correction by systematically sampling a fixed central location within the standard finite difference stencil, accounting for the observed changes in time, and normalizing the difference quotients against those fluctuations. In addition to a rigorous error analysis of the sampling technique, we demonstrate its efficacy in stochastic descent optimization methods. Further, we demonstrate how this approach may be implemented to optimize X-ray focusing optics at synchrotrons or XFEL facilities