solprop.backends.numpy_ref.statistics#
The statistics the reference forms itself, from a committed state (SEP 9, SEP 19).
ReferenceStatistics answers NumpyWorkspace.stats. The statistics of the
saved field are solprop.stats.collect()’s (or, on a spatial geometry,
solprop.backends.spatial.collect_spatial()’s), with the Poynting weight and the
basis metric at the plane; the ones a saved plane does not carry are formed here: the
electron density and peak ionisation rate at the densest node, the species and
mixture populations, the plasma integration diagnostics (SEP 18), the peak on-axis
intensity and the four on-axis plasma statistics, which scan the field synthesised on
the axis unless a quadrature node sits there. ReferenceStatistics.node_fields()
is the one definition of the node fields every population scan reads, the fields the
stage’s response pass evaluates.
Classes
|
The reference's statistics of a state, and the tables they read. |
- class solprop.backends.numpy_ref.statistics.ReferenceStatistics(problem, request, *, node_chunk, grid, modes, profiles, name)[source]#
Bases:
objectThe reference’s statistics of a state, and the tables they read.
Built once by the workspace from the validated problem and request. It holds no state of the run:
collect()is handed the committed state and the quadrature alarm, and keeps only what does not depend on them – the far-field tables, the Poynting weight’s buffer, the on-axis synthesis matrix and the axis node.- Parameters:
- problemsolprop.translate.problem.PropagationProblem
The validated problem.
- requestsolprop.translate.run_request.RunRequest
Its run’s request, whose statistics the far-field tables are formed for.
- node_chunkint
The nodes a population scan holds at once.
- gridsolprop.grid.TimeGrid or None
The grid the state lives on, which the statistics need.
- modescollections.abc.Sequence or None
The propagated modes, in state order, for the on-axis statistics.
- profilescollections.abc.Mapping or None
The z-profiles keyed by statistic name.
- namestr
The backend’s name, for messages.
- Attributes:
- axis_scansint
The on-axis plasma scans actually run (SEP 19), so that a test can see that a rule with a node on the axis supplies that row instead of a fresh scan.
- collect(spec, state, z, *, alarm)[source]#
Collect the requested statistics of a state at a position.
The statistics of the saved field go to
solprop.stats.collect(); there is exactly one definition of each in the package and that is it. The statisticssolprop.stats.StatDefinitionmarksbackendare of quantities a saved plane does not carry – the electron density, the peak ionisation rate, the on-axis intensity, the quadrature error – and are formed here from the state and the workspace’s tables.- Parameters:
- specsolprop.stats.StatsSpec
Which statistics and which windows.
- statenumpy.ndarray
The committed state, shape
(n_modes, n_pol, n_omega).- zfloat
The state’s position, m.
- alarmfloat
The quadrature alarm the last accepted step scored, which the
quadrature_errorstatistic reports.
- Returns:
- dict
Small host arrays keyed by statistic name.
- node_fields(state, z)[source]#
Yield the physical field at the nodes the responses see, chunk by chunk.
The fields the stage’s response pass evaluates, on the fine time grid: the modal quadrature’s nodes at once (
_nodes_at), or a separable geometry’s physical nodes by the node chunk – the slab synthesis in x, which carries the pad scale, or the inverse transverse DFT followed by the pad scale.- Parameters:
- statenumpy.ndarray
A state, shape
(n_modes, n_pol, n_omega).- zfloat
Its position, m.
- Yields:
- numpy.ndarray
The field at a chunk of nodes, V/m, shape
(n_nodes_chunk, n_components, n_to): real on a field grid, complex on an envelope grid.