Volume 21 Received 19 July 2013  Modelindependent structure factors from powder Xray diffraction: a novel approach^{a}Niels Bohr Institute, University of Copenhagen, Universitetsparken 5, Copenhagen 2100, Denmark,^{b}PETRA III, Deutches ElektronenSynchrotron DESY, Notkestrasse 85, Hamburg 22607, Germany, and ^{c}Department of Chemistry and iNANO, Center for Materials Crystallography, Langelandsgade 140, Aarhus 8000, Denmark Under the experimental condition that all Bragg peaks in a powder Xray diffraction (PXRD) pattern have the same shape, one can readily obtain the Bragg intensities without fitting any parameters. This condition is fulfilled at the P02.1 beamline at PETRA III using the seventh harmonic from a 23 mmperiod undulator (60 keV) at a distance of 65 m. For grain sizes of the order of 1 µm, the Bragg peak shape in the PXRD is entirely determined by the diameter of the capillary containing the powder sample and the pixel size of the image plate detector, and consequently it is independent of the scattering angle. As an example, a diamond powder has been chosen and structure factors derived which are in accordance with those calculated from density functional theory methods of the WIEN2k package to within an accuracy that allows a detailed electron density analysis. Keywords: powder diffraction; normal equations; charge density. 
Xray diffraction is of basic interest for physical chemistry because the small deviations of the electron density around each atom from spherical symmetry, reflecting the chemical bond between atoms, can in principle be determined by the intensities of Xray Bragg reflections from a single crystal (see, for example, Coppens, 1997).
However, singlecrystal crystallography suffers in this aspect from a number of corrections that must be assessed very accurately before a reliable electron density map can be obtained. These corrections include absorption in the sample, extinction attenuation from the lowangle strong reflections, as well as small scale factor fluctuations between the numerous frames required for a complete diffraction pattern.
None of these drawbacks are present in powder Xray diffraction (PXRD), which can be thought of as singlecrystal diffraction from a huge number of randomly oriented crystal grains that are so tiny that absorption and extinction effects within a grain can be neglected. In addition, the entire diffraction pattern is obtained in one single exposure or frame. Indeed, Nishibori et al. (2007) and Svendsen et al. (2010) recently demonstrated that synchrotron powder diffraction can provide accurate structure factor values and could be the method of choice when dealing with highsymmetry inorganic crystals.
However, when it comes to measuring the deviation from spherical symmetry of the atomic electron densities there is an unfortunate degeneracy in the PXRD pattern, which can most easily be explained by an example. Suppose the crystal has cubic symmetry. Then, for example, the (3,3,3) and the (5,1,1) reflections will both occur at the same scattering angle because (h^{2} + k^{2} + l^{2}) has the same value of 27 for both reflections. From a singlecrystal study the intensity of the two reflections might differ by a small amount and thus directly signify a real deviation from spherical symmetry of the atomic electron cloud, but in PXRD one observes inevitably the weighted sum of the degenerate reflections, weighted by the multiplicity of the respective (h,k,l) sets as well as by their different structure factors, so the direct manifestation of the asymmetric cloud density is lost for such degenerate reflections.
With the present instrument and beam quality one can deal rationally with a number of features in PXRD which conventionally is dealt with by empirical consensus (see, for example, McCusker et al., 1999). The first of these features is reliable background subtraction. In standard program packages this is typically performed by fitting, for example, Legendre polynomials up to 12th order. This approach is not based on any physical reality and only serves to smooth out data for which the origin is not understood or determined otherwise. As will be shown we have accounted for the background quantitatively by an absolute determination of the Compton scattering, presuming the absence of amorphous phase in the powder. Technically this was feasible by using an allinvacuum diffractometer as discussed in a previous paper (Straasø et al., 2013). Next there is the proper integration of the Bragg peaks when dealing with peak widths that vary with the scattering angle. Here it is a common procedure to simulate the peak shape by an analytic function with a number of adjustable parameters, for example a pseudoVoigt profile with five parameters that have little bearing in physical reality, although some authors have synthesized the line profile by convoluting components which could be assessed individually (e.g. Cheary & Coelho, 1992; Straasø et al., 2013).
In the present study the beam quality in terms of divergence and wavelength band is so good that the powder peak widths and peak shapes are entirely determined by the combination of the capillary diameter and the pixel size, utilizing the fact that the grains are large enough to not contribute to the peak width. Therefore the peak widths and peak shapes are independent of scattering angle. Under these experimental conditions the integrated intensities, even for overlapping peaks, can be obtained by a set of linear equations, the socalled normal equations (see e.g. Taylor, 1997), without any fitting of parameters at all. In the present case of a diamond powder there are no overlapping peaks and the normal equations simplify to just one equation for the scaling of a given reference peak relative to any Bragg peak in the powder pattern. This method of extracting the integrated intensities is a special and simple case of the method discussed by Pawley (1981) using the standard procedure in statistical analysis with normal equations. In our case the normal equation matrix is diagonal with identical diagonal elements that can be derived algebraically without any fitting parameters at all.
The question then remains whether the PXRD data are of sufficient quality to unambiguously reveal electron density deviations from spherical symmetry without relying on any model fitting. We shall show that this is indeed the case, and the example we have chosen is that of diamond because the electron density has been calculated with great accuracy for the diamond lattice and therefore the (h,k,l) structure factors are known theoretically with high accuracy. In addition, the thermal vibrations of the electron cloud are rather small and isotropic in diamond, and thermal vibrations can therefore be corrected for reliably to obtain the static structure factors needed for comparison with the theoretical structure factors. As an extra benefit the correction for thermal diffuse scattering is negligible due to the high beam quality, yielding a very small probing volume in reciprocal space.
The deviation from spherical electron density as expressed in the ratio between the calculated structure factors and the spherical independent atom model (IAM) is indeed quite close to unity as shown in Fig. 1 by the dotted black curve. Apart from the (1,1,1) reflection the difference is only a few percent, so to verify this experimentally requires a very precise powder pattern. As can be seen from Fig. 1, in foresight of describing the experimental details, it is indeed possible to obtain this kind of accuracy. The perspective is then that PXRD can determine such tiny deviations, also in cases where theoretical calculations are not available.
 Figure 1 The structure factor ratio between the theoretical aspherical model and the spherical IAM of the electron density in diamond is shown as blue dots. The black dotted curve is a guide to the eye, which in case of degenerate reflections shows the weighted average of the theoretical structure factors. It serves as the theoretical result, which the experimentally derived structure factors can be compared with. Note that the difference between the IAM and the aspherical model is at most a few percent. The structure factor ratio between the derived structure factors from PXRD and the IAM is shown in magenta with error bars as given in Fig. 6. The experimental structure factors were obtained by scaling the reference peak as outlined in §3.1. Only structure factors originating from Bragg reflections with an observed intensity larger than 5% of the background level have been included in the analysis. 
Theoretical static structure factors published by Bindzus et al. (2014) have been used to evaluate the experimentally derived structure factors. The theoretical electronic structure was determined using the density functional theory (DFT) methods of the WIEN2k package (Blaha et al., 2008).
Crystalline largegrain (24 µm) diamond powder was purchased from Nilaco and packed in a 0.2 mm glass capillary. A diamond grain with a diameter D of 2 µm may be considered as a perfect crystallite with no secondary extinction. The primary extinction coefficient E is very close to unity.^{1} In order to facilitate highresolution powder Xray diffraction to large reciprocal lattice vectors, data were collected at the 60 keV P02.1 beamline (Dippel et al., 2014) at the PETRA III synchrotron, Germany, using an allinvacuum diffractometer, the details of which are described by Straasø et al. (2013). In brief, all air scattering is eliminated by keeping the sample and the image plate (IP) detector in the same vacuum. In such a setup the background level will be at the fundamental level consisting of only the scattering from the sample holder and the inevitable Compton scattering from the sample itself. A semitransparent beam stop of 3.5 mm tantalum provides a precise location on the IP of the direct beam. A wavelength of = 0.20687 (2) Å was determined by the symmetric positions of Bragg reflections from single crystals of Si (a = 5.4309 Å) both in Laue and Bragg geometry. The raw twodimensional diffraction image is integrated along the exact DebyeScherrer rings as explained by Straasø et al. (2013) to yield the final onedimensional powder diffraction pattern. Referring to Fig. 11 in that paper we have numerically examined the effect of the finite horizontal beam width, i.e. that the location of point `O' in that figure is smeared. Usually this effect is referred to as axial divergence and it has been dealt with in the literature by van Laar & Yellon (1984) and Cooper & Glasspool (1976). Our numerical study shows that in the present study the effect is utterly negligible.
The Xray source is a long undulator, L = 2 m, with a period of _{U} = 23 mm. A narrow wavelength band around 60 keV is extracted from the seventh harmonic in the undulator spectrum by two successive Bragg reflections in the horizontal plane from first a diamond(1,1,1) crystal and second from a Si(1,1,1) crystal, in asymmetric and symmetric Laue geometry, respectively. The beam divergence from the seventh harmonic is exceedingly small, of order (/L)^{1/2} 3 µrad when neglecting the electron beam divergence. By performing slit scans the Xray beam dimensions were measured at s = 62.5 m downstream of the source. FWHM values in millimeters were w_{h} = 0.57 in the horizontal direction and w_{v} = 1.2 in the vertical direction corresponding to divergences of _{h} = w_{h}/s = 9.1 µrad and _{v} = w_{v}/s = 19.2 µrad, respectively. The wavelength band is around 2 × 10^{4} (Dippel et al., 2014). Rocking curves from single crystals of Si in Laue and Bragg geometry yielded the (h,h,h) widths shown in Fig. 2, with the expected widths given by the red curve. For the powder diffraction experiment the incident beam was apertured down to 0.5 mm × 0.3 mm (horizontal × vertical), so the expected rockingcurve widths, and therefore also the powder line widths, are reduced to be on the blue curve. As we shall see in §2.3.1, the contribution to the powder peak width from the capillary diameter of 0.2 mm at a distance of R = 300 mm from the IP is _{cap} = 0.2 mm/300 mm = 670 µrad, unambiguously proving that all contributions to the powder line width from components upstream of the sample position are negligible.
 Figure 2 Instrumental resolution, i.e. resolution in reciprocal space from components upstream of the sample position. The red line shows the expected rockingcurve width from a Si single crystal irradiated by the full beam. Experimentally observed rocking widths for one to three (h,h,h) reflections in Bragg geometry (crosses) and Laue geometry (circles), respectively, are in good accordance with the expected values. XRPD data were obtained with an apertured beam leading to the instrumental resolution represented by the blue line. 
When the beam is Bragg reflected from a strainfree powder sample there will in principle be additional peak broadening due to the finite grain size, D, and the finite sample height, h. The grain size contribution is given by Scherrer's formula as /(D cos) = 20 µrad/cos. The contribution to the peak broadening from the finite sample height has no angular dependence and is given in the preceding paragraph to be 670 µrad. Allowing for a small wobbling during rotation of the capillary, it is likely that the effective capillary diameter was closer to 250 µm than 200 µm, making this contribution even slightly larger. Finally, the pixel size, p, of the IP detector gives a constant contribution to the peak width and amounts to p/R = 25 µm/0.3 m = 83 µrad. By comparing the magnitudes of the various contributions it is clear that all contributions other than the two constant contributions from the finite sample height and detector pixel size are negligible. As a consequence the Bragg peaks in the powder diffractogram will all have the same width, independent of the scattering angle 2, and, equally important, they will all have the same shape.
The diffraction pattern is shown in Fig. 3 together with the signal from a similar glass capillary. It is noted that Bragg peaks out to 2 = 50° corresponding to sin/ = 2 Å^{1} are observable and that none are overlapping in the entire region. At scattering angles larger than 2 = 50°, essentially all scattering from both the diamond powder and the glass capillary is inelastic incoherent Compton scattering [see, for example, International Tables of Crystallography (1992)]. From Fig. 3 one can deduce that Compton scattering from the diamond powder at 2 = 50° is the difference between total scattering of 25000 counts and the glass capillary scattering of 11000 counts, i.e. the Compton scattering from the diamond amounts to about 14000 counts. In International Tables of Crystallography, Vol. C, the ratio of Compton scattering to total scattering is tabulated for all elements (Z) and wavevector transfers, sin/, so one can generate the Compton scattering from the diamond powder (black curve). The total background shown in green is simply the sum of the signal from the glass and the calculated Compton scattering from the diamond sample. Subtraction of the total background (the green curve) from the diffraction pattern yields the final Bragg scattering data set. However, a finetuning may be necessary. The signal from the glass capillary, which is the major contribution to the total background at small scattering angles, was derived from a similar, but not identical, capillary to the one containing the powder. Consequently, the scattering from the two capillaries may differ by a factor close to unity, but not exactly 1. The appropriate factor of 1.02 was determined from the analysis depicted in Fig. 4.
 Figure 3 Powder pattern from diamond powder in a 0.2 mmdiameter glass capillary obtained using an allinvacuum diffractometer equipped with a curved IP strip as detector. The wavelength was 0.20687 Å. The red curve is from an empty glass capillary, and the black curve is the calculated Compton scattering from the diamond powder as explained in the main text. The sum of the red and black curves then amounts to the background below the Bragg peaks as shown in green. Note that a typical peak level of Bragg peaks at large angles is around 2500 counts, so the signaltobackground ratio is around 1:10 at these angles. The exposure time was 60 min. The data set can be found as supporting information, available from the IUCr electronic archives (Reference: GB5017 ). 
 Figure 4 The empty glass capillary is not strictly identical to the capillary containing the diamond powder. Subtracting the Compton scattering from diamond (black curve) from the glass + powder data, where the Bragg peaks at around 5.8° and 9.3° have been masked, yields a curve which in shape is identical to the red empty glass curve but due to the different glass differs by a factor of 1.020. 
Moreover, one may finetune the background by averaging the remaining intensities between Bragg peaks. This finetuning of the background at high angles was typically around onetenth of the Bragg peak intensity compared with the full background level which, as apparent from Fig. 3, is ten times higher than the Bragg peak. In other words the finetuning of the background was of order 1% of the total background, as derived by the Compton scattering analysis described above.
Finally we note that the calculated ratio of Compton scattering from glass and from solid diamond is not the ratio of the red and black curves at 2 = 50° in Fig. 3 because of the packing of grains in the capillary, implying that the diamond density inside the capillary is in fact only about 40% of the density of solid diamond, a typical number for packing of powder.
As emphasized at the end of §2.3.1 we expect the shape of all Bragg peaks to be the same. The proof of this statement, which greatly simplifies the assessment of integrated intensities, is illustrated in Fig. 5, which shows panels of nine different Bragg peaks spread over the entire range of scattering angles. Each (h,k,l) Bragg peak comprising the data points y_{j}, j = 1...m, is superimposed on the reference peak, the latter being displaced to the (h,k,l) scattering angle and denoted r_{i}, i = 1...n, and scaled with a certain factor a^{hkl}. The intensities of the (h,k,l) Bragg peak are shown with their Poisson error bars ± _{j} which at the larger scattering angles mostly originate from the background level. The reference peak could be any peak in the powder diffractogram, but, as will be further elaborated in the Discussion, the reference peak was chosen as the average profile of the 15 most intense Bragg peaks. The overlap of the (h,k,l) Bragg peak and the scaled reference peak can be quantified by the weighted squared sum of differences, ^{2}, with the best scale factor a^{hkl}. The latter is found by the simple algorithm
Here y_{i}^{ hkl} and r_{i} are the intensities of the (h,k,l) reflection and the reference peak, respectively, and the weight of the ith data point is w_{i} = . Equation (1) is derived by requiring minimal value of ^{2} = , so its derivative with respect to a^{hkl} must be zero. The scaling algorithm presented in (1) is a special case of normal equations in statistical analysis, which deals with the more general case of overlapping reflection peaks (see Appendix B).
 Figure 5 Nine Bragg peaks superimposed on the scaled reference peak shown by a red line prove that all Bragg peaks in the powder spectrum shown in Fig. 3 have the same shape and only differ from each other by a scale factor a, which is also given in each panel. Clearly the integrated intensities relative to the reference peak are also given by this scale factor. 
The accuracy of the scale factor a^{hkl} due to counting statistics is discussed in Appendix A. However, as pointed out by Ida & Izumi (2011), the finite number of crystallites will in principle also contribute to the uncertainty of the Bragg intensities, and this effect is particularly pronounced for large crystallite sizes and/or small probing volumes in reciprocal space. Although the illuminated length of the capillary was 0.5 mm implying that about 360.000 grains were illuminated and the DebyeScherrer arcs on the IP did not show any individual grain structure, particle statistics might still be an issue. In extending the pioneering work of Alexander et al. (1948) and De Wolff (1959), Ida & Izumi suggest for a spinning specimen the following relationship between the variance due to particle statistics, , and the effective multiplicity, m_{eff}, given explicitly for the jth data point as
where y(2_{j}) is the true model intensity and b_{j} is the background intensity. Given that there is no peak overlap in the entire diffraction range, m_{eff} is simply the (degenerate) multiplicity of a given (h,k,l) reflection. Ida & Izumi treat the proportionality constant as a refinable parameter during leastsquares refinement. For the present study a proportionality constant of 0.25 is found to return a set of structure factors with the statistically expected Gaussian variance, i.e. about twothirds of all structure factors below sin/ = 1.5 Å^{1} overlap with the theoretical result. At wavevector transfers larger than sin/ = 1.5 Å^{1} the total variance is dominated by counting statistics and these data are therefore not included in determining the proportionality constant. Fig. 6 shows the total relative standard deviation alongside the individual contributions from counting and particle statistics, respectively. The total standard deviation was evaluated for all a^{hkl} and used for calculating the error bars in Figs. 1 and 7.
 Figure 6 The relative total standard deviation, _{t}/a, as a function of sin/ is shown as black dots along with its two components _{c}/a and _{p}/a, where the subscripts c and p refer to counting statistics and particle statistics, respectively. At small wavevector transfers the uncertainty of the scale factor a is dominated by particle statistics, whereas at high wavevector transfers the major contributor to the total uncertainty is the counting statistics. 
The intensity versus 2 of Bragg peaks, such as the examples shown in Fig. 5, is related to the static structure factor F_{hkl} by
In equation (3) m_{hkl} is the multiplicity of the (h,k,l) reflection, cos is proportional to the circumference of the DebyeScherrer ring, 1/sin2 is proportional to the fraction seen by the detector, and the last factor 1/sin2 is proportional to the integrated intensity as derived from the Lorentz factor. For degenerate sets of Miller indices (h,k,l) the experimentally observed intensity corresponds to the sum of the intensities from (3) having a common value of 2. With no model interpretation, one can only derive the average of structure factors from degenerate reflections.
Thermal vibrations affect the scattered Xray intensity in two ways, namely by inelastic onephonon scattering and by diminishing the elastic Bragg scattering by the DebyeWaller factor, exp[2B(sin/)^{2}].
The onephonon scattering cross section is overlapping the narrow region of Bragg scattering in reciprocal space with a cusplike intensity profile due to the acoustic phonons. This effect must be corrected for, the socalled thermal diffuse scattering (TDS) correction, and it has been evaluated by Lucas (1969). In the present case the overlap region is very small due to the extremely fine angular resolution of the incident radiation and the narrow wavelength band. Furthermore, in a hard material such as diamond the acoustic phonon energies are increasing rapidly with wavevector and estimates using the Lucas formalism show that the TDS correction in our case is completely negligible.^{2}
Parameter B in the DebyeWaller factor is derived from a Wilson plot as shown in Fig. 7, where the logarithm of the ratio of the observed and calculated squared structure factors are plotted versus (sin/)^{2}. The slope yields a value of 2B = 2 × 0.151 (2) Å^{2} which can be compared with other reported values for the thermal vibrations in diamond listed in Table 1. An absolute scaling of the experimentally derived structure factors is also provided by the Wilson plot by fixing the fitted line at point (0,0).

 Figure 7 Wilson plot determining the thermal vibrations in diamond. The slope of 2B = 0.3025 (40) Å^{2} corresponds to an isotropic squared average thermal amplitude of <u^{2}> = B/8^{2} = 0.00192 (3) Å^{2}. 
With the determination of the DebyeWaller factor the static structure factors can now be calculated and the result is shown in magenta in Fig. 1 expressed as the ratio between the experimentally observed static structure factors, F_{exp}, and those of the spherical IAM, F_{sph}. The relative uncertainty of the observed structure factors as depicted by error bars is half of the relative error on the corresponding scale factors a^{hkl}. Out to sin/ 1.5 Å^{1} there is a clear deviation from the spherical model and the observed structure factors follow the same trend as the theoretical values (F_{aniso}). At larger wavevector transfers any trend in the observed structure factors is masked by rather high uncertainties caused by Compton scattering causing signaltonoise ratios as low as 1:20. Bragg reflections with a signaltonoise ratio of less than 1:20 have been excluded in the analysis.
In addition to Fig. 1, our results for dynamic structure factors are also listed explicitly in Table 2. In case of degenerate reflections the Bragg intensity has been decomposed according to the theoretical structure factors and to the respective multiplicities.

In an ideal data set all peaks could function as the reference peak and different choices would simply change all a^{hkl} values by a constant factor. However, in a real data set the peak shape at large sin/ is uncertain due to counting statistics, and at small sin/ there is some uncertainty due to grain statistics (see Fig. 6). The optimal choice of the reference peak shape is an average of the peaks at low sin/ because the averaging process may even out the uncertainties due to grain statistics and other small unspecified systematic errors. By setting a criterion of a minimum peak intensity of 15000 counts, the error due to counting statistics is less than 1% and approximately a factor of ten smaller for the integrated intensity. Consequently, as the reference peak we have taken the average of all reflection peaks with a minimum peak intensity of 15000 counts (here 15).
In addition there is the choice of how much of the reference beam profile that should be scaled to an (h,k,l) peak. In principle it could be the central point only (n = 1), but then one loses the statistical accuracy of including more points. On the other hand, by extending the region too far out in the tails, where the statistical accuracy of the (h,k,l) peak at any rate is low and other systematic effects are relatively more pronounced, one collects in principle relatively more TDS and one may also erroneously include artefacts of irregularities in the background. As shown in Fig. 5 we have chosen a region which is a compromise of the two limiting cases including a portion of the tails (n = 31). Changing the number of data points in the reference peak to either n = 41 or n = 21 has no effect on the resulting structure factors or estimated thermal parameter within the estimated uncertainties.
The idea to use a numerical profile rather than an analytic mathematical expression was also noted by Hepp & Baerlocher (1988).
In papers on crystallography the word `refinement' occurs ubiquitously. We suggest to distinguish between refinement of the instrument parameters and refinement of the model parameters. On the instrument parameter refinement side, we discussed above the finetuning of the background on top of the overall and dominating calculated Compton scattering, as well as the finetuning of the scaling between different glass capillaries. Once these instrument corrections are made, the analysis progresses with no fitting of any parameter by using the method of normal equations, outlined in Appendix B, to yield a set of weighted structure factors. In the particular case discussed here, i.e. a diamond pattern, there are no overlapping Bragg reflections, so the coefficient matrix M_{ij} in the normal equations is diagonal with identical diagonal elements.
In case of degenerate reflections the obtained structure factor will represent the average of the degenerate structure factors. If one wishes to decompose a degenerate reflection into its various structure factors one may do so according to a model providing their ratios. The obtained structure factors may then serve as the input data to refinement of the model.
We emphasize that the condition for this simple and transparent analysis is that Bragg peak shapes are independent of scattering angle as is the case when the width is completely dominated by the diameter of the capillary.
As far as future improvements are concerned, it is clear from Fig. 1 that it would be a great improvement if the uncertainties at high values of sin/ could be reduced. As seen in Fig. 3 the background at large scattering angles is due to Compton scattering, and the background Xray photons therefore have a lower energy than the elastically scattered photons in the Bragg peaks. The background can therefore be dramatically reduced with an energydispersive detector instead of an IP detector. Here the incident photon energy of 60 keV is a great benefit, because the relative energy shift in terms of the Compton length = 3.86 × 10^{3} Å and the wavevector k, namely E/E = , is proportional to E and as large as 3.1% at 2 = 30°. We plan to complement the IP detector with an energydispersive detector in our setup in the near future.
We have shown that the powder pattern obtained on a highly collimated 60 keV beam derived from the seventh harmonic of an undulator source can be analyzed to determine structure factors to an accuracy of 1% up to sin/ = 1.5 Å^{1}. The novel analysis is free of any fitted parameters, either for background, for peak shape, for wavelength or for zero scattering angle. The 1% accuracy required for a modelfree derivation of the difference electron density map may be extended to higher values of sin/ than 1.5 Å^{1} by supplementing the IP detector with an energydispersive detector to eliminate the Compton scattering at these high wavevector transfers.
The issue in this Appendix is how to assess the accuracy of the derived scale factors a using equation (1) in §2.4. The reference Bragg peak shape is shown in green in Fig. 8 together with the scaled 15 most intense reflections which it is an average of. It represents 31 data points of the total scattering with a background of 25000 counts subtracted. Fig. 9 shows five Poissonrandomized generated peaks with a chosen scale factor of 0.002, i.e. a peak intensity of about 1500 counts. For simplicity, only one of the data series (in blue) is drawn with error bars including the Poisson statistics of the background level of 25000 counts. In comparison, the error bars on the reference peak are negligible. To gain statistical accuracy, 100 model peaks are generated and the bestfit value of the scale factor a(i), i = 1...100, is found. From that data set the mean as well as the standard deviation of a is readily derived. The mean is of course close to the chosen value of the scale factor, and for this weak peak the relative standard deviation on a is 1.2%. One can repeat this analysis for a whole range of chosen scale factors between 0.001 up to 10 and it turns out that the relative standard deviation on a is approximated well by the algorithm
with p1 = 0.76 (6) and p2 = 3.5 (1). This result is used for data points (crosses) in Fig. 6.
 Figure 8 The reference peak shown as green dots is the average of the 15 most intense Bragg peaks all scaled to the intensity of the (1,1,1) reflection. 
 Figure 9 Generated model peaks using Poisson randomization, all having a generated scale factor of 0.002. The centered n = 31 data points of the reference peak, scaled by a = 0.002 and with the background level of 25000 counts added, is shown as the black line. 
The three peaks in Fig. 10 represent an Xray diffraction pattern given by the data set y_{i}, i = 1, 2,..., N. The peaks all have the same shape, centered at position x_{j}, j = 1, 2, 3, as given by the function f, but their peak heights p_{j}, j = 1, 2, 3, should be determined by minimizing F = . The partial derivatives of F with respect to the parameters p_{j} must therefore vanish, leading to j linear equations with j unknowns, the socalled normal equations, which in matrix form read
with the elements
and
Note that in the case of nonoverlapping peaks as discussed in the main text of this paper, the matrix M_{jk} has only nonvanishing elements in the diagonal and they are all identical. In that case the solution is reduced to
which is the same as the singlepeak determination given in §2.4.
 Figure 10 A data set with error bars, generated by randomizing three Gaussian peaks with different amplitudes and different centers, but all with the same peak shape. Whether the generating peaks are Gaussian or are generated by any other means, analytic or numeric, is irrelevant for the illustration, as long as they all have the same shape. 
Fig. 10 illustrates the solution. The `data' are synthesized by Poissonrandomizing three Gaussians with amplitudes 500, 1000 and 2000, centered at x_{1} = 0.2, x_{2} = 0.4 and x_{3} = 1.8, respectively. The solution for the amplitudes, p_{1} = 508, p_{2} = 1008 and p_{3} = 1978, are indeed in accordance with the generating amplitudes.
The theoretically calculated structure factors depicted in Fig. 1 were kindly provided by Lasse Bjerg, Aahus University. We acknowledge fruitful discussions with Niels Bindzus and Bo Brummerstedt Iversen, Aarhus University. The diffractometer was financed by Carlsberg Foundation. Travel expenses were covered by DanScatt.
Alexander, L., Klug, H. P. & Kummer, E. (1948). J. Appl. Phys. 19, 742.
Bindzus, N., Straasø, T., Wahlberg, N., Becker, J., Bjerg, L., Dippel, A.C. & Iversen, B. B. (2014). Acta Cryst. A70, doi:10.1107/S2053273313026600.
Blaha, P., Schwarz, K., Madsen, G. K. H., Kvasnicka, D. & Luitz, J. (2008). WIEN2k, An Augmented Plane Wave + Local Orbitals Program for Calculating Crystal Properties. Technische Universität, Wien, Austria.
Cheary, R. W. & Coelho, A. (1992). J. Appl. Cryst. 25, 109121.
Cooper, M. J. & Glasspool, A. V. (1976). J. Appl. Cryst. 9, 6367.
Coppens, P. (1997). Xray Charge Densities and Chemical Bonding. Oxford University Press.
De Wolff, P. M. (1959). Appl. Sci. Res. 7, 102112.
Dippel, A.C. et al. (2014). In preparation.
Fischer, A., Tiana, D., Scherer, W., Batke, K., Eickerling, G., Svendsen, H., Bindzus, N. & Iversen, B. B. (2011). J. Phys. Chem. A, 115, 1306113071.
Hepp, A. & Baerlocher, C. (1988). Aust. J. Phys. 41, 229.
Ida, T. & Izumi, F. (2011). J. Appl. Cryst. 44, 921927.
International Tables of Crystallography (1992). Vol. C. Dordrecht: Kluwer.
Laar, B. van & Yelon, W. B. (1984). J. Appl. Cryst. 17, 4754.
Lucas, B. W. (1969). Acta Cryst. A25, 627631.
McCusker, L. B., Von Dreele, R. B., Cox, D. E., Louër, D. & Scardi, P. (1999). J. Appl. Cryst. 32, 3650.
McSkimin, H. J. & Andreatch, P. (1972). J. Appl. Phys. 43, 29442948.
Nishibori, E., Sunaoshi, E., Yoshida, A., Aoyagi, S., Kato, K., Takata, M. & Sakata, M. (2007). Acta Cryst. A63, 4352.
Pawley, G. S. (1981). J. Appl. Cryst. 14, 357361.
Spackman, M. A. (1991). Acta Cryst. A47, 420427.
Stewart, R. F. (1973). Acta Cryst. A29, 602605.
Straasø, T., Becker, J., Iversen, B. B. & AlsNielsen, J. (2013). J. Synchrotron Rad. 20, 98104.
Svendsen, H., Overgaard, J., Busselez, R., Arnaud, B., Rabiller, P., Kurita, A., Nishibori, E., Sakata, M., Takata, M. & Iversen, B. B. (2010). Acta Cryst. A66, 458469.
Taylor, J. R. (1997). An Introduction to Error Analysis, 2nd ed. Sausalito: University Science Books.
Yamamoto, K., Takahashi, Y., Ohshima, K., Okamura, F. P. & Yukino, K. (1996). Acta Cryst. A52, 606613.