research papers
Statistical measures of spottiness in diffraction rings
^{a}Callaghan Innovation Research Ltd, PO Box 31310, Lower Hutt, 5040, New Zealand
^{*}Correspondence email: bridget.ingham@callaghaninnovation.govt.nz
Spotty diffraction rings arise when the size distribution of crystallites illuminated by the incident beam includes crystallites that are large compared with the size of the beam. In this article, several statistical measures are used in conjunction to quantify spottiness and relate it to a crystallite size distribution: the number of peaks, the normalized root mean square intensity variation and the fractal dimension. These are demonstrated by way of example using synchrotron Xray diffraction patterns collected during in situ corrosion of mild steel in carbon dioxidesaturated aqueous brine.
1. Introduction
Xray diffraction is a versatile technique for obtaining information about crystalline materials (Warren, 1969). Methods for analysing singlecrystal diffraction and powder diffraction data are well established. These represent two extremes of crystal orientation distributions: singlecrystal diffraction involving one crystal, and powder diffraction involving a large number of crystallites of small size relative to the incident beam, with random orientations, so that the ensemble of diffraction spots appears on a twodimensional detector as an isotropic ring. Between these extremes, where there are a limited number of crystals in the incident beam, the number of crystals that are illuminated by the beam is insufficient to give a powder average and as a result spotty diffraction rings are observed, particularly when using area detectors. Experimental methods to overcome this problem involve spinning or rocking the sample during the measurement, to cause the pattern to resemble a powder average. However, this is not practical in all cases; grazingincidence measurements of thin films, for example, require the incident angle to be small and to be kept constant, meaning that rocking the sample about the goniometer axis is out of the question.
Although the presence of a spotty diffraction ring is often dismissed as being due to the sample having crystals that are large relative to the incident beam cross section, it is possible to extract useful information from spotty diffraction rings. Crystal size is commonly estimated from powder diffraction line breadths using the Scherrer equation (Warren, 1969), which is limited to crystallite sizes smaller than ∼100 nm (depending on instrument parameters). Alternative methods have been published for extracting a volumeaveraged crystal size from a spotty diffraction ring. The simplest method is to count the spots (Hirsch, 1954) and, from the angular range, the multiplicity of the reflection, the sampling volume and the instrument window, determine the average crystal size (He, 2011). A variation on this method involves taking a series of exposures on photographic film with different exposure times. This generates a series of threshold intensities, from which the number of grains of different volumes can be extracted (Hirsch, 1954). Recently, a method has been proposed whereby the intensities of the spots are used, rather than merely counting how many there are (RodriguezNavarro et al., 2006). This has the advantage of greater accuracy, since the differences in intensity are generally of the order of 10^{5}, while the maximum number of spots observable is of the order of 10^{2}. However, the method requires calibration using samples of the same material with known grain sizes. Both methods enable crystal sizes in the range 1–100 µm to be measured, although at the low end of this scale there are limitations due to significant peak overlap if the beam size is large, and at the high end of the scale sample heterogeneity can result in large uncertainties.
For both counting and intensity methods, a single value for the volumeaveraged crystal size is obtained. However, this is of limited value if the crystal size distribution is broad or multimodal. Since the number of spots is related to the number of diffracting crystals illuminated by the beam, and the width of the spots is inversely related to the crystal size, one should be able to quantify, at least partially, the size distribution of crystals contributing to a spotty diffraction ring. An example of the phenomenon arose in an in situ synchrotron Xray diffraction study of mild steel being corroded in an aqueous CO_{2} environment: the Fe(110) diffraction ring became visibly more spotty over time, and this was attributed to preferred dissolution of small grains, upsetting the powder average (Ingham et al., 2010). However, no attempt at a quantified analysis of the change in the crystal size distribution was made in that case.
In this article, several statistical measures are used to describe the spottiness of diffraction rings. These are applied to Xray diffraction data obtained from experiment and calculated from a predetermined size distribution of crystals.
2. Statistical methods
The diffraction ring of interest is defined by a range in 2θ (the radial direction) and a range in γ (the azimuthal direction). For the following analysis, the 2θ range is chosen to just encompass the diffraction peak of interest. It is assumed that the twodimensional detector data have been processed from Cartesian to polar coordinates, and are in a twodimensional array with p × q data points or pixels (p points in the 2θ direction and q points in the γ direction).
2.1. Twodimensional average intensity
The intensities I from each pixel in the selected angular ranges are added, and then the total is divided by the number of pixels:
2.2. Twodimensional root mean square intensity variation
Root mean square (r.m.s.) analysis is commonly used in signal processing and microscopy to characterize the irregularity of a signal or the topological roughness of a surface. After the twodimensional average intensity I_{av} is calculated, the sum of the squares of the difference between the intensity and average intensity is calculated:
The r.m.s. intensity variation can be normalized by dividing by the average, in order to compare different data sets. (In statistics, this is called the coefficient of variation.)
The r.m.s. intensity variation has limitations, in that the same value can be obtained for surfaces of different morphology – for example, a smooth surface with a few features of high amplitude, and a rough surface with many lowamplitude features (Sawant & Nicolau, 2005).
2.3. Number of peaks
The peaks are counted according to two adjustable criteria: firstly, for a point to be counted as a peak, it must be the highest intensity within a certain radius of pixels; and secondly, its intensity must be greater than some threshold value (for example, 1.5 × average background).
2.4. Fractal dimension
The fractal dimension is defined as the exponent in a powerlaw ratio between the length of an object and the length of the ruler unit used to measure it (Mandelbrot, 1967). An object comprising lines that occupy two dimensions, for example a coastline, has a fractal dimension between 1 and 2; an object comprising a surface area that occupies three dimensions, for example the topology of a mountain range, has a fractal dimension between 2 and 3. In the case of a surface, the `ruler unit' used to measure the surface area is itself an area, and the powerlaw graph is plotted against the onedimensional length making up that area unit. A smooth threedimensional object such as a cube or sphere has a fractal dimension of 2. The fractal dimension of a diffraction ring can be used as a measure of its smoothness.
Several methods exist for calculating fractal dimension. The most common are Fourier transform methods (Sawant & Nicolau, 2005, and references therein; Khadar & Shanid, 2010), perimeter–area relationships (Sawant & Nicolau, 2005, and references therein) and boxcounting (Eiha et al., 2000). Fractal analysis has been used to obtain measures relating to the morphology of TiO_{2} films (Khadar & Shanid, 2010), aggregated particulate films (Niklasson, 1993; GómezRodríguez et al., 1992) and aggregated biomolecules (Sawant & Nicolau, 2005), from atomic force microscopy images. However, fractal analysis of diffraction rings has not been reported in the literature to date.
To calculate the fractal dimension of a diffraction ring, a method similar to that of Brown et al. (1993) is followed. The data are averaged in the azimuthal (γ) direction for a series of increasing bin sizes in γ (1, 2, 4, 8, 16 etc.). The surface area is calculated (see the supporting information^{1}) and summed over all the grid elements. Finally, the slope of the log–log plot of area versus bin size is obtained. The fractal dimension D is (1 − slope), where the value of slope is negative.
3. Results and discussion
Figs. 1(a) and 1(b) show examples of raw data collected at the start and end of an in situ electrochemical corrosion experiment, as reported by Ingham et al. (2012). The diffraction ring shown is that of Fe(110), arising from the mild steel substrate. Data were collected at the Powder Diffraction beamline of the Australian Synchrotron, using an Xray beam 0.2 × 0.7 mm (vertical × horizontal) in size, with a wavelength of 0.82653 Å (Xray energy 15 keV). The beam struck the sample – a rod of mild steel 1 mm in diameter polished to 1 µm – at grazing incidence, and the diffracted Xrays were detected using a VHR CCD detector (pixel size 26 µm) located 93 mm from the sample. The sample was located at the bottom of a slot to minimize the Xray path length in solution, while not greatly limiting the diffusion of solution species. The electrolyte solution was 0.5 M NaCl saturated with CO_{2} and pHadjusted to 6.3. The solution temperature was 353 K and the corrosion was controlled through applying a constant potential of −500 mV versus Ag/AgCl/KCl (saturated). During the experiment, a passive film of FeCO_{3} was observed to form. In addition, the Fe(110) diffraction ring changed by breaking up a relatively constant intensity ring into individual diffraction spots. An animation of the change with time is available in the supporting information . Figs. 1(c) and 1(d) show the plots corresponding to the two diffraction images from which the fractal dimension values were extracted.
Fig. 2 shows the changes in the various statistical parameters as a function of time, compared with the integrated peak areas for the Fe(110) and FeCO_{3}(104) diffraction rings and the (Ingham et al., 2012). In Fig. 2(a), three stages are observed:
(a) (0–40 min). The is constant.
(b) Onset of FeCO_{3} film growth (40–75 min). The rises to a maximum, and FeCO_{3} begins to form. The FeCO_{3} growth rate is fastest at the peak in current density.
(c) Passivation (75–140 min). The drops below the initial value. FeCO_{3} growth slows and stops.
Previous work focused on the nature of the growth of the FeCO_{3} film under various conditions [varying temperature (Ingham et al., 2010), adding Mg (Ingham et al., 2012), adding scale inhibitors (Ingham et al., 2010; Ko et al., 2012), adding Cr in the steel and/or solution (Ko et al., 2014)]. Although during the induction stage the appears to be unchanged and FeCO_{3} is not being formed, the changes in the Fe substrate diffraction ring are significant. In the first 30 min the r.m.s. intensity variation increases steadily by a factor of two (Fig. 2b), and the fractal dimension increases from 2.20 to 2.30 (Fig. 2d). The onset of the change in fractal dimension at time = 0 (when the is applied) is abrupt. The number of peaks remains relatively constant during this period and decreases abruptly as the FeCO_{3} film is formed (60–100 min).
There is no unique solution that relates the statistical measures to a particular size distribution. However, to analyse crystal size distributions semiquantitatively, test diffraction patterns of model distributions can be calculated for comparison with the experimental data using the statistical measures given above.
These test patterns were calculated from an input histogram of [r, n(r)] pairs, having i points, as follows:
(a) Calculate the total area of the crystals according to the supplied distribution, and normalize this to the sample area. This results in an area factor AF,
where R_{s} is the sample size (the length of the side of a square).
(b) Generate a scaled histogram N(r) by taking into account the area factor, the azimuthal angular range (usually set to be comparable to the γ range of the experimental data) and the multiplicity of the diffraction peak, M:
(c) For each value of r, calculate the peak broadening. This is the sum of crystal size broadening, according to the Scherrer equation, and the instrumental broadening.
(d) For each value of r, perform the following N(r) times:
(i) generate a random position on the sample between 0 and R_{s};
(ii) calculate the adjusted 2θ value based on the wavelength, d spacing and sample position relative to the sampletodetector distance;
(iii) generate a random azimuthal angle γ between 0 and 180°;
(iv) add a Gaussian peak centred at (2θ, γ), with a width defined by the peak broadening for this value of r and having intensity r^{2} (i.e. a diffraction volume having unit depth).
In addition to the input histogram, the following parameters are specified:
(a) Xray wavelength;
(b) sample size illuminated by the beam (length of a side; assumed to be square);
(c) sampletodetector distance;
(d) instrument broadening;
(e) d spacing of the reflection being calculated;
(f) multiplicity of the reflection being calculated;
(g) accuracy parameter (used to limit the range over which each Gaussian peak is calculated, for time efficiency);
(h) output file size in pixels;
(i) 2θ (radial) and γ (azimuthal) ranges.
The input histogram [r, n(r)] can be converted to a relative volume histogram [r, V(r)] by multiplying n(r) by r^{2}d, where d is the (taken here to be unity).
Two series of model distribution histogram functions were considered. The first was a monodisperse histogram, i.e. all crystals having identical sizes. Diffraction patterns were calculated for crystal sizes between 0.1 and 100 µm; a selection of these are shown in Fig. 3. A full list of input parameters is given in the supporting information . The emergence of spots can be seen when the crystal size exceeds 2 µm.
A number of trends are observed with crystal size (Fig. 4). The number of peaks is relatively static at around 100–120 up to a crystal size of 20 µm. A similar plateau in the number of peaks was observed experimentally by RodriguezNavarro et al. (2006), and was attributed to the peaks resulting from smaller crystals being both lower in intensity and greater in number. (For the calculated patterns, increasing the instrument broadening parameter from 0.1 to 0.3° results in this plateau decreasing to 70 peaks.) The normalized r.m.s. intensity variation is approximately linear with crystal size over the range investigated. The fractal dimension increases with crystal size from a value of close to 2.0 for submicrometre crystals to around 2.7 for crystals greater than 20 µm in size.
Comparing the values of number of peaks, normalized r.m.s. intensity variation and fractal dimension calculated from the model with those calculated for the experimental data in Fig. 2, we observe that the asprepared steel (t < 0, i.e. before the is applied) corresponds best to a monodisperse system with a crystal size of around 3–5 µm (visually compare Fig. 1a with Fig. 3f). The number of peaks is around 120 (i.e. in the plateau regime), the normalized r.m.s. intensity variation is around 0.7, and the fractal dimension is 2.20 ± 0.03. However, at later times the statistical parameters obtained from the experimental data do not match those obtained from the calculated monodisperse system. In particular, comparing the fractal dimension and the number of peaks, one notices that the fractal dimension increases rapidly with crystal size. At the upper limit of the regime, where the number of peaks is limited by the experimental resolution, the fractal dimension of the calculated patterns has already increased to 2.6. This value is never obtained from the experimental data, yet the number of peaks is observed to decrease, i.e. at the end of the experiment the number of peaks is no longer limited by the experimental resolution. Therefore, although the experimental data may initially match the statistical parameters obtained from a monodisperse system, the final crystal size distribution in the experimental sample is certainly not monodisperse.
To test the hypothesis that the experimental sample comprises different sized crystals that dissolve at different rates, the second distribution function chosen was a trimodal histogram composed of different ratios of crystals of 0.1, 1 and 10 µm. These values were chosen to span the range of crystal sizes observed in scanning electron microscope images of the experimental samples and inferred from Xray diffraction analysis.
Comparing the values in Table 1, obtained from the calculated diffraction patterns in Fig. 5, with the experimental data (especially at later times), we find that the trimodal distribution results in a better match to the experimental data than does the monodisperse system. In particular, the values obtained for the fractal dimension are more consistent (between 2.20 and 2.35 experimentally). The numbers of peaks are in a similar range (between 120 and 80 experimentally). There is also a good visual correlation between Fig. 1(a) and Fig. 5 (m = 3, n = 4), and Fig. 1(b) and Fig. 5 (m = 2, n = 3). Particularly at early times, there is significant calculated intensity which is isotropic in γ, with additional peaks superimposed. This isotropic intensity arises from the presence of many small crystals in the Xray beam, forming a powder average. These two features are not seen together in any of the patterns calculated for monodisperse distributions in Fig. 3, although they are observed together for several combinations of m and n in Fig. 5. The values for the normalized r.m.s. intensity variation in Table 1 (from the calculated patterns for the trimodal distributions) do not approach the values observed experimentally (0.7–2.5). This is probably due to the specific choices of crystal sizes used (0.1, 1 and 10 µm). It is of course possible to calculate patterns for any distribution to try to match the data as well as possible. Although the results given here do not quantitatively match the experimental data exactly, qualitatively they support the hypothesis that, under the corrosion conditions for this experiment, the smallest crystals dissolve first, resulting in a rapid increase in the fractal dimension. This takes place during the while the is constant and before FeCO_{3} is observed to form. The small crystals are orders of magnitude higher in number than the larger ones. In this comparison between model and experiment, the numbers of 0.1 and 1 µm crystals decrease by approximately an order of magnitude from the beginning to the end of the experiment relative to the number of 10 µm crystals.

In the particular example shown here, only one diffraction ring from Fe was visible. However, it is worth considering the case where multiple diffraction rings are available for analysis. The number of peaks observed in each ring will depend on the peak multiplicity up to the plateau value, which is limited at small crystal sizes by the instrument resolution. As the multiplicity increases, the plateau region of Fig. 4(a) extends upwards to larger crystal sizes. Calculations using different values for the multiplicity show that the fractal dimension does not change significantly; likewise, the normalized r.m.s. intensity variation does not change significantly. Therefore, if multiple peaks are available they can all be analysed, and the results for fractal dimension and normalized r.m.s. intensity variation can be averaged. The number of peaks must be interpreted in the light of the multiplicity for each diffraction ring.
4. Conclusion
We have demonstrated methods for quantifying the spottiness of a diffraction ring by different statistical measures and relating these to diffraction rings calculated for various assumed crystal size distributions. By simultaneously comparing the number of peaks, the normalized r.m.s. intensity variation and the fractal dimension – all quantifiable statistical measures – one can qualify various possible size distribution functions, as opposed to obtaining a single value for the volumeaveraged crystal size by other methods. The methods were applied to experimental data obtained from the corrosion of steel, where small crystals were observed to dissolve faster than larger crystals, causing the diffraction ring to become more spotty over time.
Supporting information
Additional information about calculations: surface area calculation, parameters used. DOI: 10.1107/S1600576713029713/nb5091sup3.pdf
Animation of experimental data. DOI: 10.1107/S1600576713029713/nb5091sup2.avi
Acknowledgements
This work was funded by the New Zealand Ministry of Science and Innovation (MSI) under contract No. C08X1003. Portions of this research were undertaken on the Powder Diffraction beamline at the Australian Synchrotron, Victoria, Australia. We thank the New Zealand Synchrotron Group Ltd for a grant to construct the electrochemical cell. We also thank Nick Birbilis (Monash University) for loaning equipment, and Martin Ryan (Callaghan Innovation) for proofreading and helpful discussions.
References
Brown, C., Charles, P., Johnsen, W. & Chesters, S. (1993). Wear, 161, 61–67. CrossRef CAS Web of Science
Eiha, N., Hanaki, K. I., Maenosono, S., Yamamoto, K. & Yamaguchi, Y. (2000). Bioimages, 8, 129–133.
GómezRodríguez, J. M., Baró, A. M. L., Vázquez, R. C. S., Vara, J. M. & Arvia, A. J. (1992). J. Phys. Chem. 96, 347–350.
He, B. B. (2011). US Patent 7885383 B1.
Hirsch, P. B. (1954). Br. J. Appl. Phys. 5, 257–260. CrossRef Web of Science
Ingham, B., Ko, M., Kear, G., Kappen, P., Laycock, N., Kimpton, J. & Williams, D. (2010). Corros. Sci. 52, 3052–3061. Web of Science CrossRef CAS
Ingham, B., Ko, M., Laycock, N., Burnell, J., Kappen, P., Kimpton, J. & Williams, D. (2012). Corros. Sci. 56, 96–104. Web of Science CrossRef CAS
Khadar, M. A. & Shanid, N. A. M. (2010). Surf. Coat. Technol. 204, 1366–1374.
Ko, M., Ingham, B., Laycock, N. & Williams, D. E. (2014). Corrosion Sci. In the press.
Ko, M., Laycock, N., Ingham, B. & Williams, D. (2012). Corrosion, 68, 1085–1093. Web of Science CrossRef CAS
Mandelbrot, B. (1967). Science, 156, 636–638. CrossRef PubMed CAS Web of Science
Niklasson, G. A. (1993). Phys. Scr. T49, 659–662. CrossRef Web of Science
RodriguezNavarro, A. B., AlvarezLloret, P., OrtegaHuertas, M. & RodriguezGallego, M. (2006). J. Am. Ceram. Soc. 89, 2232–2238. Web of Science CrossRef CAS
Sawant, P. D. & Nicolau, D. V. (2005). Appl. Phys. Lett. 87, 223117. Web of Science CrossRef
Warren, B. E. (1969). Xray Diffraction. New York: Dover.
© International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.