Examples¶
Runnable examples come in two forms: scripts, which print or write results to a folder, and notebooks, which show the same APIs step by step with plots and tables. Both are in the repository.
Scripts¶
The scripts are in
examples/scripts. The
boron script is the reference case of the agent route too.
Script |
What it does |
|---|---|
|
The reference case: 20 keV boron at 7 degrees into 100 nm Au on Si. Prints the mean depth (about 282 Å for 200 ions, seed 12345), the straggling and the damage peak depth. |
|
A full-cascade run through a three-layer target (Au / Si / Al). Writes the vacancy profile to |
|
SRIM’s SR module: stopping power and range of He in Si from 10 keV to 1 MeV, as |
The boron case as a |
|
|
A scan of B into 1000 nm of Si at 20 and 40 keV, each at 0 and 30 degrees, on two worker processes. Writes |
The same scan as a file: |
|
|
A beam with a 1 keV Gaussian energy spread, in exact and in binned mode. Writes |
Notebooks¶
The notebooks are in
examples/notebooks.
They are committed without outputs.
Notebook |
What it shows |
|---|---|
Running TRIM and turning every output table into a pandas DataFrame, with a summary. |
|
A beam with an energy spread, in exact and in binned mode, with plots. |
|
Collisions and cascades: streaming |
|
A layered target described once as a run spec ( |
|
Stopping power and range with SRIM’s SR module, which needs no ion histories. Provided by Arto Javanainen. |
|
A parameter scan with a live view: the same run for several energies, on worker processes. |
|
Damage maps of ions in SiC from full cascades, showing where the collisions happen. |
Run them¶
Install pysrim2 and set up SRIM once. Check the setup with pysrim2 doctor:
pip install pysrim2
pysrim2 install
pysrim2 doctor
Then run a script from any folder, for example python boron_in_gold_on_silicon.py.
Each script writes its results to a local output folder.
The scripts also run in the container, which needs no SRIM on your machine. See Container for the commands and the Docker seccomp profile. The examples README has the full list of commands.
The notebooks find SRIM in its default location, natively or in the container, so run
pysrim2 install first. The beam plots need matplotlib: pip install "pysrim2[plot]".
SRIM is free for non-commercial use only. See the LEGAL.rtf file of your SRIM copy.