Scattering simulation

To set up and run a scattering simulation, use

import bornagain as ba
beam = ...
sample = ...
detector = ...
simulation = ba.ScatteringSimulation(beam, sample, detector)
# ... set options
result = simulation.simulate()

For the constructor arguments, see sections beam sample, and detector.

For optional settings, see simulation options.

For the return type of function simulate(), see SimulationResult.

SAS vs GISAS

At this level, the same syntax applies to SAS and GISAS (small-angle scattering under normal or grazing incidence).

The difference comes from the beam and sample model:

For SAS, use an incident beam with a grazing angle of $90^\circ$ (see e.g. the basic sas example).

For GISAS, the incident beam has a grazing angle of at most a few degrees (see e.g. the basic gisas example).

The distorted-wave Born approximation (DWBA) is automatically applied if a sample has more than one layer (see gisas-no-dwba-terms for a GISAS model with no reflecting layer interface, hence described by the regular Born approximation).