Plotting results¶
simple-plot turns the files of a finished run into figures, including a
binomial confidence band on the loss fraction. It reads output only and never
runs SIMPLE. Install it with python -m pip install '.[plotting]'.
simple-plot losses run/ -o losses.png
simple-plot losses run/ --confidence 0.99 -o losses-99.png
simple-plot classes run/ -o classes.png
simple-plot wall run/results.nc --color incidence -o wall.png
simple-plot poincare run/ -o poincare.png
-o saves the figure (format from the extension); without it the figure
opens interactively. Set MPLBACKEND=Agg on headless machines. A missing
file or variable gives an error and exit status 2.
Losses and their uncertainty¶
losses reads confined_fraction.dat and plots, on a logarithmic time
axis, the confined total, its passing and trapped parts (same denominator,
so they add up to the total) and the lost fraction. Rows at \(t = 0\) are
skipped; rows without resolved markers appear as gaps.
The shaded band is a pointwise Wilson interval for the lost fraction. With
\(n\) the resolved markers (column 4), \(k = \text{round}(n(1 -
f_\text{pass} - f_\text{trap}))\) the lost markers, \(p = k/n\) and
\(z\) the standard-normal quantile at \((1 + c)/2\) for confidence
\(c\) (default 0.95, --confidence),
Implemented in python/pysimple/cli.py (wilson_interval). Unlike
\(p \pm z\sqrt{p(1-p)/n}\), it stays inside \([0, 1]\) and is
nonzero for \(k = 0\). It assumes independent, equally weighted markers
and covers sampling error only, not numerical error, and it is not a
simultaneous band for the whole curve. Unresolved markers are excluded, not
counted as lost; check unresolved_fraction.dat.
Classes, wall hits, Poincaré sections¶
classesCounts the \(J_\parallel\), topological and fractal class codes, including 0 (unclassified), from
class_parts.dator, if absent,iclassinresults.nc.wallR–Z footprint of markers with
wall_hit = 1atwall_hit_cart, all toroidal positions combined, incart_units. Colour is \(E/E_0 = (v/v_0)^2\) fromzend(default) orwall_hit_cos_incidence(--color incidence; 0 grazing, 1 normal). Needsresults.ncfrom a run withwall_inputandoutput_results_netcdf = .true.; LCFS losses have no wall footprint.poincareR–Z field-line sections from the
poincare_vol<N>.datfiles ofspectre_poincare.x, coloured by the volume-local \(s\).
File formats: Outputs. Wall setup: Wall heat loads.