Debian Codegraph @

rawEx/specular/NCRoughnessInSpecular.py

raw symbols SCIP
1 #!/usr/bin/env python3
2 """
3 Specular reflectometry of a rough multilayer using the
4 Névot-Croce (NC) roughness model.
5
6 A 5× [PartA (2.5 nm) / PartB (5 nm)] stack on a substrate is simulated
7 with self-affine interface roughness and common-depth cross-correlation,
8 using the ErfTransient profile function (Névot-Croce model).
9 Compare SpecularSimulationWithRoughness.py which uses TanhTransient.
10 """
11 import bornagain as ba
12 from bornagain import ba_plot as bp, deg, nm, angstrom
13
14
15 def get_sample():
16 vacuum = ba.Vacuum()
17 substrate_color = (0.28, 0.57, 0.82)
18 substrate_mat = ba.RefractiveMaterial("Substrate", substrate_color, 15e-6, 0)
19 a_color = (0.86, 0.24, 0.18)
20 a_mat = ba.RefractiveMaterial("PartA", a_color, 5e-6, 0)
21 b_color = (0.25, 0.65, 0.35)
22 b_mat = ba.RefractiveMaterial("PartB", b_color, 10e-6, 0)
23
24 autocorr = ba.SelfAffineFractalModel(1*nm, 0.3, 5*nm)
25 crosscorr = ba.CommonDepthCrosscorrelation(10*nm)
26 roughness = ba.Roughness(autocorr, ba.ErfTransient(), crosscorr)
27
28 vacuum_layer = ba.Layer(vacuum)
29 layer_a = ba.Layer(a_mat, 2.5*nm, roughness)
30 layer_b = ba.Layer(b_mat, 5*nm, roughness)
31 substrate_layer = ba.Layer(substrate_mat, roughness)
32
33 n_repetitions = 5
34 stack = ba.LayerStack(n_repetitions)
35 stack.addLayer(layer_a)
36 stack.addLayer(layer_b)
37
38 sample = ba.Sample()
39 sample.addLayer(vacuum_layer)
40 sample.addStack(stack)
41 sample.addLayer(substrate_layer)
42 return sample
43
44
45 def get_simulation(sample):
46 n = <%= test_mode ? 50 : 500 %>
47 scan = ba.AlphaScan(n, 2*deg/n, 2*deg)
48 scan.setWavelength(1.54*angstrom)
49 return ba.SpecularSimulation(scan, sample)
50
51
52 <%= include_partial("template/main/runsim.py",
53 "ba.showSample3D(sample, sample_size=120*nm, seed=0)") -%>