While BornAgain is designed for GISAS experiments (using the Distorted Wave Born
Approximation), it naturally also contains the regular (plane wave) Born Approximation.
Accordingly, BornAgain can also simulate standard small-angle scattering (SAS).
However, there exist
several other specialized SAS softwares.
Therefore we do not advertise BornAgain for analysing SAS experiments,
and in general we do not provide user support for this application domain.
We rather recommend SASView,
which is institutionally supported by the European Spallation Source,
and was designated as standard SAS software in the European SINE2020 project.
Yet BornAgain can be an appropriate choice in cases where the sample structure or
the experimental conditions are not covered by other software.
For example, other softwares provide no, or limited, support for polarized SANS.
Here, we show how such experiments can be simulated with BornAgain.
Basic example
To simulate conventional small-angle scattering with BornAgain,
we turn source and detector by 90 degrees with respect to grazing-incidence geometry.
The following basic example simulates
scattering from a dilute random assembly of monodisperse, oriented dodecahedra.
#!/usr/bin/env python3"""
Basic example for regular small-angle scattering (SAS).
Sample is a dilute assembly of ordered dodecahedra.
"""importbornagainasbafrombornagainimportba_plotasbp,deg,nmimportmatplotlib.pyplotaspltdefget_sample():vacuum=ba.RefractiveMaterial("Vacuum",0,0)material_particle=ba.RefractiveMaterial("Particle",6e-4,2e-8)# Finite sample layer, contains particles:ff=ba.Dodecahedron(12*nm)particle=ba.Particle(material_particle,ff)layout=ba.ParticleLayout()layout.addParticle(particle)solution_layer=ba.Layer(vacuum,1000*nm)solution_layer.addLayout(layout)# Flat sample layer sandwiched between semi-infinite vacuum layers:sample=ba.Sample()sample.addLayer(ba.Layer(vacuum))sample.addLayer(solution_layer)sample.addLayer(ba.Layer(vacuum))returnsampledefget_simulation(sample):# Beam from above (perpendicular to sample):beam=ba.Beam(1e9,0.4*nm,0.001*deg)# Detector opposite to source:n=200# number of pixels per directiondetector=ba.SphericalDetector(n,-5*deg,5*deg,n,-5*deg,5*deg)returnba.ScatteringSimulation(beam,sample,detector)if__name__=='__main__':sample=get_sample()simulation=get_simulation(sample)result=simulation.simulate()bp.plot_simulation_result(result)plt.show()