research papers\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

Journal logoJOURNAL OF
SYNCHROTRON
RADIATION
ISSN: 1600-5775

Beam and sample movement compensation for robust spectro-microscopy measurements on a hard X-ray nanoprobe

crossmark logo

aDiamond Light Source, Harwell Science and Innovation Campus, Didcot, Oxfordshire OX11 0DE, United Kingdom
*Correspondence e-mail: paul.quinn@diamond.ac.uk

Edited by A. Momose, Tohoku University, Japan (Received 21 April 2021; accepted 28 July 2021; online 19 August 2021)

Static and in situ nanoscale spectro-microscopy is now routinely performed on the Hard X-ray Nanoprobe beamline at Diamond and the solutions implemented to provide robust energy scanning and experimental operation are described. A software-based scheme for active feedback stabilization of X-ray beam position and monochromatic beam flux across the operating energy range of the beamline is reported, consisting of two linked feedback loops using extremum seeking and position control. Multimodal registration methods have been implemented for active compensation of drift during an experiment to compensate for sample movement during in situ experiments or from beam-induced effects.

1. Introduction

The emergence of ultra-brilliant synchrotron sources (Tavares et al., 2014[Tavares, P. F., Leemann, S. C., Sjöström, M. & Andersson, Å. (2014). J. Synchrotron Rad. 21, 862-877.]; Liu et al., 2014[Liu, L., Milas, N., Mukai, A. H. C., Resende, X. R. & de Sá, F. H. (2014). J. Synchrotron Rad. 21, 904-911.]), developments in instrumentation (Holler et al., 2018[Holler, M., Raabe, J., Diaz, A., Guizar-Sicairos, M., Wepf, R., Odstrcil, M., Shaik, F. R., Panneels, V., Menzel, A., Sarafimov, B., Maag, S., Wang, X., Thominet, V., Walther, H., Lachat, T., Vitins, M. & Bunk, O. (2018). Rev. Sci. Instrum. 89, 043706.]; Schroer et al., 2017[Schroer, C. G., Seyrich, M., Kahnt, M., Botta, S., Döhrmann, R., Falkenberg, G., Garrevoet, J., Lyubomirskiy, M., Scholz, M., Schropp, A. & Wittwer, F. (2017). Proc. SPIE, 10389, 103890E.]; Deng et al., 2019[Deng, J., Preissner, C., Klug, J. A., Mashrafi, S., Roehrig, C., Jiang, Y., Yao, Y., Wojcik, M., Wyman, M. D., Vine, D., Yue, K., Chen, S., Mooney, T., Wang, M., Feng, Z., Jin, D., Cai, Z., Lai, B. & Vogt, S. (2019). Rev. Sci. Instrum. 90, 083701.]; Nazaretski et al., 2014[Nazaretski, E., Huang, X., Yan, H., Lauer, K., Conley, R., Bouet, N., Zhou, J., Xu, W., Eom, D., Legnini, D., Harder, R., Lin, C. H., Chen, Y. S., Hwu, Y. & Chu, Y. S. (2014). Rev. Sci. Instrum. 85, 033707.]) and rapid advances in hard X-ray focusing optics using either reflective (Yamauchi et al., 2011[Yamauchi, K., Mimura, H., Kimura, T., Yumoto, H., Handa, S., Matsuyama, S., Arima, K., Sano, Y., Yamamura, K., Inagaki, K., Nakamori, H., Kim, J., Tamasaku, K., Nishino, Y., Yabashi, M. & Ishikawa, T. (2011). J. Phys. Condens. Matter, 23, 394206.]), refractive (Seiboth et al., 2017[Seiboth, F., Schropp, A., Scholz, M., Wittwer, F., Rödel, C., Wünsche, M., Ullsperger, T., Nolte, S., Rahomäki, J., Parfeniukas, K., Giakoumidis, S., Vogt, U., Wagner, U., Rau, C., Boesenberg, U., Garrevoet, J., Falkenberg, G., Galtier, E. C., Ja Lee, H., Nagler, B. & Schroer, C. G. (2017). Nat. Commun. 8, 14623.]; Patommel et al., 2017[Patommel, J., Klare, S., Hoppe, R., Ritter, S., Samberg, D., Wittwer, F., Jahn, A., Richter, K., Wenzel, C., Bartha, J. W., Scholz, M., Seiboth, F., Boesenberg, U., Falkenberg, G. & Schroer, C. G. (2017). Appl. Phys. Lett. 110, 101103.]) or diffractive optics (Huang et al., 2013[Huang, X., Yan, H., Nazaretski, E., Conley, R., Bouet, N., Zhou, J., Lauer, K., Li, L., Eom, D., Legnini, D., Harder, R., Robinson, I. K. & Chu, Y. S. (2013). Sci. Rep. 3, 3562.]; Suzuki et al., 2010[Suzuki, Y., Takeuchi, A., Takenaka, H. & Okada, I. (2010). X-ray Opt. Instrum. 2010, 6-11.]; Mimura et al., 2010[Mimura, H., Handa, S., Kimura, T., Yumoto, H., Yamakawa, D., Yokoyama, H., Matsuyama, S., Inagaki, K., Yamamura, K., Sano, Y., Tamasaku, K., Nishino, Y., Yabashi, M., Ishikawa, T. & Yamauchi, K. (2010). Nat. Phys. 6, 122-125.]) have allowed hard X-ray scanning-probe experiments to offer new possibilities for high-resolution imaging. This potential for new science has resulted in the construction of a number of hard X-ray nanoprobes in recent years, together with planned showcase constructions for new low-emittance facilities (Chang et al., 2013[Chang, S. H., Yin, G. C., Wang, D. J., Chang, C. H., Juang, J. M., Huang, L. J., Liu, C. Y., Chang, C. F., Chu, C. H. & Tang, M. T. (2013). J. Phys. Conf. Ser. 425, 182005.]; Suzuki et al., 2013[Suzuki, M., Kawamura, N., Mizumaki, M., Terada, Y., Uruga, T., Fujiwara, A., Yamazaki, H., Yumoto, H., Koyama, T., Senba, Y., Takeuchi, T., Ohashi, H., Nariyama, N., Takeshita, K., Kimura, H., Matsushita, T., Furukawa, Y., Ohata, T., Kondo, Y., Ariake, J., Richter, J., Fons, P., Sekizawa, O., Ishiguro, N., Tada, M., Goto, S., Yamamoto, M., Takata, M. & Ishikawa, T. (2013). J. Phys. Conf. Ser. 430, 012017.]; Nazaretski et al., 2017[Nazaretski, E., Yan, H., Lauer, K., Bouet, N., Huang, X., Xu, W., Zhou, J., Shu, D., Hwu, Y. & Chu, Y. S. (2017). J. Synchrotron Rad. 24, 1113-1119.]; Winarski et al., 2012[Winarski, R. P., Holt, M. V., Rose, V., Fuesz, P., Carbaugh, D., Benson, C., Shu, D., Kline, D., Stephenson, G. B., McNulty, I. & Maser, J. (2012). J. Synchrotron Rad. 19, 1056-1060.]; Martínez-Criado et al., 2016[Martínez-Criado, G., Villanova, J., Tucoulou, R., Salomon, D., Suuronen, J.-P., Labouré, S., Guilloud, C., Valls, V., Barrett, R., Gagliardini, E., Dabin, Y., Baker, R., Bohic, S., Cohen, C. & Morse, J. (2016). J. Synchrotron Rad. 23, 344-352.]; Chen et al., 2014[Chen, S., Deng, J., Yuan, Y., Flachenecker, C., Mak, R., Hornberger, B., Jin, Q., Shu, D., Lai, B., Maser, J., Roehrig, C., Paunesku, T., Gleber, S. C., Vine, D. J., Finney, L., VonOsinski, J., Bolbat, M., Spink, I., Chen, Z., Steele, J., Trapp, D., Irwin, J., Feser, M., Snyder, E., Brister, K., Jacobsen, C., Woloschak, G. & Vogt, S. (2014). J. Synchrotron Rad. 21, 66-75.]; Somogyi et al., 2015[Somogyi, A., Medjoubi, K., Baranton, G., Le Roux, V., Ribbens, M., Polack, F., Philippot, P. & Samama, J.-P. (2015). J. Synchrotron Rad. 22, 1118-1129.]; Schroer et al., 2010[Schroer, C. G., Boye, P., Feldkamp, J. M., Patommel, J., Samberg, D., Schropp, A., Schwab, A., Stephan, S., Falkenberg, G., Wellenreuther, G. & Reimers, N. (2010). Nucl. Instrum. Methods Phys. Res. A, 616, 93-97.]; Johansson et al., 2013[Johansson, U., Vogt, U. & Mikkelsen, A. (2013). Proc. SPIE, 8851, 88510L.]; Tolentino et al., 2017[Tolentino, H. C. N., Soares, M. M., Perez, C. A., Vicentin, F. C., Abdala, D. B., Galante, D., Teixeira, V. D. C., De Araujo, D. H. C. & Westfahl, H. (2017). J. Phys. Conf. Ser. 849, 012057.]).

Hard X-ray nano-spectromicroscopy is an example of a novel technique which is finding a growing number of applications in a range of scientific areas, with the potential to impact many more.

Delivering nanoscale spectromicroscopy requires robust implementations and solutions to be developed to provide repeatable energy changes, and stable beam positioning and beam intensity during energy scanning. Nano-focusing has additional challenges related to positional stability and any unwanted sample drift over the course of a measurement, particularly during in situ experiments.

The I14 Nanoprobe beamline (Quinn et al., 2021[Quinn, P. D., Alianelli, L., Gomez-Gonzalez, M., Mahoney, D., Cacho-Nerin, F., Peach, A. & Parker, J. E. (2021). J. Synchrotron Rad. 28, 1006-1013.]) at Diamond Light Source is a 185 m long instrument designed to enable flexible multi-edge spectromicroscopy on static and in situ samples across the 5 to 23 keV energy range of the beamline with a beam size of 50 nm (at 12 keV). Like similar facilities (Nazaretski et al., 2017[Nazaretski, E., Yan, H., Lauer, K., Bouet, N., Huang, X., Xu, W., Zhou, J., Shu, D., Hwu, Y. & Chu, Y. S. (2017). J. Synchrotron Rad. 24, 1113-1119.]; Chang et al., 2013[Chang, S. H., Yin, G. C., Wang, D. J., Chang, C. H., Juang, J. M., Huang, L. J., Liu, C. Y., Chang, C. F., Chu, C. H. & Tang, M. T. (2013). J. Phys. Conf. Ser. 425, 182005.]; Johansson et al., 2013[Johansson, U., Vogt, U. & Mikkelsen, A. (2013). Proc. SPIE, 8851, 88510L.]; Somogyi et al., 2015[Somogyi, A., Medjoubi, K., Baranton, G., Le Roux, V., Ribbens, M., Polack, F., Philippot, P. & Samama, J.-P. (2015). J. Synchrotron Rad. 22, 1118-1129.]) the beamline uses horizontally deflecting optics for all beam-conditioning elements prior to nano-focusing to improve beam stability.

This horizontal optical arrangement, shown in Fig. 1[link], assists with managing vibrations with respect to beam coherence and focusing, but it can present challenges for long-term stability and operation as it results in the coupling of multiple optical elements to the horizontal beam position.

[Figure 1]
Figure 1
Outline schematic of the nanoprobe beamline (I14) at Diamond Light Source. The beamline uses all horizontal optics for beam conditioning prior to the endstation KB mirrors at 185 m. The pitch and roll piezo actuator and ion chamber measurement positions for beam position and intensity control are indicated.

Indirect cooling schemes for the mirrors and the second monochromator crystals can provide low vibrations, but can also result in a slow response to changes in thermal load, which happens when switching mirror stripe or when changing photon energy. The net effect is the slow thermal drift of these elements, happening over several hours in the case of the mirrors. Additionally, Compton scattering from the first monochromator crystal produces a slow temperature increase in the surrounding mechanical elements, resulting in similarly slow drift. Ideally, the metrology design and temperature regulation of the mirrors and monochromator mechanics would compensate for or mitigate these effects, but in practice meeting the required performance can require corrective measures. Mechanical intervention to correct such issues has a major impact on operations and corrective feedback schemes can provide an alternative solution. In this paper we outline the schemes put in place on the I14 Nanoprobe beamline to enable flexible multi-edge spectromicroscopy on static and in situ samples.

2. Optimization of beam intensity and position

Feedback schemes using either position- or intensity-based control are typically used to control beamline performance. Intensity-based control requires maximizing the signal, stabilizing the signal at a constant level or fixing the ratio between intensities, such as before and after the monochromator (Krolzig et al., 1984[Krolzig, A., Materlik, G., Swars, M. & Zegenhagen, J. (1984). Nucl. Instrum. Methods Phys. Res. 219, 430-434.]; Siddons, 1998[Siddons, D. P. (1998). J. Synchrotron Rad. 5, 685-686.]). Extremum-seeking control (Krstić & Wang, 2000[Krstić, M. & Wang, H. H. (2000). Automatica, 36, 595-601.]; Proux et al., 2006[Proux, O., Nassif, V., Prat, A., Ulrich, O., Lahera, E., Biquard, X., Menthonnex, J.-J. & Hazemann, J.-L. (2006). J. Synchrotron Rad. 13, 59-68.]) uses a `perturb and observe' scheme in which the mechanism controlling the intensity is continuously perturbed and the variation in intensity is measured to determine the location of the maximum and/or direction to move towards the maximum position. The perturb and observe scheme has been implemented in hardware in a number of different ways, but at its core a sine-wave oscillation is used to drive the intensity perturbation by oscillating a monochromator crystal, and a phase-lock loop or phase measurement observes the intensity variation to determine the direction and magnitude (Zohar et al., 2016[Zohar, S., Kissick, D. J., Venugopalan, N., Ogata, C. M., Makarov, O., Stepanov, S. & Fischetti, R. F. (2016). Phys. Rev. Accel. Beams, 19, 1-7.]; Bloomer et al., 2013[Bloomer, C., Dent, A., Diaz-Moreno, S., Dolbnya, I., Pedersen, U., Rehm, G., Tang, C. & Thomas, C. (2013). J. Phys. Conf. Ser. 425, 2-7.]; Stoupin et al., 2010[Stoupin, S., Lenkszus, F., Laird, R., Goetze, K., Kim, K. J. & Shvyd'Ko, Y. (2010). Rev. Sci. Instrum. 81, 055108.]; Renevier et al., 2003[Renevier, H., Grenier, S., Arnaud, S., Bérar, J. F., Caillot, B., Hodeau, J. L., Letoublon, A., Proietti, M. G. & Ravel, B. (2003). J. Synchrotron Rad. 10, 435-444.]). Beam position can also be used as an indicator of monochromator alignment and is controlled using piezo actuators in the monochromator. If the source of intensity loss or beam movement is misalignment of the second crystal with respect to the first, a position-based feedback will bring the beam back to the same position, and consequently the monochromator crystals into a parallel alignment (Ramanathan et al., 1988[Ramanathan, M., Engbretson, M. & Montano, P. A. (1988). Nucl. Instrum. Methods Phys. Res. A, 266, 471-474.]).

Implementations of intensity-based schemes, while successful, are often localized to a beamline or facility, or implemented for specific hardware, which can hamper more general adoption. Schemes developed at Diamond (Bloomer et al., 2013[Bloomer, C., Dent, A., Diaz-Moreno, S., Dolbnya, I., Pedersen, U., Rehm, G., Tang, C. & Thomas, C. (2013). J. Phys. Conf. Ser. 425, 2-7.]), for example, were not straightforward to implement on different beamlines due to differences in control system architectures (e.g. older VME versus newer Ethercat). The traditional phase-lock analogue hardware schemes can also be more complex to implement on a beamline with very long distances between sensors, phase loops and actuators. A key factor for nanoscale measurements is also the amplitude and frequency of the oscillation, which must have a negligible effect on the measurement. Implementations of oscillation and phase-lock schemes can require adapting the amplitude of the oscillation with energy as the sensitivity changes with the Darwin width, and these schemes have largely been deployed at facilities operating mainly at fixed energy for diffraction measurements rather than spectroscopy. Beam-position control is more straightforward, with traditional proportional–integral–derivative control loops (PID) used to actuate and control to a fixed setpoint.

In an all-horizontal geometry, several components can influence the horizontal position and intensity. Drift can occur in the pitch of the mirrors before the monochromator which will result in positional and angular change. With the mirror before the double-crystal monochromator (DCM) this angular drift can potentially affect the energy calibration of the monochromator, particularly at higher energies or lower angles, and result in a reduction in intensity if moved sufficiently off the rocking-curve peak. A drift in the angle of the second crystal with respect to the first crystal will also result in a positional change and drop in intensity. A single PID control scheme actuating the monochromator to keep a fixed beam position will not keep the crystals parallel as it would also compensate for mirror drift and result in both intensity loss and possible variation in the energy calibration, particularly at high energies where small angular changes have a larger impact.

A software-based feedback system was therefore developed to implement extremum-seeking control of intensity and PID control of the beam position. Both variables are monitored before the optical aperture is defined for the Kirkpatrick–Baez (KB) mirrors, using two ion chambers. The ion chambers feature split electrodes to provide a position measurement and are arranged orthogonal to each other to provide an X and Y position, respectively (Sato, 2001[Sato, K. (2001). J. Synchrotron Rad. 8, 378-380.]). In addition, the chambers are fitted with an additional grid between the anode and cathode to suppress the effect of slow-moving ions and improve the temporal response (Müller et al., 2013[Müller, O., Stötzel, J., Lützenkirchen-Hecht, D. & Frahm, R. (2013). J. Phys. Conf. Ser. 425, 092010.]). The ion chambers were preferred over a single-crystal beam-position monitor (BPM) to avoid beam artefacts from the electrode patterning.

For the intensity tracking the second crystal of the DCM is swept ± 100 nrad in 25 nrad steps at a step rate of 5 Hz through EPICS (Experimental Physics and Industrial Control System; https://epics-controls.org/epics). The scheme uses a simple hill-climbing type approach such that, when a maximum is found, the centre of the oscillation is moved to that position. This angular modulation is much smaller than the Darwin width of the crystals. In the worst case for this system, using Si(111) crystals at 25 keV, the smallest Darwin width corresponds to 10 µrad. A variation of 0.14σ would cause a 1% intensity variation and this modulation is an order of magnitude below this. The fractional contribution propagates to the secondary source aperture (SSA). For positional control, a standard PID loop controls the angular positioning of the M2 mirror.

Two control loops which both influence the same variable, namely position, and in this case beam position, will generally not work well together if they are not aware of each other in some way. In a typical fully characterized control system with two control loops, the response of the system to different actuations is characterized, and if actuation in one loop influences another loop the influence is estimated and a corrective term is applied, and vice versa to stop the control loop responding unnecessarily. However, in our case the loop is monitored and updated relatively slowly at 5 Hz compared with the actuation and response time so the temporal lag is negligible. The step size or changes in operation are also relatively small to provide gentle correction and variations during an experiment. Rather than have two independent loops we opted to interlace the control loops, whereby the intensity loop steps in its oscillatory pattern, and in between each oscillation step the PID loop is updated and a corrective step is estimated and taken. An overview of the algorithm is presented in Fig. S1 in the supporting information.

The rate of convergence to the maximum intensity can vary so some settling is needed for larger energy steps. To accommodate this variation when taking energy steps greater than 1 keV, the demanded change is split, via software, into four steps with a 30 s pause between steps to allow for both settling and accurate tracking over the energy change. A long beamline also has a tighter tolerance for the beam-pointing direction. A 10 µrad movement over 150 m would put the beam outside the BPM window so this split also helps to correct and track across larger scale changes. For an energy change greater than 2 keV this results in a delay of up to 120 s before the energy move is considered complete and the beam stabilized and optimal. While this would perhaps be considered a long duration for a bulk EXAFS beamline, this timescale is still small compared with the acquisition time for large X-ray fluorescence (XRF) maps or XANES maps.

To demonstrate the operation of the feedback system, measurements of the drift in intensity and beam position with and without feedback were collected [Fig. 2[link](a)]. The measurements were taken after a large energy move (10 keV) to show the influence of a change in heatload. Fig. 2[link](b) shows the feedback in operation, plotting the intensity and positions of the beam before the KB mirror for various changes in energy. The feedback is always on during energy moves and operations; it is only paused when a user enters the hutch. The noisy jumps observed between energy moves are partly the motion of the beam as the energy changes, but also due to automatic gain changes on the amplifiers of the beam-position monitors as the flux changes. This scheme has been in operation for two years on the beamline, and it allows for robust and repeatable energy changes across the operating range and reaches maximum intensity in all cases. The energy demands can easily be set by beamline users, and the scheme has allowed a variety of experiments to proceed remotely with minimal staff intervention. Future developments could incorporate a Kalman filter for gradient estimation to accelerate convergence to a peak value.

[Figure 2]
Figure 2
(a) Plots of the position and intensity drift observed with and without feedback over a 2 h period. The 10 min top-up cycle is visible in the intensity and position variation. The slow cycles in the positions without feedback operation, particularly in Y, are not currently understood but are actively corrected by the feedback. (b) Position and intensity as energy is adjusted across a wide range. The perturbations at the beam-position monitor during the energy changes are included. The intensity is displayed in amplified volts for scaling. The ion chamber arrangement consists of two split ion chambers or four amplified signals corresponding to a 0–40 V range.

3. Active drift compensation

Drift of the measured area across multiple measurements is a common problem experienced in X-ray microscopy and can occur for several reasons. In situ environments allow investigations under static or flow conditions of liquid or gas, under different pressures or flow rates, which can cause motion of the sample through changes in thermal gradient or flexing of the windows or membranes containing the sample (Fam et al., 2019[Fam, Y., Sheppard, T. L., Becher, J., Scherhaufer, D., Lambach, H., Kulkarni, S., Keller, T. F., Wittstock, A., Wittwer, F., Seyrich, M., Brueckner, D., Kahnt, M., Yang, X., Schropp, A., Stierle, A., Schroer, C. G. & Grunwaldt, J.-D. (2019). J. Synchrotron Rad. 26, 1769-1781.]; van Ravenhorst et al., 2019[Ravenhorst, I. K. van, Geitenbeek, R. G., van der Eerden, M. J., Tijn van Omme, J., Peréz Garza, H. H., Meirer, F., Meijerink, A. & Weckhuysen, B. M. (2019). ChemCatChem, 11, 5505-5512.]). Nano-focused X-ray beams, depending on the flux and absorption properties, can also lead to localized thermal heating. This localized heating can induce sample movement due to local thermal expansion, with temperature variations that depend on the sample composition and the position of the beam on the sample, resulting in sample movement which will vary depending on the scanning time and any spatial variations in the materials under investigation (Wallander & Wallentin, 2017[Wallander, H. & Wallentin, J. (2017). J. Synchrotron Rad. 24, 925-933.]).

The relative movement of the beam with respect to the sample can also be an issue. Nano-positioning schemes based on the use of interferometers measure the relative movement of stage and optic to correct for both slow thermal drift and vibrations. These interferometer-based schemes have grown increasingly sophisticated, but to date the authors are only aware of implementations for diffractive or on-axis type focusing optics. Implementations of reflective nano-focusing KB mirrors have controlled the stage position using interferometers and tight temperature control of the room, but interferometric control of the KB relative to the stage has, to date, not been achieved (Villar et al., 2018[Villar, F., Andre, L., Baker, R., Bohic, S., da Silva, J. C., Guilloud, C., Hignette, O., Meyer, J., Pacureanu, A., Perez, M., Salome, M., van der Linden, P., Yang, Y. & Cloetens, P. (2018). Synchrotron Radiat. News, 31(5), 9-14.]; Martínez-Criado et al., 2016[Martínez-Criado, G., Villanova, J., Tucoulou, R., Salomon, D., Suuronen, J.-P., Labouré, S., Guilloud, C., Valls, V., Barrett, R., Gagliardini, E., Dabin, Y., Baker, R., Bohic, S., Cohen, C. & Morse, J. (2016). J. Synchrotron Rad. 23, 344-352.]). The measurement of position with a metrology system is never truly a measurement of the actual sample position. It is a measurement of a virtual point or reference point along the direction of the motion-stage movement. Localized movement of the sample with respect to the metrology measurements can still be observed to a varying extent depending on the conditions of the experiment.

The impact of this drift on the experiment is often to force the experimenter to expand the field of view of the measurement to include empty areas such that across the measurements of the experiment the area of interest does not drift out of the field of view and so can be subsequently aligned and analysed (Zhao et al., 2019[Zhao, J., Nowrouzi, K., Celestre, R. S., Marcus, M. A., Yu, Y.-S. & Shapiro, D. A. (2019). Proc. SPIE, 11112, 111120C.]), but this can increase the experimental measurement time significantly and the nature of the drift in both direction and magnitude is unknown. Alternatively, only large areas with some strong visible features, such as edges, are selected to help later registration, which can also limit scientific study across a sample.

To minimize the impact of drift an active compensation scheme was implemented which uses active image registration to estimate and correct for the movement. The registration scheme needed to allow for multi-modal images, be robust to contrast changes and allow both small and large scan area sizes. A number of approaches exist for image registration, from the sum of the squares of the differences to Fourier-transform-based cross correlation (Guizar-Sicairos et al., 2008[Guizar-Sicairos, M., Thurman, S. T. & Fienup, J. R. (2008). Opt. Lett. 33, 156.]), but these methods do not incorporate the multimodal registration or robustness to contrast change, and early testing showed issues with scan regions with small numbers of pixels.

In medical image registration, a concept from information theory, mutual information (MI), or relative entropy, is extensively used as an image-matching and multimodal image-matching metric. MI measures the statistical dependence between two random variables or the amount of information that one variable contains about the other. It makes no assumption of the functional form or relationship between image intensities in the two images and so there are no constraints on the image content of the modalities involved (Maes et al., 1996[Maes, F., Collignon, A., Vandermeulen, D., Marchal, G. & Suetens, P. (1996). IEEE Trans. Med. Imaging, 16, 187-198.]; Luan et al., 2008[Luan, H., Qi, F., Xue, Z., Chen, L. & Shen, D. (2008). Pattern Recognit. 41, 285-298.]; Xie et al., 2003[Xie, H., Pierce, L. E. & Ulaby, F. T. (2003). Int. Geosci. Remote Sens. Symp. 6, 4028-4031.]). The MI metric can be described in terms of the entropy of the variables. Given two random variables A and B, the entropy measures the degree of uncertainty in the variables or the dispersion of the probability distribution. The mutual information I(A, B) measures the amount by which the uncertainty about A decreases when B can be formulated as the distance between the joint entropy H(A, B) and the individual entropies H(A) and H(B) such that

[I(A,B) = H(A) + H(B) - H(A,B), \eqno(1)]

where

[\eqalign{H(A) = & \, - \sum _i p_A (i) \log p_A (i), \cr H(A,B) = & \, - \sum _{i,j} p_{AB} (i,j) \log p_{AB} (i,j) .} \eqno(2)]

In terms of image registration, alignment of the images A and B reduces the joint entropy or uncertainty about B when A is present and vice versa. The estimation of the marginal probability distributions ρA and ρB, and the joint probability distribution ρAB, is achieved by taking a histogram or joint histogram of the data. The estimated probability distribution will depend on the choice of the bin width. In our implementation, when the number of points n is less than 400 the Sturges rule (Scott, 2009[Scott, D. W. (2009). WIREs Comput Stat. 1, 303-306.]; Sturges, 1926[Sturges, H. A. (1926). J. Am. Stat. Assoc. 21, 65-66.]) is employed to estimate the number of bins, Nbins,

[N_{\rm bins} = 1 + 3.322 \log n . \eqno(3)]

For larger numbers of points the bin width is calculated from the standard deviation of the data set, σ, using Scott's rule (Scott, 1979[Scott, D. W. (1979). Biometrika, 66, 605-610.]),

[{\rm d} h = 3.49 \sigma n^{-1/3} . \eqno(4)]

While there are several advanced options for estimating the number of bins to best represent the distribution, we have used the most common empirical estimations, which assume a normal distribution (but apply generally), for ease of use and speed and found them to be robust.

The size of the overlapping part of the images can influence the mutual information metric so a normalized form (NMI) is more widely used and implemented here:

[{\rm NMI} = {{H(A) + H(Y)} \over {H(A,B)}} . \eqno(5)]

The NMI registration criterion presented here states that the NMI of the image intensity values is maximal if the images are geometrically aligned but limits the metric range to between zero and one. In active drift compensation, the current image is compared with a reference image and the estimated shift between the images is used to adjust the centre of the next scan to compensate for the drift. Optimization methods, while commonly used for image registration, are subject to local minima and the goal was a robust scheme, so a simple 3×3 pixel search grid is used in integer scan steps to find the image shift. During active compensation, registration is only measured to the nearest pixel to keep the definition of the scan region consistent in terms of size and the number of points in a row or column. The process happens in an automated manner throughout the scan and keeps the scan region aligned to within a few pixels (irrespective of the scanning spatial size of the pixel) over the course of a XANES scan. There are no assumptions made on the nature of the relation between the image intensities, so this approach allows for registration to occur between different measurements of the same region. This is needed for situations where no other XRF reference exists, other than the edge under investigation, but differential phase contrast or ptychography, for example, can provide a reference image.

As an example of the correction of uncontrolled sample movement during an experiment, Fig. 3[link] shows the corrections made to a scan of a nickel manganese cobalt battery material during an Ni-edge XANES mapping measurement using the Co Kα XRF map as a tracking reference. This experiment displayed particularly large sample movement during scanning. The sample movement, in the vertical direction, increases as the energy reaches and scans across the absorption edge, clearly indicating a beam-induced movement. Details of the origins of the movement are beyond the scope of this study but as a more general comment, in our experience, the greatest sample motion during XANES mapping is observed on samples supported on silicon nitride membranes. Very little movement is observed on transmission electron microscopy (TEM) grids or focused ion beam attached samples, so the source of the movement appears to be most likely a thermal effect or a result of static charging. Fig. 4[link] shows the image sequence of Co Kα XRF maps, maintaining the object registration within the defined scan region. The corrections during the scan reach 2 µm and amount to 25% of the field of view but, as can be observed, the tracking correction reduces mis-registration to a few percent. The elemental maps are generated by reading from the data file as the data are acquired and simple summation within a window around the XRF peaks of interest or, in the case of differential phase contrast, a masking and centre of mass operation. This provides live feedback to the user and the input for active registration. The registration method needs to be simple, robust and quick, and, while improved registration can be achieved post experiment, this coarse grid search is sufficient to keep mis-registration to an acceptable level. The time required for this active registration is currently impacted by the acquisition and processing scheme used, which results in a lag at the end of acquisition before data are available from disk to perform registration. This currently adds up to 10 s overhead on average per energy step. The active tracking is optional but over two years of operation it has proven essential for robust scanning across different fields of view and sample conditions.

[Figure 3]
Figure 3
Plots of the sample drift in pixels corrected for in a XANES mapping experiment with active compensation in (a) energy (b) scan number. Note the correlation of the movement with the Ni absorption edge indicating beam-induced motion.
[Figure 4]
Figure 4
Plots showing Co Kα XRF maps for a XANES series. The Co Kα was used as a tracking reference during an Ni K XANES map. The plots show (a) the first scan, (b) the scan at the midpoint of the absorption edge and (c) the last scan. The active correction of position maintains the same field of view. The pixel size corresponds to 80 nm.

The mutual information registration method is also employed for post-experiment alignment to sub-pixel resolution. While the main application presented here is for XANES, the method has also been used for rocking-curve maps and other scans where drift may occur in an arbitrary manner.

4. Conclusions

We have implemented a robust scheme for energy scanning which controls position and maximizes intensity, allowing both staff and beamline users to change energy easily, without intervention, across a 4.5–23 keV range whilst maintaining nano-focusing at the sample and optimal intensity. To tackle sample drift, an active drift compensation method was implemented which maintains alignment between successive scans. This allows for in situ measurements and compensates for unwanted drift, enabling experiments under a range of conditions, and is tolerant to noise and to changes in field of view and contrast. The active correction method also reduces misalignment corrections post experiment. The combination of the two provides a robust platform for hard X-ray spectro-microscopy and in situ experiments.

Supporting information


Acknowledgements

The authors are grateful for the continued assistance and collaboration of the various Diamond support groups, but we would particularly like to thank Ed Warrick and Anthony Hull for assistance in implementing these schemes in our acquisition development. The authors would like to thank Dr Chao Xu and Professor Clare Grey (University of Cambridge) for sharing the image shift data from their standard proposal mg25187 carried out on Beamline I14, Diamond Light Source.

Funding information

The following funding is acknowledged: Diamond Light Source.

References

First citationBloomer, C., Dent, A., Diaz-Moreno, S., Dolbnya, I., Pedersen, U., Rehm, G., Tang, C. & Thomas, C. (2013). J. Phys. Conf. Ser. 425, 2–7.  CrossRef Google Scholar
First citationChang, S. H., Yin, G. C., Wang, D. J., Chang, C. H., Juang, J. M., Huang, L. J., Liu, C. Y., Chang, C. F., Chu, C. H. & Tang, M. T. (2013). J. Phys. Conf. Ser. 425, 182005.  CrossRef Google Scholar
First citationChen, S., Deng, J., Yuan, Y., Flachenecker, C., Mak, R., Hornberger, B., Jin, Q., Shu, D., Lai, B., Maser, J., Roehrig, C., Paunesku, T., Gleber, S. C., Vine, D. J., Finney, L., VonOsinski, J., Bolbat, M., Spink, I., Chen, Z., Steele, J., Trapp, D., Irwin, J., Feser, M., Snyder, E., Brister, K., Jacobsen, C., Woloschak, G. & Vogt, S. (2014). J. Synchrotron Rad. 21, 66–75.  Web of Science CrossRef IUCr Journals Google Scholar
First citationDeng, J., Preissner, C., Klug, J. A., Mashrafi, S., Roehrig, C., Jiang, Y., Yao, Y., Wojcik, M., Wyman, M. D., Vine, D., Yue, K., Chen, S., Mooney, T., Wang, M., Feng, Z., Jin, D., Cai, Z., Lai, B. & Vogt, S. (2019). Rev. Sci. Instrum. 90, 083701.  Web of Science CrossRef PubMed Google Scholar
First citationFam, Y., Sheppard, T. L., Becher, J., Scherhaufer, D., Lambach, H., Kulkarni, S., Keller, T. F., Wittstock, A., Wittwer, F., Seyrich, M., Brueckner, D., Kahnt, M., Yang, X., Schropp, A., Stierle, A., Schroer, C. G. & Grunwaldt, J.-D. (2019). J. Synchrotron Rad. 26, 1769–1781.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationGuizar-Sicairos, M., Thurman, S. T. & Fienup, J. R. (2008). Opt. Lett. 33, 156.  Web of Science PubMed Google Scholar
First citationHoller, M., Raabe, J., Diaz, A., Guizar-Sicairos, M., Wepf, R., Odstrcil, M., Shaik, F. R., Panneels, V., Menzel, A., Sarafimov, B., Maag, S., Wang, X., Thominet, V., Walther, H., Lachat, T., Vitins, M. & Bunk, O. (2018). Rev. Sci. Instrum. 89, 043706.  Web of Science CrossRef PubMed Google Scholar
First citationHuang, X., Yan, H., Nazaretski, E., Conley, R., Bouet, N., Zhou, J., Lauer, K., Li, L., Eom, D., Legnini, D., Harder, R., Robinson, I. K. & Chu, Y. S. (2013). Sci. Rep. 3, 3562.  Web of Science CrossRef PubMed Google Scholar
First citationJohansson, U., Vogt, U. & Mikkelsen, A. (2013). Proc. SPIE, 8851, 88510L.  Google Scholar
First citationKrolzig, A., Materlik, G., Swars, M. & Zegenhagen, J. (1984). Nucl. Instrum. Methods Phys. Res. 219, 430–434.  CrossRef Web of Science Google Scholar
First citationKrstić, M. & Wang, H. H. (2000). Automatica, 36, 595–601.  Google Scholar
First citationLiu, L., Milas, N., Mukai, A. H. C., Resende, X. R. & de Sá, F. H. (2014). J. Synchrotron Rad. 21, 904–911.  Web of Science CrossRef IUCr Journals Google Scholar
First citationLuan, H., Qi, F., Xue, Z., Chen, L. & Shen, D. (2008). Pattern Recognit. 41, 285–298.  CrossRef Google Scholar
First citationMaes, F., Collignon, A., Vandermeulen, D., Marchal, G. & Suetens, P. (1996). IEEE Trans. Med. Imaging, 16, 187–198.  CrossRef Google Scholar
First citationMartínez-Criado, G., Villanova, J., Tucoulou, R., Salomon, D., Suuronen, J.-P., Labouré, S., Guilloud, C., Valls, V., Barrett, R., Gagliardini, E., Dabin, Y., Baker, R., Bohic, S., Cohen, C. & Morse, J. (2016). J. Synchrotron Rad. 23, 344–352.  Web of Science CrossRef IUCr Journals Google Scholar
First citationMimura, H., Handa, S., Kimura, T., Yumoto, H., Yamakawa, D., Yokoyama, H., Matsuyama, S., Inagaki, K., Yamamura, K., Sano, Y., Tamasaku, K., Nishino, Y., Yabashi, M., Ishikawa, T. & Yamauchi, K. (2010). Nat. Phys. 6, 122–125.  Web of Science CrossRef CAS Google Scholar
First citationMüller, O., Stötzel, J., Lützenkirchen-Hecht, D. & Frahm, R. (2013). J. Phys. Conf. Ser. 425, 092010.  Google Scholar
First citationNazaretski, E., Huang, X., Yan, H., Lauer, K., Conley, R., Bouet, N., Zhou, J., Xu, W., Eom, D., Legnini, D., Harder, R., Lin, C. H., Chen, Y. S., Hwu, Y. & Chu, Y. S. (2014). Rev. Sci. Instrum. 85, 033707.  Web of Science CrossRef PubMed Google Scholar
First citationNazaretski, E., Yan, H., Lauer, K., Bouet, N., Huang, X., Xu, W., Zhou, J., Shu, D., Hwu, Y. & Chu, Y. S. (2017). J. Synchrotron Rad. 24, 1113–1119.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationPatommel, J., Klare, S., Hoppe, R., Ritter, S., Samberg, D., Wittwer, F., Jahn, A., Richter, K., Wenzel, C., Bartha, J. W., Scholz, M., Seiboth, F., Boesenberg, U., Falkenberg, G. & Schroer, C. G. (2017). Appl. Phys. Lett. 110, 101103.  Web of Science CrossRef Google Scholar
First citationProux, O., Nassif, V., Prat, A., Ulrich, O., Lahera, E., Biquard, X., Menthonnex, J.-J. & Hazemann, J.-L. (2006). J. Synchrotron Rad. 13, 59–68.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationQuinn, P. D., Alianelli, L., Gomez-Gonzalez, M., Mahoney, D., Cacho-Nerin, F., Peach, A. & Parker, J. E. (2021). J. Synchrotron Rad. 28, 1006–1013.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationRamanathan, M., Engbretson, M. & Montano, P. A. (1988). Nucl. Instrum. Methods Phys. Res. A, 266, 471–474.  CrossRef Google Scholar
First citationRavenhorst, I. K. van, Geitenbeek, R. G., van der Eerden, M. J., Tijn van Omme, J., Peréz Garza, H. H., Meirer, F., Meijerink, A. & Weckhuysen, B. M. (2019). ChemCatChem, 11, 5505–5512.  CrossRef Google Scholar
First citationRenevier, H., Grenier, S., Arnaud, S., Bérar, J. F., Caillot, B., Hodeau, J. L., Letoublon, A., Proietti, M. G. & Ravel, B. (2003). J. Synchrotron Rad. 10, 435–444.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationSato, K. (2001). J. Synchrotron Rad. 8, 378–380.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationSchroer, C. G., Boye, P., Feldkamp, J. M., Patommel, J., Samberg, D., Schropp, A., Schwab, A., Stephan, S., Falkenberg, G., Wellenreuther, G. & Reimers, N. (2010). Nucl. Instrum. Methods Phys. Res. A, 616, 93–97.  Web of Science CrossRef CAS Google Scholar
First citationSchroer, C. G., Seyrich, M., Kahnt, M., Botta, S., Döhrmann, R., Falkenberg, G., Garrevoet, J., Lyubomirskiy, M., Scholz, M., Schropp, A. & Wittwer, F. (2017). Proc. SPIE, 10389, 103890E.  Google Scholar
First citationScott, D. W. (1979). Biometrika, 66, 605–610.  CrossRef Web of Science Google Scholar
First citationScott, D. W. (2009). WIREs Comput Stat. 1, 303–306.  CrossRef Google Scholar
First citationSeiboth, F., Schropp, A., Scholz, M., Wittwer, F., Rödel, C., Wünsche, M., Ullsperger, T., Nolte, S., Rahomäki, J., Parfeniukas, K., Giakoumidis, S., Vogt, U., Wagner, U., Rau, C., Boesenberg, U., Garrevoet, J., Falkenberg, G., Galtier, E. C., Ja Lee, H., Nagler, B. & Schroer, C. G. (2017). Nat. Commun. 8, 14623.  Web of Science CrossRef PubMed Google Scholar
First citationSiddons, D. P. (1998). J. Synchrotron Rad. 5, 685–686.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationSomogyi, A., Medjoubi, K., Baranton, G., Le Roux, V., Ribbens, M., Polack, F., Philippot, P. & Samama, J.-P. (2015). J. Synchrotron Rad. 22, 1118–1129.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationStoupin, S., Lenkszus, F., Laird, R., Goetze, K., Kim, K. J. & Shvyd'Ko, Y. (2010). Rev. Sci. Instrum. 81, 055108.  CrossRef PubMed Google Scholar
First citationSturges, H. A. (1926). J. Am. Stat. Assoc. 21, 65–66.  CrossRef Google Scholar
First citationSuzuki, M., Kawamura, N., Mizumaki, M., Terada, Y., Uruga, T., Fujiwara, A., Yamazaki, H., Yumoto, H., Koyama, T., Senba, Y., Takeuchi, T., Ohashi, H., Nariyama, N., Takeshita, K., Kimura, H., Matsushita, T., Furukawa, Y., Ohata, T., Kondo, Y., Ariake, J., Richter, J., Fons, P., Sekizawa, O., Ishiguro, N., Tada, M., Goto, S., Yamamoto, M., Takata, M. & Ishikawa, T. (2013). J. Phys. Conf. Ser. 430, 012017.  CrossRef Google Scholar
First citationSuzuki, Y., Takeuchi, A., Takenaka, H. & Okada, I. (2010). X-ray Opt. Instrum. 2010, 6–11.  Google Scholar
First citationTavares, P. F., Leemann, S. C., Sjöström, M. & Andersson, Å. (2014). J. Synchrotron Rad. 21, 862–877.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationTolentino, H. C. N., Soares, M. M., Perez, C. A., Vicentin, F. C., Abdala, D. B., Galante, D., Teixeira, V. D. C., De Araujo, D. H. C. & Westfahl, H. (2017). J. Phys. Conf. Ser. 849, 012057.  CrossRef Google Scholar
First citationVillar, F., Andre, L., Baker, R., Bohic, S., da Silva, J. C., Guilloud, C., Hignette, O., Meyer, J., Pacureanu, A., Perez, M., Salome, M., van der Linden, P., Yang, Y. & Cloetens, P. (2018). Synchrotron Radiat. News, 31(5), 9–14.  CrossRef Google Scholar
First citationWallander, H. & Wallentin, J. (2017). J. Synchrotron Rad. 24, 925–933.  Web of Science CrossRef IUCr Journals Google Scholar
First citationWinarski, R. P., Holt, M. V., Rose, V., Fuesz, P., Carbaugh, D., Benson, C., Shu, D., Kline, D., Stephenson, G. B., McNulty, I. & Maser, J. (2012). J. Synchrotron Rad. 19, 1056–1060.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationXie, H., Pierce, L. E. & Ulaby, F. T. (2003). Int. Geosci. Remote Sens. Symp. 6, 4028–4031.  Google Scholar
First citationYamauchi, K., Mimura, H., Kimura, T., Yumoto, H., Handa, S., Matsuyama, S., Arima, K., Sano, Y., Yamamura, K., Inagaki, K., Nakamori, H., Kim, J., Tamasaku, K., Nishino, Y., Yabashi, M. & Ishikawa, T. (2011). J. Phys. Condens. Matter, 23, 394206.  Web of Science CrossRef PubMed Google Scholar
First citationZhao, J., Nowrouzi, K., Celestre, R. S., Marcus, M. A., Yu, Y.-S. & Shapiro, D. A. (2019). Proc. SPIE, 11112, 111120C.  Google Scholar
First citationZohar, S., Kissick, D. J., Venugopalan, N., Ogata, C. M., Makarov, O., Stepanov, S. & Fischetti, R. F. (2016). Phys. Rev. Accel. Beams, 19, 1–7.  CrossRef Google Scholar

This is an open-access article distributed under the terms of the Creative Commons Attribution (CC-BY) Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original authors and source are cited.

Journal logoJOURNAL OF
SYNCHROTRON
RADIATION
ISSN: 1600-5775
Follow J. Synchrotron Rad.
Sign up for e-alerts
Follow J. Synchrotron Rad. on Twitter
Follow us on facebook
Sign up for RSS feeds