You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beam distributions in run.yaml and RunSpec: ion.energy_keV, ion.angle_deg and ion.azimuth_deg take a number or a distribution (Gaussian, uniform, triangular, log-normal, histogram file or inline, or a Python function), ion.position sets the start position, and beam: chooses exact or binned mode; --set and scan keys reach into the distributions. Runs without distributions are unchanged.
Exact mode of a distributed run (beam.mode: exact, the default) samples every ion from the distributions and writes SRIM's TRIM.DAT, so one TRIM.run() runs exactly that beam (calculation 1 and 2 become SRIM 4 and 5); the histogram files it used are copied to the run folder's beam/ folder. Up to 99 999 ions per run. An in-place run (srim_directory=) never deletes a TRIM.DAT or beam/ file that pysrim2 did not write, and an exact run there is refused if such a TRIM.DAT would be overwritten.
Binned beams in scans (beam.mode: binned): each scan point with a binned beam runs as one SRIM run per bin, the ions split over the bins by apportionment, in beam batches for precision targets and batch_ions; the bins' results are merged back into one result per point. Exact distributed points with more than 99 999 ions need batch_ions: 99999.
Point folders of batched scan points record their units (run.yaml, units.csv, and beam_bins.csv for binned beams), and srim.beam.open_results(point_dir) re-opens a finished batched point as one merged result.
Documentation for beam distributions: docs/beam.md (both modes, every shape, histogram files, Python functions, seeds, results and limits), an example script (examples/scripts/beam_energy_spread.py), a notebook (examples/notebooks/Beam.ipynb), beam sections in docs/run-spec.md, docs/scans.md and docs/dataframes.md, and an agent-skill section (skills/pysrim2/SKILL.md, section 8).
srim.beam.run_beam(spec) runs a distributed run spec (one TRIM run for an exact beam of up to 99 999 ions, else a one-point scan that splits exact beams into units and runs binned beams per bin) and returns the results; srim.beam.sampled_ions(results) reads the sampled ions back from TRIM.DAT, and srim.beam.plot_beam(results, parameter) draws the defined density over the sampled beam or the bins (matplotlib, the plot extra). pysrim2 run accepts distributed specs and prints where the results are.
Changed
The scan cache key and point id cover beam distributions: their definitions, histogram content (not only the file path) and the source of Python-function distributions, so a changed distribution never reuses an old run. Specs without distributions keep their keys.