To get started with BornAgain scripting, run a first example.
The commands using python below assume that BornAgain is
installed in the active environment and import bornagain
succeeds.
This and other scripts are available in the example catalog.
Download the following example script,
using the link just below the code frame.
Save the script under the name AlternatingLayers.py.
|
|
For a discussion of the content of this script, see simulation/reflectometry.
In a terminal with the BornAgain environment activated, run:
python AlternatingLayers.py
The script opens a 3D sample view and a Matplotlib window showing this reflectometry curve:
On Linux and Windows, you can instead let uv prepare the script’s environment:
uv run AlternatingLayers.py
With the BornAgain environment activated, make the script executable and run it directly:
chmod a+x AlternatingLayers.py
./AlternatingLayers.py
The first line, #!/usr/bin/env python3, selects python3 from PATH.