solprop.processing.planes#

Read one saved plane of a run back as a coherent field plane (SEP 31).

field_plane() turns a stored plane into a solprop.coupling.plane.FieldPlane: its native coefficients exactly as stored, the reference rebuilt from the run’s schema-24 plane-reference record, the medium’s metric at the plane’s own position, the path certificate and the provenance. It is the extraction half of plane exchange; the manual page is docs/guide/workflows/coupling.md.

A file records what it can: the frame integral, the spatial plane measure and the identities of a general guide’s reference, not the reference’s arrays. A general modal plane’s physical E/H and a dense basis Gram are therefore read with the simulation that ran it (source=), checked against the file’s identities first through solprop.processing.modal.

Module Attributes

PLANE_TOLERANCE

Relative distance, of the larger of 1 m and abs(z), within which a z names a plane.

Functions

field_plane(output[, plane, z, source])

Read one saved plane of a run as a FieldPlane.

solprop.processing.planes.PLANE_TOLERANCE = 1e-09#

Relative distance, of the larger of 1 m and abs(z), within which a z names a plane.

A requested position names a stored plane only if it is that plane to well within a step; a nearby physical plane that was not stored is refused, not substituted.

solprop.processing.planes.field_plane(output, plane=-1, *, z=None, source=None)[source]#

Read one saved plane of a run as a FieldPlane.

The samples are the stored optics-convention spectrum, unchanged. The reference is rebuilt from the run’s plane-reference record (output schema 24) at the plane’s stored position; the metric is the run’s own at that position – the axial admittance of a spatial plane (SEP 34), the identity for ordinary true-power coefficients, a general basis’s Gram; the path certificate is the AdiabaticAdmission the spatial record rebuilds. Radial, Cartesian, ordinary modal and general modal runs are read; a hybrid planar run is refused by name, and so is a run with the modified noise model, whose auxiliary noise phase is not reconstructed into the plane.

Parameters:
outputsolprop.output.schema.Output

An opened memory or HDF5 output of output schema 24.

planeint, optional

Index of the saved plane, negative from the end; default the last.

zfloat or None, optional

Position of the plane instead, m; it must be a stored plane’s to PLANE_TOLERANCE. A nearby plane is never substituted.

sourcesolprop.driver.Simulation or None, optional

The simulation that wrote the output, for what the file deliberately does not embed: a general guide’s E/H reference and a dense Gram, checked against the file’s identities; a spatial run’s medium, or an ordinary mode set’s scalar profiles (ScalarModeBasis, for a capillary’s HE1m or a step-index fibre’s HE1m modes), checked by configuration hash. Not needed otherwise.

Returns:
solprop.coupling.FieldPlane

The plane.

Raises:
ProcessingError

If the output predates schema 24 or holds no record, both plane and z are given, the selection names no stored plane, the run is planar or used the modified noise model, or source is not the run that wrote it.

Examples

>>> from solprop.driver import Simulation
>>> from solprop.processing import field_plane
>>> simulation = Simulation.from_gnlse(
...     0.11, 0.01, [0.0, 0.0, -1.183e-26], lambda0=835e-9,
...     wavelength_limits=(500e-9, 2e-6), trange=1e-12,
...     width=100e-15, peak_power=9.8, pulseshape="sech", n_save=3,
... )
>>> plane = field_plane(simulation.run())
>>> plane.kind, plane.geometry.z, plane.units
('modal', 0.01, 'sqrt(W)')