Characterization of the X-ray coherence properties of an undulator beamline at the Advanced Photon Source

Methods are described to measure divergence by imaging the apparent source size using either slits to form a pinhole camera or a compound refractive lens. The values of brightness and coherent flux obtained are compared with those calculated for the undulator source, to evaluate the effects of beamline optics.

In anticipation of the increased use of coherent X-ray methods and the need to upgrade beamlines to match improved source quality, here the coherence properties of the X-rays delivered by beamline 12ID-D at the Advanced Photon Source have been characterized. The measured X-ray divergence, beam size, brightness and coherent flux at energies up to 26 keV are compared with the calculated values from the undulator source, and the effects of beamline optics such as a mirror, monochromator and compound refractive lenses are evaluated. Diffraction patterns from slits as a function of slit width are analyzed using wave propagation theory to obtain the beam divergence and thus coherence length. Imaging of the source using a compound refractive lens was found to be the most accurate method for determining the vertical divergence. While the brightness and coherent flux obtained without a monochromator ('pink beam') agree well with those calculated for the source, those measured with the monochromator were a factor of three to six lower than the source, primarily because of vertical divergence introduced by the monochromator. The methods described herein should be widely applicable for measuring the X-ray coherence properties of synchrotron beamlines.

Introduction
Coherent X-ray methods are providing revolutionary new capabilities for observing nanoscale dynamics and imaging atomic structure in materials. For example, X-ray photon correlation spectroscopy (XPCS) (Stephenson et al., 2009;Shpyrko, 2014) has revealed the dynamics of atomic diffusion in crystals (Leitner et al., 2009) and glasses (Ruta et al., 2014) and atomic steps on electrode/electrolyte interfaces (Karl et al., 2015). Likewise, coherent diffractive imaging methods (Abbey, 2013) are revealing strain distributions and dislocations by using Bragg scattering (Yau et al., 2017) and surface steps by using crystal truncation-rod scattering . Beamlines specifically designed for coherent X-ray methods are enhancing these studies Fluerasu et al., 2011;Rau et al., 2011;Winarski et al., 2012).
The Advanced Photon Source (APS) and other synchrotron facilities worldwide are being upgraded or built to provide greatly increased coherent X-ray flux, using a multi-bend achromat storage-ring lattice (Hettel, 2014). As part of these efforts, new beamlines are being designed that will take advantage of the high coherent flux (Streiffer et al., 2015;Dimper et al., 2015), and optics on existing beamlines are being enhanced to preserve the coherent flux from the source (Yabashi et al., 2014). In anticipation of these developments, we are exploring coherent X-ray methods at APS beamline 12ID-D using the current source. We would like to deploy coherent X-ray methods at relatively high X-ray energies (e.g. >25 keV) to enable in situ studies of materials processing. Like most beamlines at APS, 12ID-D was not originally designed for coherent X-ray methods. Thus we are interested in understanding which beamline optics will need to be improved as part of the APS Upgrade project.
In this paper we characterize the coherence properties of the X-rays delivered by this beamline at higher energies, and compare these with the calculated values from the source. We evaluate effects of beamline optics such as a high-heat-load mirror, monochromator and compound refractive lenses. Previous studies have characterized the divergence (and thus the transverse coherence length) of the X-rays at synchrotron beamlines by measuring the apparent size of the source, using either a small aperture as a 'pinhole' camera (Borland, 1989;Mills et al., 1990;Elleaume et al., 1995;Cai et al., 1996;Sandy et al., 1999) or focusing optics to produce an image (Cai et al., 1997). Here we use both of these methods to determine divergences: measurements of vertical and horizontal diffraction patterns from slits, and measurements of the vertical focus size produced by a compound refractive lens. With the former method, we go beyond previous work by varying the slit width to quantify both the Fraunhofer (smallwidth) and Fresnel (large-width) limits and optimize the intermediate pinhole image case. With the latter method, we focus both the monochromatic beam and the pink beam (without a monochromator), to characterize the effect of the monochromator on the vertical divergence. Measured beam sizes and fluxes are combined with these divergences to obtain emittance, brightness and coherent flux. All of these quantities are compared with values calculated for the undulator source, to understand the effect of beamline optics. The methods we describe to characterize coherence properties are of general applicability to synchrotron X-ray beamlines.

Expressions for coherence properties
The transverse coherence length is inversely related to the beam divergence (angular spread through a point) r, and is proportional to the wavelength . The relationship between and r includes a numerical factor that differs among references (Sutton et al., 1991;Libbert et al., 1997;Vlieg et al., 1997;Jacques et al., 2012), primarily because it matters whether and r are considered to be root-mean-square values (e.g. the standard deviation of a Gaussian distribution) or are considered to be full width at half-maximum (FWHM) values. Here we will use FWHM values, and the formula The divergence r as well as the overall beam size s typically change as a function of distance from the source. For perfect optics that accept the full size of the beam, the conserved quantity is the product of divergence and beam size, known as emittance ", " r s: In the simplest case where the optics deflect the beam only in the vertical or the horizontal, we expect the vertical and horizontal emittances " v r v s v and " h r h s h to be separately conserved. Another quantity conserved by perfect optics is the spectral brightness B. Using FWHM values for the divergences and sizes entering into the emittances, the expression for B is where F is the spectral flux. The spectral flux can be obtained from the total flux F tot by accounting for the energy bandwidth used in the measurement, where 0.1% is the standard bandwidth for spectral flux or brightness, and Á= is the experimental bandwidth for F tot . Imperfections in the optics can decrease the delivered brightness by reducing the spectral flux or increasing the emittances.
The spectral coherent flux F coh is proportional to the brightness and wavelength squared, One can see that the coherent fraction F coh =F is simply given by the ratios of the transverse coherence lengths to the beam sizes s in the two directions.

Measurements of beam divergence
In the far field of the source, the beam divergence r is a measure of the (apparent) angular size of the source. Here we characterize the divergence of the X-ray beam delivered to the 12ID-D hutch by two methods: measuring the diffraction pattern from slits as a function of slit size; and measuring the focal line width created by a compound refractive lens imaging the source. The second method is found to be more sensitive (Cai et al., 1997), and it is required to observe the effect of the monochromator on the vertical divergence. Fig. 1 shows a schematic of the X-ray optics at APS beamline 12ID-D and the experimental setup for character-izing the vertical and horizontal divergences using diffraction from slits. The X-ray source for the C and D stations is a 3.0 cm-period undulator of 2.01 m effective length, located 1.25 m upstream of the nominal center of the straight section in the storage ring. Distances from the source given in Fig. 1 are from the center of this undulator. The primary beamline optics consist of a horizontally deflecting mirror operating at a 4.2 mrad deflection angle, as well as a Si(111) double-crystal cryogenically cooled monochromator with a vertical diffraction plane (Ramanathan et al., 1995). The mirror has active heating on its back side to counteract the beam heating and control its overall radius of curvature. For these measurements, the mirror is positioned to use its Pt coating stripe, which gives a critical energy for total reflection of E c = 40.5 keV. The beamline operates 'windowless', with a differential pump rather than a Be window separating the beamline vacuum from the storage ring vacuum. Downstream, two unpolished 0.5 mm-thick Be windows are present in the setup, at 51 and 67 m from the source. Other downstream flight path windows are made of materials with uniform electron density and smooth surfaces (e.g. Kapton film) to avoid any X-ray wavefront disturbance.

Diffraction from slits
We analyzed diffraction patterns from slits to characterize the vertical and horizontal divergences of the X-ray beam. Diffraction patterns were recorded on a high-resolution area detector consisting of a phosphor (Lu 3 Al 5 O 12 :Ce) imaged onto a high-resolution scientific CMOS camera having 2560 Â 2160 pixels of spacing 6.5 mm (Andor Technologies Neo sCMOS, Model DC 152Q-COO-FI). The optical magnification was 7.5, giving an effective X-ray pixel size at the phosphor of p = 0.868 mm. This detector was located at the back of the 12ID-D hutch, at a distance of 74.76 m from the source. Diffraction patterns were measured from slits at two different distances from the source and detector. Slits B, located at the front of the 12ID-D hutch at L s = 68.51 m from the source and L d = 6.25 m upstream from the detector, were used to measure both vertical and horizontal diffraction patterns. They were JJ X-ray AT-F7-AIR ESRF-style crossed slits with modified slit edges. Tungsten carbide cylinders of 2.4 mm diameter were mounted along the edges of the slit blades to provide straight polished edges. Slits A, located in the beamline at L s = 50.68 m from the source, were also used to measure vertical diffraction patterns with a larger slit-to-detector distance, L d = 24.08 m. These slits had flat tungsten knife edges. Fig. 2 shows a typical diffraction pattern from slits B as a function of diffraction angle '. Here ' is obtained using an angular spacing per detector pixel of p=L d . The crossed slits produce a central peak surrounded by fringes in both directions. Since rectangular slits produce diffraction patterns that are simply the product of those from linear slits in each direction, we can extract the separate patterns from the vertical and horizontal slits by integrating in the transverse direction. Regions shown by dashed lines in Fig. 2 were used to obtain separate vertical and horizontal diffraction patterns. Fig. 3 shows the resulting vertical diffraction pattern. The observed diffraction patterns show a high background level that is not present in the calculated patterns shown in Fig. 6 below, which likely arises from light scattering within the detector phosphor. Nonetheless, the high spatial resolution of this detector system allows accurate determination of the fringe positions and the central peak width. Analysis of the fringe spacing can be used to accurately determine the slit width w in the Fraunhofer region, while analysis of the width of the central peak as a function of w can be used to determine (or put an upper limit) on the divergence r of the beam incident on the slits.
3.1.1. Fraunhofer diffraction from asymmetric slits. Here we obtain the relation needed to extract the slit width from the fringe spacing in diffraction patterns from asymmetric slits. In Figs. 2 and 3 it is apparent that the diffraction pattern is not symmetric about zero, and detailed examination shows that the fringe spacing varies with angle. This asymmetric pattern    arises because the opposite blades of the vertical and horizontal slits are offset from each other along the beam direction so that the blades do not collide when the aperture closes completely. Fig. 4 shows the geometry of such asymmetric slit blades and the definitions of the slit width w, the offset t, the diffraction angle ' and other quantities used in the diffraction analysis below. Slits A and B have offsets of t = 30 and 3.8 mm, respectively.
Such asymmetric slits have been used and analyzed in several previous X-ray studies (Lang et al., 1987;Libbert et al., 1997;Vlieg et al., 1997;Le Bolloc'h et al., 2002), and their farfield (Fraunhofer) diffraction pattern has been calculated. The diffraction intensity from an asymmetric linear slit in the Fraunhofer limit is given by (Le Bolloc'h et al., 2002) where k = 2= is the X-ray wavenumber. This result is similar to the standard formula for Fraunhofer diffraction from a symmetric linear slit, but with the slit width w replaced by an effective slit width w 0 . In the limit of small ', the effective width is given by (Le Bolloc'h et al., 2002) which depends on the diffraction angle '. This result can be simply understood by writing the Fraunhofer intensity as where Á is the path length difference between rays incident on each edge of the slit. From Fig. 4, one can calculate Á as From equations (6) and (8) one can see that the Fraunhofer diffraction pattern has a central peak at ' = 0, with a FWHM in ' of 0:886=w, surrounded by fringes spaced in ' by =w 0 . For asymmetric slits (non-zero t), the spacing of the fringes varies with ', because w 0 varies with '. The positions of the minima that separate the fringes are given by ' n = n=w 0 , where n is a positive or negative integer. At these positions, the path length difference across the slit is a multiple of the wavelength, Á = n. The index n is related to the angles ' n of these minima by which contains a quadratic term proportional to t as well as a linear term proportional to w.
It is compelling to attribute the fringe spacing variation with ' to the change in the apparent slit width a as a function of viewing angle, as shown in Fig. 4. In this case one would simply modify the standard Fraunhofer formula by replacing the slit width w by its apparent width a (Vlieg et al., 1997). However, this produces a correction that is off by a factor of two, since a is not equal to w 0 of equation (7), A fit to data using equation (6) with a instead of w 0 and allowing t to vary will give a value of t that is a factor of two smaller than the actual offset. We recorded sets of diffraction patterns at various slit width settings at X-ray photon energies of 12.0 and 22.1 keV ( = 1.033 and 0.561 Å ), using the first and third harmonics of the undulator, respectively. We determined the actual slit widths w for the diffraction patterns that corresponded to the far-field limit [w ( ð0:886L d Þ 1=2 ] by extracting the positions of several minima ' n at positive and negative n, and fitting to equation (10). Fig. 5 shows a typical fit, allowing the slit width w and the zero value of the measured ' to vary. The quadratic dependence of the index on angle given by the formula agrees well with the observed values.
The differences between the uncalibrated slit width positioner settings and the actual widths w were found to be Schematic of the geometry of the asymmetric slits used for diffraction measurements (with expanded vertical scale), showing the slit width w, slit offset t, diffraction angle ', maximum path length difference Á ' À t and apparent slit width a.

Figure 5
Fitting of observed positions of minima in the diffraction pattern in Fig. 3 (red solid circles) to obtain slit B width w = 2.61 mm, using the formula given in equation (10) (black curve) with a slit offset of t = 3.8 mm. Also shown (blue open circles) are the minima from a wave propagation theory calculation using these values of w and t.
constant to within 1.5 or 0.5 mm FWHM for slits A or B, respectively, indicating that the main inaccuracy of the positioner setting was a simple offset. For the diffraction patterns with larger slit widths not satisfying the far-field criterion, the width w could not be determined as described above. Therefore we used a width obtained by correcting the positioner settings by the offset determined from the smaller slit widths. This gave adequate accuracy for the larger slit widths.
3.1.2. Wave propagation theory for diffraction from asymmetric slits. To analyze the full width of the central peak as a function of w to determine the divergence r of the incident beam, we require a theory that applies to the full range of slit widths spanning the far-field and near-field regions (Fraunhofer and Fresnel diffraction). We can calculate such diffraction patterns by propagating the optical wavefield from the source, through the slits, to the detector in the paraxial approximation using Fourier methods (Tan, 2016). Here we use a spherical wave from a point source, propagating a distance L s to the first slit blade, then a distance t to the second slit blade, then a distance L d to the detector. At each position along the beam direction, the wavefield can be expressed as an amplitude that varies in the transverse coordinate. At each slit blade position, we calculate the incident wavefield amplitude propagated from the previous position, and then the region of the wavefield blocked by the blade is set to zero. Calculations are conveniently made in MATLAB on a discrete lattice of points transverse to the beam direction using fast Fourier transforms (FFTs) (Tan, 2016). The amplitude propagated to the detector is then squared to give the diffracted intensity in spatial coordinates. These are converted to standard angular coordinates ' by dividing by L d , to obtain I wp ð'Þ for an ideal point source.
To include the effect of a finite source size, we convolute I wp with a finite angular resolution function R, where here we approximate the resolution function by a Gaussian, In principle this angular resolution contains contributions from both the divergence of the beam incident on the slit due to the finite source size and the exit angle resolution due to the finite spatial resolution of the detector. However, the high spatial resolution of the detector system used corresponds to a negligible angular contribution ( p=L d = 0.14 mrad or 0.04 mrad for slits A or B, respectively). Thus any measured broadening of the central peak above the ideal width of I wp provides a measure of the source size and thus the incident beam divergence r at the slit position. Since r is defined as the FWHM of the angular distribution, it is related to R by r = 2ð2 ln 2Þ 1=2 R . Fig. 6 shows typical calculated diffraction patterns I conv ð'Þ for slit B with various widths, using an incident beam divergence of r = 2 mrad and energy 22.1 keV. The widths are chosen to span a range from the Fraunhofer to the Fresnel limit. In the Fraunhofer limit, we see a similar variation in fringe spacing with angle as in the experiments. To check the consistency of the wave propagation analysis with the Fraunhofer formula for the minima, equation (10) To obtain the incident beam divergence at the slit position, we analyzed the FWHM of the central peak in the measured diffraction patterns as a function of the calibrated slit width. These values are shown as symbols in Figs. 7 and 8 for the horizontal and vertical directions, respectively. For the horizontal direction, Fig. 7, patterns were measured using slit B at 12.0 and 22.1 keV; we also investigated the effect of the curvature of the beamline horizontally deflecting mirror, as controlled by heating its back side. For the vertical direction, Fig. 8, patterns were measured using both slits A and B at both 12.0 and 22.1 keV. Mirror heating did not affect the vertical intensity profiles.
The dashed lines in Figs. 7 and 8 show the diffraction limit r d = 0:886=w for the far-field (Fraunhofer) region at small w. The dash-dot lines show the ' angle corresponding to the projection of the slit width onto the detector, r w = wðL s þ L d Þ=ðL s L d Þ, which gives the asymptotic value for the near-field (Fresnel) region at large w. On a log scale, these asymptotes form limiting 'V' shapes for the divergence, with a minimum at r d = r w given by Vertical intensity profiles I conv ð'Þ calculated using wave propagation theory for slits B at 22.1 keV using the widths w given in the legend, t = 3.8 mm, r = 2 mrad.
At this slit width the detector is at the boundary between the near-field and far-field regions of the slit. If the beam divergence r incident on the slit exceeds r min , its contribution will dominate over those of r d and r w for slit widths near w min , and it can be accurately determined from the observed FWHM of the slit diffraction. In this case, the central peak forms a 'pinhole camera' image of the source. The best resolution (minimum r min ) for fixed beamline length L s þ L d occurs with the aperture half way to the source, L s = L d , giving r min = ½3:54=ðL s þ L d Þ 1=2 , w min = ½0:222ðL s þ L d Þ 1=2 . The solid curves in Figs. 7 and 8 show the FWHM of the central peak of I conv calculated from wave propagation theory convoluted with various divergences r. The value of r for each curve has been adjusted to best fit the corresponding data points. For the horizontal direction, Fig. 7, the incident beam divergences are larger than r min in all three cases, so that the central peak FWHM at the minimum is determined by a pinhole camera image of the source. For the vertical direction, Fig. 8, the incident beam divergences are not sufficiently larger than r min to clearly distinguish their contributions.
In Fig. 8, one can see that the measured data fall below the best-fit curves and the limiting asymptotes r w at all large slit widths, especially for slit A. One explanation for this effect is that wavefront distortions introduced by the monochromator increase the effective distance to the source, so that the projection of the slit width onto the detector is smaller than expected. Fig. 9 shows calculated curves using effective source distances L eff s corresponding to source positions L eff s þ L d = 100 and 400 m at 12.0 and 22.1 keV, respectively. These values were varied along with r to give the best fits to the data. Allowing the effective source positions to vary avoids skewing the r v values to attempt to fit the deviations at large w apparent in Fig. 8. Thus we expect that the r v values obtained from the fits in Fig. 9 are most reliable.   Table 1, using actual slit and source positions. Dashed lines: diffraction limit for perfect resolution for each wavelength. Dash-dot line: slit width contribution to resolution.

Figure 8
Symbols: measured vertical FWHM of the central peak as a function of calibrated slit width, at 12.0 and 22.1 keV, for slits A and B. Curves: calculated FWHM, for best-fit incident divergences given in Table 2, using actual slit and source positions. Dashed lines: diffraction limits for perfect resolution for each wavelength. Dash-dot lines: slit width contributions to resolution for each slit.

Figure 9
Same data as in Fig. 8, fit to calculated curves by varying incident divergences (results given in Table 2 Tables 1 and 2 give the best-fit values for the horizontal and vertical beam divergences r h and r v , respectively, obtained from the fits. These are compared with the calculated minimum divergences r min at the intersections of the asymptotes. All of the fit values of r h exceed the corresponding r min values, and thus should be reasonably accurate. Because the values of r min for slit B are larger than those for slit A, we expect the values of r v from slit B to be less accurate, so we list them in parentheses. In both tables, we also show the transverse coherence lengths calculated from the divergences using equation (1).

Focal line width
Because of the small vertical source size, the divergence of the incident beam in the vertical is too small to definitively measure using slit diffraction, even using slits A located in the beamline a large distance from the detector. We therefore investigated an alternative method, using a focusing optic to image the apparent source size. Fig. 10 shows schematics of the setups used to measure vertical focal line widths, both with the cryogenically cooled Si(111) monochromator in place and with the monochromator removed ('pink beam'). In both cases, a vertically focusing compound refractive lens (CRL) consisting of a set of 42 individual double-concave Be lenses with 200 mm tip radii (obtained from RXOPTICS Refractive X-RAY Optics, Monschau, Germany) was installed at a distance L s = 67.40 m from the source. A 100 mm vertical aperture was placed in front of the CRL. The undulator gap was tuned so that its third harmonic peaked at 25.75 keV. For this X-ray energy, an image of the vertical source size was formed at a distance L d = 4.84 m downstream of the CRL. We measured the vertical focal line width by scanning a small slit C through the focus. Intensities were monitored upstream of the slit using an ion chamber and downstream of the slit using a glass cover slip scattering into a PIN diode.
For the monochromatic case, the combination of monochromator and horizontal mirror effectively removed harmonics at energies other than 25.75 keV. For the pink-beam case, an 8 m length of flight path upstream of the CRL was filled with N 2 gas at 1 atm, to absorb most of the lower (first and second) harmonics of the undulator spectrum. Because of the strong E 2 dependence of the CRL focal length on photon energy, only the 25.75 keV third harmonic of the undulator contributed significantly to the sharp focus. The contribution to the focal line width of the energy bandwidth of the third harmonic can be estimated as s CRL v Á=, where s CRL v is the size of the aperture at the CRL. Using the radial width of a Bragg peak from an analyzer crystal, we measured the bandwidth of the undulator third harmonic to be Á= = 8.5 Â 10 À3 . For s CRL v = 100 mm, this gives a contribution of only 0.85 mm to the focal line width. The contribution from diffraction at the aperture, 0:886L d =s CRL v , was 2.1 mm. Fig. 11 shows measured focal line profiles at 25.75 keV with the monochromator in place, and with it removed. The divergence of the beam incident on the CRL is given by where s src and s foc are the sizes (FWHM) of the apparent source and determined focus, respectively. The measured focal line widths with the monochromator in place and removed were 10.6 AE 1.1 and 3.2 AE 0.3 mm FWHM, respectively. We  Table 1 Horizontal divergences r h obtained from fits in Fig. 7

Figure 10
Schematic of the beamline optics at 12ID-D and the setups for measuring vertical divergence by imaging the source using a compound refractive lens, (a) with a monochromator, (b) without a monochromator (pink beam).
deconvoluted the contributions from the measurement slit C size, aperture diffraction and, in the case of pink beam, bandwidth, to obtain s foc = 9.9 AE 1.1 and 2.0 AE 0.4 mm, which correspond to divergences of 2.06 AE 0.23 and 0.42 AE 0.08 mrad, respectively, at the CRL. As summarized in Table 3, the much smaller value obtained with pink beam indicates that the monochromator introduces significant vertical divergence. The pink-beam divergence of 0.42 mrad measured with the CRL is significantly smaller than the limiting values r min available with slit diffraction. Thus, aberrations in the CRL which contribute to the measured divergence are evidently sufficiently small that this method can measure much smaller beam divergences than is possible with slits.

Summary of divergence and emittance measurements
To obtain the emittances from the divergences measured using slits, we also measured the beam sizes by scanning slit B, set to a small aperture, across the beam and monitoring the transmitted intensity. (For the focal width measurements, we scanned slit C with the CRL removed.) Estimated errors were AE 10% of the beam size. Here we summarize the measured divergences, beam sizes and emittances, and compare them with ideal calculated values for the undulator source, as a function of photon energy.
In the far field of the source, the ideal divergence of the X-ray beam is determined by the size of the source, and the ideal size of the X-ray beam is determined by the divergence of the source (Borland, 1989). The r.m.s. (Gaussian sigma) electron beam source sizes e and divergences 0 e for APS sector 12 with the 2.51 nm rad lattice are eh = 274 mm, ev = 11.0 mm, 0 eh = 11.3 mrad and 0 ev = 3.6 mrad, for the horizontal and vertical, respectively (Emery, 2017). The contribution to the source divergences from the intrinsic photon divergence (Kim, 2009) for an undulator of length ' u = 2.01 m is 0 r = ð=' u Þ 1=2 = 7.2 mrad (r.m.s) at 12 keV and 5.4 mrad (r.m.s) at 22.1 keV. The total source divergence for each direction is the sum in quadrature of the electron beam and intrinsic photon terms, 0 = ð 0 2 e + 0 2 r Þ 1=2 . The intrinsic photon contribution to the source size is negligible in our case, so that = e . In the far field at a distance L s from the source, the ideal FWHM beam size s 0 = 2ð2 ln 2Þ 1=2 L s 0 , and the ideal FWHM incident beam divergence through a point is r 0 = 2ð2 ln 2Þ 1=2 =L s . The ideal transverse emittance is given by " 0 = r 0 s 0 = ð8 ln 2Þ 0 . Fig. 12 summarizes the far-field divergences, sizes and emittances in the horizontal direction at the position of slits B. Because the beamline mirror can focus or defocus the beam in the horizontal, depending upon the X-ray heat load on its front surface and the active heating applied to its back, the measured divergence and beam size can be above or below the calculated source values that do not account for optics. We see that when the undulator first harmonic is tuned to 12.0 keV  Table 3 Vertical divergences r v and coherence lengths v obtained from focal line width measurements using the compound refractive lens at L s = 67.40 m and 25.75 keV, with and without the monochromator.

Figure 12
Comparison of measured 12ID-D horizontal divergence, size and emittance (symbols) with the ideal values from the source (curves) as a function of photon energy, for a source distance of L s = 68.51 m.

Figure 11
Comparison of vertical focus profiles with monochromatic and pink beam at 25.75 keV. Observed widths were 10.6 and 3.2 mm FWHM, respectively.
(gap = 20.3 mm), giving a total power of 431 W and central power density of 10.6 kW mrad À2 , the horizontal divergence measured is larger than that calculated from the source, and the measured beam size is smaller, indicating a focusing effect of the beamline mirror when no heating is applied. In contrast, when the undulator third harmonic is tuned to 22.1 keV (gap = 13.8 mm), giving a total power of 1807 W and central power density of 44.4 kW mrad À2 , the measured divergence is smaller and the measured beam size is larger than calculated, indicating a defocusing effect with no applied heating. Applying a power of 10 W to the back of the mirror under these conditions slightly overcompensates the effect of beam heating.
The source emittance will be conserved by ideal focusing optics that accept the full size of the beam. Indeed, the measured horizontal emittances are in good agreement with the source calculations for all three cases, indicating that the mirror focusing is almost ideal. Fig. 13 summarizes the far-field divergences, sizes and emittances in the vertical direction. For 12.0 and 22.1 keV, we show the divergence values obtained from slits A (the fit using an effective source distance), scaled by 50.68 /68.51 to correspond to the position of slits B. Likewise the divergences and beam sizes obtained from the CRL line focus measurements are appropriately scaled to correspond to the position of slits B. One can see that for monochromatic beam the vertical divergences all exceed the calculated source value by a factor of three to five, while with no monochromator (pink beam) the divergence is in excellent agreement with the calculation. This indicates that the monochromator is the primary source of increased vertical divergence. The larger divergence at 22.1 and 25.75 keV relative to 12.0 keV could be related to the higher thermal load on the monochromator at these energies.
While the vertical beam size matches the calculation at 12.0 keV, it becomes successively smaller at higher energies. One possible contribution to this effect would be an overall curvature of the monochromator crystals, which can act to focus or defocus the beam (Antimonov et al., 2016). The observed reduction in beam size at 25.75 keV would require a change in angle of 20 mrad across the vertical beam profile. Another contribution could be aperturing due to misalignment of the angular bandpasses of crystals of two curvatures. As the Darwin width of the Si(111) reflection decreases from 23 mrad at 12.0 keV to 10 mrad at 25.75 keV (Stepanov, 2016), and the footprint of the beam on the crystal surfaces increases from 4.0 to 6.6 mm, an overall curvature difference of 20 mrad over 5 mm would act as an effective aperture on the transmitted beam at higher energies.
The overall size of the pink beam from an undulator is much larger than that of the monochromatic beam at the on-axis peak of the undulator spectrum, because the radiation distribution from the undulator extends out to larger angles with an energy that decreases with increasing angle (Kim, 2009). We did not independently measure the beam size of the 25.75 keV component of the pink beam, but simply used the size determined with the monochromator in place to calculate the vertical emittance for the pink beam. At first glance, it is surprising that the emittance value obtained is smaller than the calculated source value. However, the emittance can be reduced by simply putting an aperture in the beam, down to the diffraction limit of " = 0.886 = 0.04 nm rad at E = 25.75 keV. Such an aperture would not increase the brightness, since it also reduces the flux. Using an aperture the size of the coherence length would select the coherent fraction of the beam, as indicated by equation (5). Thus the reduction in the pink emittance calculated using the monochromatic beam size, to a value below that of the source, is consistent with an aperturing effect of the monochromator.

Brightness and coherent flux
We measured the X-ray flux using an air ion chamber at a storage ring current of 100 mA. The total flux F tot in photons per second incident on an ion chamber is proportional to the ion chamber current I ic when the bias voltage is in the 'plateau' region (Cherry et al., 2003). The two can be related by where Q ph is the average charge created per photon. This can be calculated from Comparison of measured 12ID-D vertical divergence, size and emittance (symbols) with the ideal values from the source (curves) as a function of photon energy, for a source distance of L s = 68.51 m.
where e = 1.6 Â 10 À19 C is the electronic charge, the second factor gives the fraction of photons absorbed in the collection length ' ic = 6 cm of the chamber, and the third factor gives the number of ions created by a photoabsorption event. We use values of the photoabsorption length ' pa calculated from the elemental photoabsorption cross sections and gas densities for air at 1 atm (N 1.56 O 0.42 Ar 0.01 ) (Henke et al., 1993;Gullickson, 2010) and a value of E ion = 34.4 eV (Thompson, 2009). The values obtained for Q ph are 1.14, 0.30 and 0.22 Â 10 À18 C at 12.0, 22.1 and 25.75 keV, respectively. At 22.1 and 25.75 keV, we were able to reach the plateau of constant ion chamber current versus voltage at $ 2300 V across a 12 mm gap. At 12.0 keV, we were not able to reach the plateau, and we report values for the highest voltage of 3000 V. We have found that these values correspond well with fluxes obtained using a He ion chamber operating in its plateau region. Estimated overall errors were AE 10% of the measured total flux. Fig. 14 gives the measured and calculated spectral flux F, brightness B and coherent flux F coh . Measured total fluxes have been converted to spectral flux using equation (4) with a calculated bandwidth of Á= = 0.131 Â 10 À3 for the Si (111) monochromatic cases (Stepanov, 2016), or the measured value Á= = 8.5 Â 10 À3 for the pink-beam case. For monochromatic beam, we measured the total flux in the full beam size, and calculated B and F coh using equations (3) and (5). The horizontal divergence was not measured at 25.75 keV but was estimated to be 22 mrad from the average horizontal emittance measured at 22.1 keV divided by the measured horizontal beam size of 1.0 mm at 25.75 keV. For pink beam, we measured the on-axis total flux in an area 0.12 mm Â 0.10 mm (H Â V) at L s = 68.5 m to be 1.77 Â 10 13 photons s À1 . The value of F plotted in Fig. 14(a) was estimated by scaling to the measured monochromatic beam area at 25.75 keV. Reasonable agreement between the spectral flux values for the pink and monochromatic cases indicates that this estimate is valid. Pink-beam brightness was calculated by dividing the spectral flux by this area, the measured pink vertical divergence, and the estimated monochromatic horizontal divergence. Thus uncertainty in the overall size of the pink beam does not affect the calculated B or F coh values.
The undulator performance was calculated using standard APS simulation codes. The undulator parameters at 12ID-D were 3.0 cm period, 2.01 m effective length (effective N = 67), and calculations were performed for a ring current of 100 mA. Values presented here are from the codes TC (Sanchez del Río & Dejus, 2011) and TCAP which account for the imperfections of a typical APS undulator. We also ran calculations at specific energies with code UR (Dejus & Luccio, 1994) using the measured magnetic field imperfections in the specific 12ID-D undulator APS30#5S; the values obtained agree with those presented within 2% for brightness and 8% for flux. The relationships given in equations (3) to (5) above between the brightness, flux and beam parameters are obeyed within 2% by the values presented. These calculated values are significantly below those given by the analytical equations for an undulator with no imperfections (Kim, 2009), especially at higher X-ray energies.
The measured spectral fluxes are similar to or lower than the source calculations by up to a factor of 2.6. For monochromatic beam, the measured brightness and coherent flux are lower than the calculations by a factor of three to six, while for pink beam they agree well. The lower spectral flux but almost equal brightness for pink beam, relative to the calculated values, is consistent with an aperturing effect on the monochromatic beam, since we used the monochromatic beam size in estimating the pink-beam spectral flux.

Summary and conclusions
In using diffraction from slits to characterize beam divergence, it was convenient to obtain accurate values for the slit width w as a function of the positioner setting by measuring the spacing of the fringes in the Fraunhofer diffraction regime. We observed a variation in the fringe spacing as a function of diffraction angle that arises because of the non-zero offset t of the asymmetric slits (Fig. 4). The relationship derived in equation (10) agrees with experimental values and wave propagation theory (Fig. 5). Comparison of measured 12ID-D flux, brightness and coherent flux (symbols) with the ideal values from the source (curves) as a function of X-ray energy for 100 mA ring current.
Using the Fraunhofer fringes to calibrate the slit widths, we obtained values of the FWHM of the central diffraction peak as a function of slit width (Figs. 7, 8 and 9) that span from the Fraunhofer (small w) limit to the Fresnel (large w) limit. At intermediate values of w, the observed FWHM can be dominated by a pinhole camera image of the source size s src , if the divergence r = s src =L s from the source size is larger than the minimum observable divergence r min given in equation (14). The measured FWHM versus slit width values were well fit by curves calculated from wave propagation theory, especially if the effective source distance was allowed to vary for the vertical case (Fig. 9). We were able to obtain accurate values for the horizontal divergence, since in this case r is significantly larger than r min .
More accurate values for the relatively small vertical divergence were obtained using an alternative method, imaging of the source with a CRL. After deconvoluting effects from aperture diffraction, detector resolution and finite bandwidth, we obtained a divergence as small as 0.42 mrad at L s = 68.51 m for pink beam at 25.75 keV with the monochromator removed, Fig. 13(a), in excellent agreement with that calculated from the source. Imaging the source with a focusing optic such as a CRL, rather than pinhole imaging with a slit, is required to measure the vertical divergence of current synchrotron sources such as APS. For future multibend achromat sources such as the APS Upgrade, this method will also be needed to determine the horizontal divergence, when the horizontal source size will be similar to the current vertical source size (Hettel, 2014).
Our measurements allow evaluation of the effects of various beamline optics on the coherence properties of the X-ray beam. The horizontally deflecting high-heat-load mirror, which was in place for all measurements, performed well to preserve the horizontal emittance of the source, as shown in Fig. 12(c), although it focused or defocused the beam depending upon the X-ray heat load on its front surface and the applied heating to its back surface. This horizontally deflecting mirror did not affect the vertical divergence of the beam. The requirements for the figure of such a mirror will be much more exacting after the APS Upgrade, with the much smaller horizontal source size.
The good agreement of the measured pink-beam vertical divergence and the source calculation indicates that the focusing CRL preserved the vertical emittance. Thus, CRLs will be good options for focusing coherent beams at higher energies such as 26 keV.
When the monochromator was in place, we observed vertical divergences that were factors of three to five higher than the calculated source values. While the vertical beam size was smaller than the calculated values at higher energies, the net effect was to produce a higher emittance at all energies investigated. The total flux also tended to be lower than calculated. These led to degradation of the brightness and coherent flux by factors of three to six below the calculated values. Furthermore, fits of the slit diffraction central peak FWHM as a function of slit width (Fig. 9) in the Fresnel region indicated an apparent source distance larger than the actual distance. All of these effects are consistent with aberrations in the monochromator (Antimonov et al., 2016) arising from thermal or mounting strains of the crystals. Further work will be needed to understand and potentially improve the monochromator performance to deliver the full brightness and coherent flux. The current monochromator is a typical APS cryogenic design (Ramanathan et al., 1995); other monochromator designs have been optimized for coherence preservation (Winarski et al., 2012). Because the vertical divergence of the current APS source is similar to what it will be after the APS Upgrade, achieving coherent flux values approaching the ideal with a vertically diffracting monochromator and the current source will demonstrate the typical improvements needed to take full advantage of the revolutionary multi-bend achromat upgrade of the accelerator.
The brightness measured with pink beam provides a quantitiative validation of the undulator modeling codes, indicating that the very high brightness values at high energy calculated for APS Upgrade conditions will indeed be reached. Furthermore, the current availability of high coherent flux at high energy using pink beam (e.g. 9 Â 10 10 photons s À1 at 25.75 keV in a 0.85% bandwidth) will allow us to begin exploring high-energy coherent X-ray methods in experiments (such as XPCS from surface dynamics scattering near the specular direction) for which a wide bandwidth can be used. We can then look forward to more widely applying these techniques in the future using high-flux high-energy monochromatic coherent beams from the new coherent X-ray sources.