Depthprobe

Result

Depthprobe result

Sample

Depthprobe sample

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
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = ["bornagain>=25,<26"]
# ///
"""
Depth-probe simulation of a Ti/Ni multilayer on a Si substrate.

Computes intensity as function of incident angle alpha and depth z
for a 10-bilayer TiNi stack. Compare Depthprobe1.py which uses a
single-layer sample.
"""
import bornagain as ba
ba.require_versions("bornagain>=25,<26")
from bornagain import deg, nm


def get_sample():
    vacuum = ba.Vacuum()
    substrate_color = (0.28, 0.57, 0.82)
    substrate_mat = ba.RefractiveMaterial(
        "Si_substrate", substrate_color, 7.81e-7, 0)
    ni_color = (0.93, 0.48, 0.14)
    ni_mat = ba.RefractiveMaterial("Ni", ni_color, 3.557e-6, 0)
    ti_color = (0.05, 0.62, 0.55)
    ti_mat = ba.RefractiveMaterial("Ti", ti_color, -7.36e-7, 0)

    n_repetitions = 10
    stack = ba.LayerStack(n_repetitions)
    stack.addLayer(ba.Layer(ti_mat, 3*nm))
    stack.addLayer(ba.Layer(ni_mat, 7*nm))

    sample = ba.Sample()
    sample.addLayer(ba.Layer(vacuum))
    sample.addStack(stack)
    sample.addLayer(ba.Layer(substrate_mat))
    return sample


def get_simulation(sample):
    n = 100
    scan = ba.AlphaScan(n, 0.025*deg, 0.975*deg)
    scan.setWavelength(1*nm)
    z_axis = ba.EquiDivision("z (nm)", n, -100*nm, 100*nm)
    return ba.DepthprobeSimulation(scan, sample, z_axis)


if __name__ == '__main__':
    sample = get_sample()
    simulation = get_simulation(sample)
    result = simulation.simulate()
    ba.showSample3D(sample, sample_size=180*nm, seed=0)
    ba.plot_datafield(result, intensity_min=1e-2, intensity_max=1e1)
    ba.plt.show()
auto/Examples/depthprobe/Depthprobe.py