kicad2ems.core.fields.dumps

Field dumps: planes or volumes of E, H or current density, in the time or
frequency domain.

Spec (command line --dump, repeatable, or `dump = [...]` in the TOML config):

    FIELD@REGION[@FREQS]

    FIELD   E | H | J        (J = total current density, rot H: shows the
                             copper currents)
    REGION  F.Cu             plane at a copper layer's height
            F.Cu+0.05        ... offset in mm (+ up, - down), e.g. inside the
                             dielectric under a trace
            z=0.3            plane at a height (mm, z = 0 at the bottom copper)
            x=12  /  y=7     vertical cut planes (KiCad mm, y down as in KiCad)
            volume           the whole board (outline x stack) plus 0.5 mm
            volume+5         ... with 5 mm of air above and below (fringing
                             fields, an antenna's near field; the GUI's 3D
                             view)
            box=x0,y0,z0,x1,y1,z1   any box (KiCad mm, z as above)
    FREQS   2,4,6            GHz: frequency-domain dump (HDF5) at those
                             frequencies, plotted to PNG
            (omitted)        time-domain dump (VTK series: the GUI's Fields
                             tab, live, or ParaView)

Examples:  --dump [email protected]+0.05@2,6   --dump [email protected]@4   --dump E@y=7
           --dump H@volume@5

Planes are clipped to the board outline (+1 mm) and the stack (+1 mm air), so a
dump does not cover the empty air margin; `volume` is the board + 0.5 mm; a box
is used as given.
class kicad2ems.core.fields.dumps.Dump(spec, field, start, stop, freqs, normal=None, label='')[source]
A field dump, as parse_dump makes it from a --dump spec: the field (E, H,
J), its box (start, stop: mm), its frequencies (Hz; None: time domain), the
normal axis of a plane (None: a volume) and its file name (name).
cells(mesh)[source]
The mesh points it records on a grid (mesh: the x, y, z lines,
mm).
describe(mesh)[source]
One line for the log: its name, the field, plane or volume, its
points on this grid, the domain.
kicad2ems.core.fields.dumps.add_dumps(CSX, dumps)[source]
Add the dump boxes to a CSXCAD structure (plain Python numbers: older
CSXCAD is strict).
kicad2ems.core.fields.dumps.estimate_size_mb(dumps, mesh, n_td_frames=60)[source]
Rough disk use: 3 float32 components per point; FD stores complex values
per frequency.
kicad2ems.core.fields.dumps.parse_dump(spec, m, mesh=None)[source]
Turn a dump spec into a Dump (model coordinates: mm, y up).
kicad2ems.core.fields.dumps.plot_fd_dumps(d, path, m, out_prefix, norm=None, port='', log=<built-in function print>)[source]
|field| maps of a frequency-domain plane dump, one PNG per frequency,
copper outlined. norm: {freq: incident port voltage} - fields are then
scaled to a 1 V incident wave at that port.
kicad2ems.core.fields.dumps.read_fd(path)[source]
openEMS HDF5 frequency-domain dump -> (mesh dict x/y/z in mm, list of
(freq Hz, field (nx, ny, nz, 3) complex)). Handles the newer layout (complex
dataset 'f<i>', attribute d_order, mesh in drawing units with mesh_scaling)
and the older one ('f<i>_real' / 'f<i>_imag', z-y-x order, mesh in m).
kicad2ems.core.fields.dumps.read_npz(path)[source]
A frequency-domain dump as a grid (mom25d's currents): (mesh x/y/z mm,
[(freq Hz, (nx, ny, nz, 3))]).
kicad2ems.core.fields.dumps.write_info(path, dumps, m, dt_ps=None)[source]
<run>/dump_info.json, written before the run so a viewer can follow it
live: the dumps, the timestep and the geometry to outline (board outline,
copper per layer, ports; model mm, y up).
kicad2ems.core.fields.dumps.write_norm(path, norm)[source]
<run>/dump_norm.json: the incident port voltage at each frequency-domain
dump frequency.
kicad2ems.core.fields.dumps.write_npz(path, mesh, freqs, data)[source]
The counterpart of read_npz: data (nf, nx, ny, nz, 3) complex.