To set up and run a specular reflectometry simulation, use
import bornagain as ba
scan = ...
sample = ...
simulation = ba.SpecularSimulation(scan, sample)
# ... set options
result = simulation.simulate()
Supported scan types: grazing angle scan, wavelength scan, wavenumber qz scan.
For the constructor arguments, see sections scan and sample.
For optional settings, see simulation options.
For the return type of function simulate(),
see Datafield.
simulate() returns reflected intensity, with reflectivity R:
I(x) = apply_background_to(I0 * R(x) * footprint(x))
Set I0 with scan.setIntensity(I0); the default is one.
If the medium of incidence absorbs, incident and reflected amplitudes refer to the lower interface of the top layer, or to the upper interface of the bottom layer for a beam from below. Attenuation between that plane and the physical source or detector is not included.
If the sample is in an external field, the field also permeates the top layer, where the two spin states of the neutron have different kinetic energies (Zeeman splitting). BornAgain then treats the two spin eigenmodes along the field as separate channels:
This follows Maranville et al., J. Appl. Cryst. 49, 1121 (2016), and the reference code Refl1D, except that Refl1D reports squared amplitudes without the flux factor.
For a beam from below, the bottom layer is the medium of incidence; a magnetic induction in the bottom layer is supported only if all inductions in the sample are parallel or antiparallel to it, and polarizer and analyzer must then be parallel or antiparallel to it as well.
Example: Zeeman splitting.