Newer
Older
GISAS simulation that includes the specular peak
"""
import bornagain as ba
from bornagain import ba_plot as bp, deg, nm
def get_sample():
"""
A lattice of box-shaped particles on a substrate.
material_particle = ba.RefractiveMaterial("Particle", 3e-05, 2e-08)
material_substrate = ba.RefractiveMaterial("Substrate", 6e-06, 2e-08)
vacuum = ba.RefractiveMaterial("Vacuum", 0, 0)
ff = ba.Box(5*nm, 5*nm, 10*nm)
# Lattice and interference function
lattice = ba.BasicLattice2D(8*nm, 8*nm, 90*deg, 0)
iff = ba.Interference2DLattice(lattice)
iff_pdf = ba.Profile2DCauchy(100*nm, 100*nm, 0)
iff.setDecayFunction(iff_pdf)
layout = ba.ParticleLayout()
layout.setInterference(iff)
layout.setTotalParticleSurfaceDensity(0.015625)
layer_1.addLayout(layout)
sample.addLayer(layer_1)
sample.addLayer(layer_2)
return sample

Wuttke, Joachim
committed
detector = ba.SphericalDetector(n, -2*deg, 2*deg, n, 0, 2*deg)
simulation = ba.ScatteringSimulation(beam, sample, detector)
simulation.options().setUseAvgMaterials(True)
simulation.options().setIncludeSpecular(True)
return simulation
if __name__ == '__main__':
simulation = get_simulation(sample)
result = simulation.simulate()
bp.plot_simulation_result(result)
bp.plt.show()