Brush-Spec_refl100.py

Minimal script to reproduce - dmitry, 19 Feb 2019 12:59

Download (1.71 KB)

 
1
import bornagain as ba
2
from bornagain import deg, angstrom, nm
3

    
4
def get_sample():
5
    # Defining Materials
6
    material_1 = ba.MaterialBySLD("Substrate", 2.07e-06, 0.0)
7
    material_2 = ba.MaterialBySLD("sio2", 3.47e-06, 0.0)
8
    material_3 = ba.MaterialBySLD("dummy", 5.6e-07, 0.0)
9
    material_4 = ba.MaterialBySLD("pol2", 3.64e-06, 0.0)
10
    material_5 = ba.MaterialBySLD("d2o", 6.34e-06, 0.0)
11

    
12
    # Defining Layers
13
    layer_1 = ba.Layer(material_1)          #Si
14
    layer_2 = ba.Layer(material_2, 1.3)     #SiO2
15
    layer_3 = ba.Layer(material_3, 1.3)     #Dummy
16
    layer_4 = ba.Layer(material_4, 185.54)  #Brush
17
    layer_5 = ba.Layer(material_5)          #D2O
18

    
19
    # Defining Roughness Parameters
20
    layerRoughness_1 = ba.LayerRoughness(0.99, 0.3, 5.0*nm)
21
    layerRoughness_2 = ba.LayerRoughness(0.39, 0.3, 5.0*nm)
22
    layerRoughness_3 = ba.LayerRoughness(0.38, 0.3, 5.0*nm)
23
    layerRoughness_4 = ba.LayerRoughness(48.8, 0.3, 5.0*nm)
24

    
25
    # Defining Multilayers
26
    multiLayer_1 = ba.MultiLayer()
27
    multiLayer_1.addLayer(layer_1)
28
    multiLayer_1.addLayerWithTopRoughness(layer_2, layerRoughness_1)
29
    multiLayer_1.addLayerWithTopRoughness(layer_3, layerRoughness_2)
30
    multiLayer_1.addLayerWithTopRoughness(layer_4, layerRoughness_3)
31
    multiLayer_1.addLayerWithTopRoughness(layer_5, layerRoughness_4)
32
    return multiLayer_1
33

    
34

    
35
def run_simulation():
36
    simulation = ba.DepthProbeSimulation()
37
    simulation.setBeamParameters(8.0*angstrom, 500, 0.0*deg, 0.7*deg)
38
    simulation.setZSpan(500, -300.0*nm, 100.0*nm)
39

    
40
    sample = get_sample()
41
    simulation.setSample(sample)
42
    simulation.runSimulation()
43
    return simulation.result()
44

    
45

    
46
if __name__ == '__main__':
47
    result = run_simulation()
48
    ba.plot_simulation_result(result)