This example compares the approximations for the diffuse scattering from a rough gold surface. The approximations are discussed by Kozhevnikov and Pyatakhin, Use of DWBA and perturbation theory in X-ray control of the surface roughness, J. X-Ray Sci. Technol. 8, 253–275.

The surface has the RMS height $\sigma=1$ nm, the lateral correlation length $\xi=1$ µm and the Hurst exponent $H=0.5$; the wavelength is $\lambda=0.154$ nm. The two incident angles, 0.3° and 0.8°, lie below and above the critical angle of about 0.56°.

The example shows five calculations of the diffuse scattering:

  • FullDWBA: uses the waves of each layer on its own side of the mean interface.
  • LowerField: uses the waves of the lower layer on both sides.
  • UpperField: uses the waves of the upper layer on both sides.
  • FullDWBA, one term: the default approximation of BornAgain.
  • HeightPerturbation: leading height perturbation theory, in which the scattering amplitude is proportional to the height.

All curves use sharp reference waves and an exponential height covariance without cutoff frequency. FullDWBA, LowerField and UpperField sum 64 terms.

The refractive index of gold is $n=1-4.706272993680498\times10^{-5} +i\thinspace4.841358699064536\times10^{-6}$, obtained from the CXRO Au scattering factors at 8050.921976 eV, linearly interpolated in energy, with density 19.3 g/cm³ and atomic weight 196.96657. See Henke, Gullikson, and Davis, Atomic Data and Nuclear Data Tables 54, 181–342 (1993), via CXRO.

A test of BornAgain checks all five curves against an independent numerical integration over the Gaussian heights.

See Diffuse approximations for the definitions of the approximations.

Result

Gold surface: five roughness treatments at two incident angles

Sample

Rough gold surface

Python script

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = ["bornagain>=25,<26"]
# ///
"""
Compare the roughness approximations for a gold surface.

The approximations are discussed by Kozhevnikov and Pyatakhin, "Use of DWBA
and perturbation theory in X-ray control of the surface roughness",
J. X-Ray Sci. Technol. 8, 253-275.

The optical constants are calculated from CXRO Au scattering factors at
lambda=0.154 nm, density=19.3 g/cm^3:
https://henke.lbl.gov/optical_constants/sf/au.nff
"""

import bornagain as ba
ba.require_versions("bornagain>=25,<26")
from bornagain import deg, nm

WAVELENGTH = 0.154*nm
SIGMA = 1*nm
XI = 1000*nm
DELTA = 4.706272993680498e-5
BETA = 4.841358699064536e-6
TERMS = 64
MODES = [('FullDWBA', TERMS, 'FullDWBA', 'black'),
         ('LowerField', TERMS, 'LowerField', 'tab:blue'),
         ('UpperField', TERMS, 'UpperField', 'tab:green'),
         ('FullDWBA', 1, 'FullDWBA, one term', 'tab:purple'),
         ('HeightPerturbation', 1, 'HeightPerturbation', 'tab:orange')]


def get_sample():
    gold_color = (0.9, 0.7, 0.2)
    gold = ba.RefractiveMaterial('Gold', gold_color, DELTA, BETA)
    model = ba.PoweredExponentialModel(SIGMA, 0.5, XI, float('inf'))
    roughness = ba.Roughness(model, ba.ErfTransient())
    sample = ba.Sample()
    sample.addLayer(ba.Layer(ba.Vacuum()))
    sample.addLayer(ba.Layer(gold, roughness))
    return sample


def calculate(alpha_i, approximation, terms):
    points = 240
    scan = ba.AlphaScan([alpha_i])
    scan.setWavelength(WAVELENGTH)
    detector = ba.OffspecDetector(points, 0.02*deg, 2*deg, -5*deg, 5*deg)
    simulation = ba.OffspecSimulation(scan, get_sample(), detector)
    options = simulation.options()
    options.setDwbaReferenceWaves('Sharp')
    options.setRoughnessApproximation(approximation, terms)
    result = simulation.simulate().flat()
    # Divide by the bin width: intensity per radian of exit angle.
    bin_width = (2 - 0.02)*deg/points
    return ba.Datafield(result.frame(),
                        [v/bin_width for v in result.flatVector()])


if __name__ == '__main__':
    ba.showSample3D(get_sample(), sample_size=120*nm, seed=0)
    fig = ba.plt.figure(figsize=(10, 4.8), layout='constrained')
    axes = fig.subplots(1, 2)
    for axis, alpha_i in zip(axes.flat, [0.3*deg, 0.8*deg]):
        for approximation, terms, label, color in MODES:
            ba.plot_curve(calculate(alpha_i, approximation, terms),
                          ax=axis,
                          label=label,
                          ylabel='Diffuse intensity per radian',
                          lineargs={'color': color})
        axis.set_title(rf'$\alpha_i={alpha_i/deg:g}^\circ$')
    fig.legend(*axes.flat[0].get_legend_handles_labels(),
               loc='outside upper center',
               ncol=5,
               frameon=False)

    ba.plt.show()
auto/Examples/offspec/KozhevnikovPyatakhin.py