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
|
#!/usr/bin/env python3
"""
Basic example of specular reflectometry simulation,
using a standard sample from Wrap/Python/std_samples.py.
"""
import bornagain as ba
from bornagain import ba_plot as bp, deg, angstrom, std_samples
def get_sample():
return std_samples.alternating_layers()
def get_simulation(sample):
n = 50
scan = ba.AlphaScan(n, 2*deg/n, 2*deg)
scan.setWavelength(1.54*angstrom)
return ba.SpecularSimulation(scan, sample)
if __name__ == '__main__':
sample = get_sample()
simulation = get_simulation(sample)
result = simulation.simulate()
from bornagain import ba_check
ba_check.persistence_test(result)
|