To get started with BornAgain scripting, run a first example.
We assume that BornAgain and Python are
installed
and that you verified that the Python interpreter can
find the module bornagain
.
We shall now run a first example script.
This and all other example scripts can also be found in the BornAgain distribution,
in directory Examples
.
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.
At the command prompt in a terminal, launch the script with the command
python AlternatingLayers.py
(on systems that still have Python2, the command may rather be python3
).
As result, a MatPlotLib window should pop up, and display this reflectometry curve:
Under a Unix shell,
the script can also be launched without typing python
at the command prompt:
AlternatingLayers.py
This is made possible by the line “#!/usr/bin/env python3
” on top of the script.
It may be necessary to make the script executable by
chmod a+x AlternatingLayers.py