X-ray mirrors are widely used in beamlines and laboratories as focusing or collimating optics. As well as the highly accurate processes used to fabricate them, optimized alignment of X-ray mirrors also plays an important role in achieving an ideal X-ray beam. Currently, knife-edge scans are the most often used method for aligning X-ray mirrors, which can characterize the focal size and tune the alignment iteratively. However, knife-edge scanning provides only one-dimensional information and this method suffers from being time-consuming and requiring a high-resolution piezo translation stage. Here we describe a straightforward and non-iterative method for mirror alignment by measuring the relationship between the tilt aberration and the misaligned pitch angle, which is retrieved by an at-wavelength metrology technique using a randomly shaped wavefront modulator. Software and a graphical user interface have been developed to automate the alignment process. Combining the user-friendly interface and the flexibility of the at-wavelength metrology technique, we believe the proposed method and software can benefit researchers working at synchrotron facilities and on laboratory sources.

Reflecting mirrors operating at grazing angles are an important component in many beamlines and laboratories for focusing or collimating X-ray beams with high efficiency. Significant advances in fabricating highly accurate X-ray mirrors have been made in the last decade with the root-mean-square (RMS) roughness reaching less than 0.1 nm.1 In addition, to realize an optimized beam shape and wavefront, precise alignment of the optics is also extremely important. As shown by simulations, even a small misalignment of a mirror can introduce obvious wavefront aberrations,2,3 especially for high-precision strongly focusing mirrors.

Currently, there are several different approaches that are commonly used for alignment of X-ray focusing mirrors including characterizing either the focal spot size4,5 or the ray or wavefront error6–10 as feedback for iterations of alignment. Alternatively, the beam probe can be reconstructed with phase retrieval techniques as a guide for alignment.11,12 For nano-focusing optics, the focal spot cannot be easily imaged directly by currently available detectors due to their limited spatial resolution. Knife-edge scanning4,5 for characterizing focal spot sizes also faces challenges due to the requirement for nanometer resolution on the translation mechanism. The knife-edge measurement is also time-consuming because it is one-dimensional (1D), whereas the focus needs to be located in three-dimensional (3D) space. Some wavefront sensing techniques, such as with a Hartman sensor,9 can provide 2D information albeit with low spatial resolution. Furthermore, the methods discussed above provide no direct information of the misalignment due to the nonlinearity between the aberrations and the misalignment for focusing mirrors. Therefore, either a manual trial and error procedure or a dedicated closed-loop control system13 is needed for accurate mirror alignment. Recently, ptychography has seen impressive applications in at-wavelength metrology due to its ability to quantitatively retrieve the whole beam profile from the optics to image plane and, therefore, the focal plane can be determined and the wavefront aberration characterized simultaneously.12 However, at the moment, it is still challenging to apply on partially coherent sources, such as bending magnet beamlines and laboratory sources, can have an extremely small field of view, requires long acquisition and computational times, and has a high demand on stability of beamline components.

In recent years, X-ray near-field speckle patterns have been widely applied in phase-contrast imaging techniques and at-wavelength metrology.10,14 These speckle-based techniques have drawn increased attention due to their cost-efficiency and flexibility compared with other wavefront sensing techniques. Speckle-based metrology has been successfully used to measure the wavefront of X-ray beams,10 slope errors of X-ray mirror surfaces,15 and the transverse coherence of X-ray beams.16 

Here, we describe a software tool for automatic alignment of X-ray mirrors using a novel method,17 combining the principles of pencil-beam scanning6,7 and speckle-based at-wavelength metrology.18 The process has the simplicity of a pencil-beam scan but is able to provide 3D information because the speckle-based technique utilizes a 2D randomly shaped wavefront modulator rather than the 1D slit used in traditional pencil-beam scanning techniques. This method does not require iterative processes and, therefore, the image acquisition and data processing can be conveniently separated. The independent software we have developed is not restricted to any specific hardware control and can be used by any beamline or laboratory.

In this section, we give a synopsis of the proposed method which is illustrated in Fig. 1. Assuming an ideal line-focusing elliptical mirror is misaligned by an angle of Δθ in pitch. From the ray tracing simulation, shown in Fig. 1(b), it can be seen that the misalignment causes both lateral and longitudinal ray aberrations compared to the perfect line focus illustrated in Fig. 1(a) where no misalignment exists. Pencil-beam scanning with the detector at or close to the focal plane measures the lateral ray aberration directly. The shape of the ray error with respect to the slit position indicates the potential misalignment of the mirror.7,19 Our proposed method shares a similar principle, but, instead of measuring the lateral ray error, it uses the longitudinal ray aberration to quantify the misalignment.17 

FIG. 1.

Ray tracing simulation illustrating an elliptical mirror (a) producing a perfect focus and (b) with a misalignment in pitch angle leading to aberrations. (c) Schematic of the experimental alignment used in the proposed method. (d) An example of simulation results for an ideal elliptical mirror showing the linear dependence of the slope of R with respect to the misaligned pitch angle, Δθ.

FIG. 1.

Ray tracing simulation illustrating an elliptical mirror (a) producing a perfect focus and (b) with a misalignment in pitch angle leading to aberrations. (c) Schematic of the experimental alignment used in the proposed method. (d) An example of simulation results for an ideal elliptical mirror showing the linear dependence of the slope of R with respect to the misaligned pitch angle, Δθ.

Close modal

By using a randomly shaped wavefront modulator, we have adapted a speckle-based at-wavelength metrology technique.18 Assuming a speckle is centered at pixel i on the detector and shifted to pixel j due to the translation s of the modulator, as illustrated in Fig. 1(c), the focus-to-detector distance R can hence be calculated with

(1)

where p is the detector pixel size and L is the distance between the modulator and the detector. As shown in Fig. 1(d), Ri is not linear with respect to i when there is a misalignment in the pitch angle, but the slope of ΔRi has been found to be linear with Δθ.17 Only when there is no misalignment in the pitch angle (Δθ = 0) does R become the same for all pixels because there is no longitudinal aberration. Therefore, correct alignment of the pitch can be achieved by finding the linear function of ΔRi = f(θ) = 0. As R can be calculated using Eq. (1), the focal position can therefore be located simultaneously with the alignment procedure. Experimentally, a series of scans translating the wavefront modulator are made at different pitch angles close to the expected, theoretical value and the speckle-based technique18 is applied to measure si in Eq. (1).

The software was written in MATLAB (The MathWorks, Inc.) and can be run as a MATLAB GUI although the compiled executable file can also be run as a standalone application without the need to install the MATLAB program. A screenshot of the graphical user interface (GUI) is shown in Fig. 2. All parameters are accessible within a single control window.

FIG. 2.

A screenshot of the software GUI.

FIG. 2.

A screenshot of the software GUI.

Close modal

The input image files are expected to be in a single directory for each value of θ, and the software can select multiple directories to process the images in all the scan positions. Images in each directory are expected to have the same dimensions. The file paths of the image directories can be chosen via the file selection dialog or can be entered or edited manually in the file path table. No flat-field or dark images are required because the offset or errors from flat-field or dark signals exist in all the images and, therefore, do not affect the matching of the speckle pattern, assuming the speckle image signal is much stronger than the error from the flat-field or dark signal. The software can read all the image formats that MATLAB recognizes by allowing the user to specify the image extension. The default format is the most commonly used Tagged Image File Format (TIF). During the calculation, the data are converted to 64-bit floating number format for higher accuracy.

A standard procedure for processing a set of scans at different θ with the software consists of choosing the input image directories, specifying the experimental parameters, defining the data processing parameters, and activating the data processing. Among the experimental parameters, the pitch angles for the scans can be input manually in the table. However, if they are consequential, it is less time-consuming to input the starting angle and the step size as an array, and the range of pitch angles will be generated automatically according to the number of file directories. Even if it is not possible to measure the distance, L, between the wavefront modulator and the detector accurately, the alignment will not be affected by a small offset. This distance can also be a good indication of whether the result is reasonable because the retrieved R should be slightly larger than L if the wavefront modulator was located downstream of the focus. If the result was not reasonable, one cause could be that the scan direction was set incorrectly because this determines whether the translation of the modulator s in Eq. (1) is positive or negative and changes the value of the result.

When setting the parameters for the calculation, defining appropriate regions of interest (ROIs) is not trivial because meaningless results from outside of the mirror edges could disrupt the fitting of R and calculation of the correct pitch angle. In the software, the ROI range can be manually input as pixel values or selected by dragging a rectangle over the desired region in an image window. For 1D focusing mirrors, the ROI pixel values input here are only defined in the direction orthogonal to the focusing direction because the focusing direction is automatically defined in the software for each pitch angle scan. Otherwise, when the pitch angle is changed, the image position on the detector would also change and, therefore, to manually define all ROIs for each scan angle would be time-consuming and potentially less accurate. The automatic determination of the ROI is achieved by locating the intensity drop in the normalized integrated profile of the image that occurs at the edge of the mirror. The results can also be improved by removing some pixels from the edges of the mirror reflection in case there are interference patterns or less accurately polished parts at the mirror edges that distort the calculations.

For efficient alignment, 1D processing is recommended. Parallel processing of all the scans can be chosen to speed up the calculation if many scans were taken. Tracking of the shift of the modulator is achieved computationally by 2D normalized cross-correlation and locating the local maxima with subpixel accuracy by polynomial fitting. The cross-correlation outputs can be monitored during the process although it is not recommended to be turned on all the time because it increases the processing time when plotting cross-correlation results for each pixel. After the process has finished, the optimal pitch angle is calculated by linear regression and the position of the focus is also output. For the 2D processing, extra parameters have to be set and images from only one, specified, θ value scan is chosen. The correlation window width can be set although there is a trade-off between noise and spatial resolution that needs to be considered.20 A 2D map of calculated R is produced together with the retrieved Zernike coefficients.21 

Further technical details and instructions can be found in the user guide included with the software distribution.

In this section, we describe an example of the mirror alignment using the software. The experiment was performed at the B16 Test Beamline at the Diamond Light Source synchrotron.22 An elliptical mirror with specification of source-to-mirror center distance p = 45 m, mirror-to-focus distance q = 0.235 m, and theoretical pitch angle θ = 3 mrad, which forms the vertically focusing mirror of a pair of Kirkpatrick-Baez (KB) mirrors, was tested. The randomly shaped wavefront modulator was a piece of abrasive paper with an average grain size of 5 µm. The detector was a Photonic Science scintillated CCD camera with a pixel size of 6.45 µm. The distance between the mirror and the modulator was about 0.35 m and between the modulator and detector was 2.583 m. The abrasive paper was mounted on a piezo translation stage and scanned with a 0.2 µm step size. Initially, the mirror was roughly aligned to be parallel to the beam longitudinally and to the detector horizontally with the help of direct radiography, then the pitch angle was set to the nominal value of 3 mrad. Five speckle-based scans of the wavefront modulator with pitch angles ranging from 2.97 to 3.21 mrad were measured. The ROI was chosen in the software, as shown in Fig. 3(a); R was calculated using Eq. (1), and the output is shown in Fig. 3(b). Compared to the smooth simulations displayed in Fig. 1(d), the results are heavily influenced by the signal derived from the mirror slope error, which can be identified by the same characteristic peaks appearing for each of the speckled-based scans. However, it was still possible to measure the different slopes of Ri that were induced at the different pitch angles for each scan using the 1st polynomial fitting, as shown in Fig. 3(c). From this, the best alignment pitch angle of 3.11 mrad was determined when the slope was zero. At the same time, the location of the focus at the optimized pitch angle was found to be 121.4 mm before the wavefront modulator. The time taken for the scan was 40 min by having 100 steps of the wavefront modulator at each pitch angle and 5 s per projection image, and the time taken for the calculation was approximately 30 s when 5 MATLAB workers (separate instances) were used in parallel. The scan time can be reduced by having fewer steps of the wavefront modulator and shorter exposure time per projection. Of course, at different beamlines and laboratories with different detectors, the required exposure time will vary in order to obtain a sufficient signal-to-noise ratio in the images. The example described here demonstrates that at the bending magnet beamline B16, excluding the initial manual coarse alignment, the proposed method is expected to take 5–10 min to run all the scans at different pitch angles and <1 min for the calculations to determine the optimum alignment pitch angle and the focal plane position of an X-ray mirror automatically.

FIG. 3.

(a) Screenshot of the window for choosing the ROI in the software. The speckle pattern generated by the abrasive paper as a wavefront modulator can be seen clearly. (b) The calculated R for 5 different wavefront modulator scans. (c) Linear fitting of both the slope and the average of R with respect to θ so that the optimum pitch angle and the location of focus can be determined.

FIG. 3.

(a) Screenshot of the window for choosing the ROI in the software. The speckle pattern generated by the abrasive paper as a wavefront modulator can be seen clearly. (b) The calculated R for 5 different wavefront modulator scans. (c) Linear fitting of both the slope and the average of R with respect to θ so that the optimum pitch angle and the location of focus can be determined.

Close modal

An advantage of using this speckle-based technique for mirror alignment compared with using conventional pencil-beam scanning is that it can provide detailed 2D information as well23 and an example is shown in Fig. 4. In the 2D image, the horizontal stripes deriving from the mirror slope errors from fabrication are clear to see, together with some stronger and irregular patterns that are likely due to either contamination or radiation damage. These defects can be easily identified with the 2D processing, which can provide a better understanding of the alignment result compared with 1D methods, such as pencil beam scanning. From the fitted Zernike polynomials, we can also see that the 2nd term, which represents vertical tilt, is very strong and this agrees with our expectation because in this example we used the 1st scan, with a pitch angle of 2.97 mrad. Obviously, compared to the calculated optimum alignment pitch angle of 3.11 mrad, the 2D results from this scan at 2.97 mrad should have a prominent tilt aberration. Compared to 1D, 2D processing takes a longer amount of time, and for the example in Fig. 4, the elapsed time was 101 s for a single scan. Therefore, we recommend use of the 1D process for mirror alignment and the 2D calculation for assessment of the homogeneity and defects on the mirror surface.

FIG. 4.

Screenshot showing calculation of a 2D map of R.

FIG. 4.

Screenshot showing calculation of a 2D map of R.

Close modal

An efficient and accurate method for aligning X-ray mirrors has been adapted from a speckle-based at-wavelength metrology technique. It shares similar principles as the pencil-beam scanning method, but instead of retrieving the transversal ray error, this new approach uses the longitudinal ray error to calculate the misalignment angle. Compared with conventional slit scanning, the proposed method can provide additional 2D information with the inherent advantages from the speckle-based technique. A user-friendly software tool has been developed to give the broader X-ray optic community access to automatic alignment of mirrors using an at-wavelength metrology technique based on a randomly shaped wavefront modulator. Through an intuitive graphical user interface, users can define and undertake calculations with minimal training because the software requires only the image file paths and a few parameters of the experimental setup as inputs. The example of mirror focusing demonstrates the value of the software as a fast tool to determine the optimum alignment of the mirror pitch angle and the location of the focal plane. It can also be used to produce a 2D image of the longitudinal aberrations of the mirror surface and to characterize the surface inhomogeneity and defects. The software is available to download together with a detailed user manual included in the distribution.24 

The work was carried out with the support of Diamond Light Source Ltd. We wish to acknowledge Andrew Malandain and Ian Pape for technical support at beamtime mt16534-1 on B16. T.Z. wishes to thank Sebastien Berujon and Yogesh Kashyap for early development of the software, and Douglas M. Schwarz, E. M. C. Jones, Robert W. Gray, and Joseph M. Howard for sharing their MATLAB codes.

1.
K.
Yamauchi
,
H.
Mimura
,
T.
Kimura
,
H.
Yumoto
,
S.
Handa
,
S.
Matsuyama
,
K.
Arima
,
Y.
Sano
,
K.
Yamamura
,
K.
Inagaki
,
H.
Nakamori
,
J.
Kim
,
K.
Tamasaku
,
Y.
Nishino
,
M.
Yabashi
, and
T.
Ishikawa
,
J. Phys.: Condens. Matter
23
(
39
),
394206
(
2011
).
2.
A.
April
,
P.
Bilodeau
, and
M.
Piche
,
Opt. Express
19
(
10
),
9201
9212
(
2011
).
3.
M.
Idir
,
M.
Rakitin
,
B.
Gao
,
J.
Xue
,
L.
Huang
, and
O.
Chubar
,
Proc. SPIE
10388
,
103880Z
(
2017
).
4.
W.
Yun
,
B.
Lai
,
Z.
Cai
,
J.
Maser
,
D.
Legnini
,
E.
Gluskin
,
Z.
Chen
,
A. A.
Krasnoperova
,
Y.
Vladimirsky
,
F.
Cerrina
,
E. D.
Fabrizio
, and
M.
Gentili
,
Rev. Sci. Instrum.
70
(
5
),
2238
2241
(
1999
).
5.
G. E.
Ice
,
J.-S.
Chung
,
J. Z.
Tischler
,
A.
Lunt
, and
L.
Assoufid
,
Rev. Sci. Instrum.
71
(
7
),
2635
2639
(
2000
).
6.
O.
Hignette
,
A. K.
Freund
,
E.
Chinchio
,
P. Z.
Takacs
, and
T. W.
Tonnessen
,
Proc. SPIE
3152
,
188
199
(
1997
).
7.
P. P.
Naulleau
,
P.
Batson
,
P.
Denham
,
D.
Richardson
, and
J.
Underwood
,
Opt. Commun.
212
(
4-6
),
225
233
(
2002
).
8.
T.
Weitkamp
,
B.
Nohammer
,
A.
Diaz
,
C.
David
, and
E.
Ziegler
,
Appl. Phys. Lett.
86
(
5
),
054101
054103
(
2005
).
9.
P.
Mercere
,
S.
Bucourt
,
G.
Cauchon
,
D.
Douillet
,
G.
Dovillaire
,
K. A.
Goldberg
,
M.
Idir
,
X.
Levecq
,
T.
Moreno
,
P. P.
Naulleau
,
S.
Rekawa
, and
P.
Zeitoun
,
Proc. SPIE
5921
,
592109
592110
(
2005
).
10.
S.
Berujon
,
E.
Ziegler
,
R.
Cerbino
, and
L.
Peverini
,
Phys. Rev. Lett.
108
(
15
),
158102
(
2012
).
11.
H.
Yumoto
,
H.
Mimura
,
S.
Matsuyama
,
S.
Handa
,
Y.
Sano
,
M.
Yabashi
,
Y.
Nishino
,
K.
Tamasaku
,
T.
Ishikawa
, and
K.
Yamauchi
,
Rev. Sci. Instrum.
77
(
6
),
063712
063716
(
2006
).
12.
C. M.
Kewish
,
M.
Guizar-Sicairos
,
C.
Liu
,
J.
Qian
,
B.
Shi
,
C.
Benson
,
A. M.
Khounsary
,
J.
Vila-Comamala
,
O.
Bunk
,
J. R.
Fienup
,
A. T.
Macrander
, and
L.
Assoufid
,
Opt. Express
18
(
22
),
23420
23427
(
2010
).
13.
P.
Mercère
,
M.
Idir
,
T.
Moreno
,
G.
Cauchon
,
G.
Dovillaire
,
X.
Levecq
,
L.
Couvet
,
S.
Bucourt
, and
P.
Zeitoun
,
Opt. Lett.
31
(
2
),
199
201
(
2006
).
14.
K. S.
Morgan
,
D. M.
Paganin
, and
K. K. W.
Siu
,
Appl. Phys. Lett.
100
(
12
),
124102
124104
(
2012
).
15.
S.
Berujon
,
H.
Wang
,
S.
Alcock
, and
K.
Sawhney
,
Opt. Express
22
(
6
),
6438
6446
(
2014
).
16.
Y.
Kashyap
,
H.
Wang
, and
K.
Sawhney
,
Phys. Rev. A
92
(
3
),
033842
(
2015
).
17.
T.
Zhou
,
H.
Wang
,
O.
Fox
, and
K.
Sawhney
,
Opt. Express
26
(
21
),
26961
26970
(
2018
).
18.
H.
Wang
,
J.
Sutter
, and
K.
Sawhney
,
Opt. Express
23
(
2
),
1605
1614
(
2015
).
19.
S.
Yuan
,
K. A.
Goldberg
,
V. V.
Yashchuk
,
R.
Celestre
,
I.
Mochi
,
J.
Macdougall
,
G. Y.
Morrison
,
B. V.
Smith
,
E. E.
Domning
,
W. R.
McKinney
, and
T.
Warwick
,
Proc. SPIE
7801
,
78010D
(
2010
).
20.
T.
Zhou
,
M. C.
Zdora
,
I.
Zanette
,
J.
Romell
,
H. M.
Hertz
, and
A.
Burvall
,
Opt. Lett.
41
(
23
),
5490
5493
(
2016
).
21.
V. N.
Mahajan
and
G.-M.
Dai
,
J. Opt. Soc. Am. A
24
(
9
),
2994
3016
(
2007
).
22.
K. J. S.
Sawhney
,
I. P.
Dolbnya
,
M. K.
Tiwari
,
L.
Alianelli
,
S. M.
Scott
,
G. M.
Preece
,
U. K.
Pedersen
, and
R. D.
Walton
,
AIP Conf. Proc.
1234
(
1
),
387
390
(
2010
).
23.
H.
Wang
,
Y.
Kashyap
,
D.
Laundy
, and
K.
Sawhney
,
J. Synchrotron Radiat.
22
(
4
),
925
929
(
2015
).
24.
See https://github.com/zhoutunhe/autoAlignMirror for the distribution of the software..