Buildup simulation outputs
The main output is a MATLAB .mat file, named Pyecltest.mat by default.
filen_main_outp selects another name. Multiple-cloud simulations write an
output file for each cloud. This page covers the buildup output; single-bunch
beam monitors use HDF5 files as shown in the
single-bunch tutorial.
Read a result
from PyECLOUD.myloadmat_to_obj import myloadmat_to_obj
data = myloadmat_to_obj("Pyecltest.mat")
print(sorted(name for name in vars(data) if not name.startswith("__")))
print(data.t.shape, data.Nel_timep.shape)
The loader exposes output variables as attributes and removes singleton dimensions
by default (squeeze=True). Inspect shapes before indexing
histograms, especially for runs with only one sample or bunch passage.
Use myloadmat_to_obj("Pyecltest.mat", squeeze=False) to preserve singleton axes.
The file can also be read with SciPy’s scipy.io.loadmat.
The buildup tutorial plots the
simulation time series.
See Plotting buildup results for the full
set of example figures and histogram projections.
Time series
N_steps denotes the number of saved time samples, N_pass the number of
recorded bunch passages, N_bins the number of horizontal histogram bins,
and N_en the number of energy bins. The time-series arrays below have shape
(N_steps,) after squeezing, provided there is more than one sample.
Use the saved t array as the time coordinate. The saver uses a sampling
interval based on Dt_ref * dec_fact_out; saving and tracking need not occur
at the same cadence. Entries for emitted and impacting electrons accumulate
over the interval since the previous saved sample.
PyECLOUD represents a transverse section. Electron population sums are normalized per unit longitudinal length, not counts integrated over a whole magnet. Weighted electron energies likewise carry that longitudinal normalization. Central and probe densities divide by the transverse sampling area to give volume density.
Variable |
Meaning |
|---|---|
|
Saved simulation times [s]; one value per recorded sample |
|
Beam line density [particles/m] at those times |
|
Electron population in the chamber [electrons/m] |
|
Electrons emitted during the saved interval, per metre |
|
Electrons impacting during the saved interval, per metre |
|
Weighted emitted-electron energy during the interval [eV/m] |
|
Weighted impacting-electron energy during the interval [eV/m] |
|
Total weighted electron kinetic energy currently in the chamber [eV/m] |
|
Electron volume density in a transverse disk of radius |
These time-series arrays share the saved sample index. With
flag_detailed_MP_info, N_mp_time records the total number of macroparticles
at each saved time and nel_mp_ref_time records their reference weight.
Other enabled models can add fields, such as electric-field energy or
cross-ionization observables.
Bunch passages and histograms
t_hist indexes bunch-passage records and xg_hist gives horizontal bin
coordinates. Horizontal histograms are organized by passage and horizontal
bin. Energy spectra use their own recorded times, t_En_hist, and energy-bin
coordinates, En_g_hist; do not assume their number of records equals the
number of bunch passages.
The passage arrays t_hist, N_mp_pass, N_mp_ref_pass, N_mp_impact_pass,
and N_mp_corrected_pass have shape (N_pass,). The horizontal coordinates
xg_hist have shape (N_bins,). The four horizontal histograms—nel_hist,
nel_impact_hist_tot, nel_impact_hist_scrub, and energ_eV_impact_hist—have
shape (N_pass, N_bins), with one row per passage and one column per bin.
Singleton axes are removed by the loader’s default squeezing.
Variable |
Meaning |
|---|---|
|
Times associated with bunch-passage records [s] |
|
Horizontal histogram coordinates [m] |
|
Number of macroparticles in the chamber at each passage |
|
Reference macroparticle weight at each passage |
|
Number of macroparticle impacts during each passage |
|
Number of macroparticle tracking corrections during each passage |
|
Horizontal histogram of the electron population |
|
Horizontal histogram of electron impacts |
|
Horizontal impact histogram restricted to energies above |
|
Horizontal histogram of weighted energy deposited at the walls |
|
Impacting-electron counts per recorded interval and energy bin |
|
Kinetic-energy histogram of all electrons in the chamber at each recorded energy-sampling time |
|
Times associated with the energy spectra [s] |
|
Energy-bin centres [eV] |
|
Electron lifetime counts per recorded interval and lifetime bin, with |
|
Lifetime-bin centres [s] |
|
Saved lifetime-histogram times [s], controlled by |
Lifetime histograms have their own sampling interval, Dt_lifetime_hist;
use t_lifetime_hist to locate their records in time.
The final bin of each energy and lifetime histogram collects entries outside the selected energy or lifetime range. Counts are binned accumulations; converting them into a density per unit energy or time requires the corresponding bin width and accumulation interval.
Other and optional fields
Some fields are absent when their feature is disabled; others may contain an empty array or a sentinel value. Inspect the saved data before plotting them.
Variable |
Meaning |
|---|---|
|
Time-series output sampling factor: for a fixed step |
|
Bunch spacing used internally [s] |
|
Recorded space-charge update times [s] |
|
Not used; kept for compatibility |
|
Transverse chamber area [m²] |
|
Electron impacts on chamber segments, with |
|
Emitted-electron histogram on chamber segments |
|
Total weighted energy deposited by impacting electrons on each chamber segment [eV/m], with |
|
Times of saved secondary-beam information [s] |
|
Secondary-beam line-density profiles [particles/m] |
|
Volume densities at locations configured by |
|
Probe centre coordinates [m] |
|
Probe radii [m] |
|
Detailed electron-position histogram, saved when the |
|
Coordinates of the detailed histogram bins [m], saved when the |
|
Histogram of the cosine of electron impact angles |
|
Coordinates of the impact-angle histogram bins |
This reference adapts the output section of
the original manual by
Giovanni Iadarola, Eleonora Belli, Philipp Dijkstal, Lotta Mether, Annalisa Romano,
Giovanni Rumolo, and Eric Wulff. Model-specific fields are not exhaustively
listed here.