irradiapy.spectrapka.spectra2srim module
SPECTRA-PKA subpackage core module.
- class irradiapy.spectrapka.spectra2srim.Spectra2SRIM(seed=0, check_interval=0.2, plot_type=5, xmin=0.0, xmax=0.0, do_ranges=1, do_backscatt=1, do_transmit=1, do_sputtered=1, do_collisions=1, exyz=0.0, autosave=0)[source]
Bases:
objectSpectra2SRIM class to run SPECTRA-PKA to SRIM workflow.
- Variables:
seed (int (default=0)) – Seed for SRIM randomness.
spectrapka_in_path (Path) – SPECTRA-PKA input file path, for target definition.
spectrapka_events_path (Path) – SPECTRA-PKA config_events.pka file path, for recoils data.
root_dir (Path) – Root output directory where all data will be stored.
srim_width (float, optional (default=1e8)) – The SPECTRA-PKA box might be small for SRIM ions. To avoid backscattering and transmission, SPECTRA-PKA recoils are injected at the middle of a thick SRIM target of this width (in Angstrom). In postprocessing, the depth offset is corrected to get the position in the SPECTRA-PKA box. Note that due to SRIM limitations, recoils positions are rounded to a number of the form “xxxxx.E+xx”, if this width is set too high, precision might be lost, but backscattering/transmission might happen if set too low. Unfortunately, there is not a strict rule to set this value.
matdict (dict[str, Any]) – Material dictionary with SPECTRA-PKA material information.
recoilsdb (RecoilsDB) – Database to store all recoils collected from SPECTRA-PKA and SRIM calculations.
check_interval (float (default=0.2)) – Interval to check for SRIM window/popups.
plot_type (int (default=5)) – Plot type during SRIM calculations. 5 for no plots (faster calculations).
xmin (float (default=0.0)) – Minimum x for plots and depth-dependent means during SRIM calculations. Particularly important for large targets, since SRIM divides it in 100 segments.
xmax (float (default=0.0)) – Maximum x for plots and depth-dependent means during SRIM calculations. Particularly important for large targets, since SRIM divides it in 100 segments. 0.0 for full target.
do_ranges (int (default=1)) – Whether to save RANGE.txt file. Disabling this might cause errors afterwards because of missing tables.
do_backscatt (int (default=1)) – Whether to save BACKSCAT.txt file. Disabling this might cause errors afterwards because of missing tables.
do_transmit (int (default=1)) – Whether to save TRANSMIT.txt file. Disabling this might cause errors afterwards because of missing tables.
do_sputtered (int (default=1)) – Whether to save SPUTTER.txt file. Disabling this might cause errors afterwards because of missing tables.
do_collisions (int (default=1)) – Whether to save COLLISON.txt file. Disabling this might cause errors afterwards because of missing tables.
exyz (float (default=0.0)) – Whether to save ions position every time they loose exyz energy in the EXYZ.txt file.
autosave (int (default=0)) – Autosave every this number of ions. 0 to disable.
- run(density, spectrapka_in_path, spectrapka_events_path, root_dir, srim_width, calculation, max_energy_rel, exclude_recoils=None, max_srim_iters=32, minimize_window=False, fp_energy_abs=1000.0)[source]
Run the SPECTRA-PKA to SRIM workflow.
- Parameters:
density (
float) – Density of the target material in g/cm3.spectrapka_in_path (
Path) – SPECTRA-PKA input file path, for target definition.spectrapka_events_path (
Path) – SPECTRA-PKA config_events.pka file path, for recoils data.root_dir (
Path) – Root output directory where all data will be stored.srim_width (
float) – The SPECTRA-PKA box might be small for SRIM ions. To avoid backscattering and transmission, SPECTRA-PKA recoils are injected at the middle of a thick SRIM target of this width (in Angstrom). In postprocessing, the depth offset is corrected to get the position in the SPECTRA-PKA box. Note that due to SRIM limitations, recoils positions are rounded to a number of the form “xxxxx.E+xx”, if this width is set too high, precision might be lost, but backscattering/transmission might happen if set too low. Unfortunately, there is not a strict rule to set this value.calculation (
str) – SRIM calculation mode: “quick”, “full” or “mono”.max_energy_rel (
float) – Relative recoil energy threshold for matching MD debris datasets. Recoils abovemax_dataset_energy * max_energy_relare sent to SRIM, wheremax_dataset_energyis the highest recoil energy available in the matching dataset data. Must be at least 1.0.exclude_recoils (
list[str] |None) – List of symbols of recoils atoms to exclude from processing.max_srim_iters (
int) – Maximum number of SRIM iterations.minimize_window (
bool) – Whether to minimize the SRIM window while SRIM simulations run.fp_energy_abs (
float) – Absolute recoil energy below which unmatched recoils are represented by Frenkel pairs instead of being sent to SRIM, in eV.
- Returns:
Database with all recoils collected.
- Return type: