Transmission

Result

Transmission result

Sample

Transmission 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
55
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = ["bornagain>=25,<26"]
# ///
"""
Fresnel transmittivity and reflectivity of a multilayer sample.

Uses DepthprobeSimulation.transmitted() and .reflected().
"""

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

depth = 100 * nm


def get_sample():
    vac_mat = ba.Vacuum()
    a_color = (0.05, 0.62, 0.55)
    a_mat = ba.RefractiveMaterial("A", a_color, 6e-5, 0)
    sub_color = (0.28, 0.57, 0.82)
    sub_mat = ba.RefractiveMaterial("Substrate", sub_color, 3e-05, 0)

    sample = ba.Sample()
    sample.addLayer(ba.Layer(vac_mat))
    sample.addLayer(ba.Layer(a_mat, depth))
    sample.addLayer(ba.Layer(sub_mat))

    return sample


def simulate():
    alpha = 0.64 * deg
    scan = ba.AlphaScan(1, alpha, alpha)
    scan.setWavelength(0.3 * nm)

    z_axis = ba.EquiDivision("z (nm)", 1, 0, 0)
    simulation = ba.DepthprobeSimulation(scan, get_sample(), z_axis)

    T = simulation.transmitted().flat().valAt(0)
    R = simulation.reflected().flat().valAt(0)
    return T, R


if __name__ == '__main__':
    ba.showSample3D(get_sample(), sample_size=180*nm, seed=0)
    T, R = simulate()
    print(f'transmittivity: {T}')
    print(f'reflectivity:   {R}')
    ba.plt.bar(["Transmission", "Reflection"], [T, R])
    ba.plt.ylabel("Fraction")
    ba.plt.ylim(0, 1)
    ba.plt.show()
auto/Examples/depthprobe/Transmission.py