solprop.driver.plane_view#

The lazy view of a saved plane that a plane observer is shown (SEP 41, S3).

A PlaneObserver is shown each saved plane as a PlaneView: the plane’s position, statistics row and basis at once, and its field, spectrum, power and spectral density only on request, computed by the same solprop.processing functions that read a file, so what an observer draws is what the file holds. On a device a plane whose field the output does not keep is fetched only when asked for, and the fetch is counted in the run’s resources.

Classes

PlaneView(plane, index, metadata, fetch, spend)

One saved plane, as a plane observer sees it; valid only during the call.

PlaneWatch(reporter, metadata, fetch, spend)

Show a run's saved planes to its reporter, when it is a plane observer.

class solprop.driver.plane_view.PlaneView(plane, index, metadata, fetch, spend)[source]#

Bases: object

One saved plane, as a plane observer sees it; valid only during the call.

Parameters:
planesolprop.output.schema.SavedPlane

The plane as committed, its field None where the output keeps none.

indexint

Its index among the saved planes.

metadatasolprop.output.schema.RunMetadata

The run’s record.

fetchcallable or None

Returns the plane’s field where it was not kept; None where it was.

spendsolprop._host.ObserverSpend

The run’s observer ledger, which counts the fetches.

Attributes:
zfloat

The plane’s position, m.

indexint

Its index among the saved planes.

statscollections.abc.Mapping

Its statistics row, by name.

property basis: Literal['modal', 'general_modal', 'spatial'][source]#

Return the run’s basis.

Returns:
{‘modal’, ‘general_modal’, ‘spatial’}

The basis capability its record declares.

field(**keywords)[source]#

Return the plane’s field in time, as the processing function returns it.

The function is solprop.processing.fields.get_field().

Parameters:
**keywordsAny

Its keywords, the plane excepted.

Returns:
tuple

The time axis and the field.

field_plane()[source]#

Return the plane as solprop.processing.planes.field_plane() reads it.

Its spectral_energy is a spatial plane’s energy per frequency bin, where spectral_density() refuses the columns of a spatial run.

Returns:
solprop.coupling.FieldPlane

The plane.

Raises:
solprop.exceptions.OutputError

For a run field_plane() refuses (a hybrid planar run, the modified noise model).

power(**keywords)[source]#

Return the plane’s power in time, as the processing function returns it.

The function is solprop.processing.fields.get_power().

Parameters:
**keywordsAny

Its keywords, the plane excepted.

Returns:
tuple

The time axis and the power, W.

Raises:
solprop.exceptions.OutputError

On a spatial run, whose columns the function would read as modes: solprop.spatial.spatial_power() is the beam’s power.

property quantities: dict[str, Quantity][source]#

Return what the plane’s derived quantities are.

Returns:
dict

Whether its power, energy, density and field are physical fluxes.

spectral_density(**keywords)[source]#

Return the plane’s spectral density, as the processing function does.

Parameters:
**keywordsAny

The keywords of solprop.processing.fields.get_spectral_density(), the plane excepted.

Returns:
tuple

The axis and the density.

Raises:
solprop.exceptions.OutputError

On a spatial run, whose columns the function would read as modes.

spectrum(**keywords)[source]#

Return the plane’s spectrum, as the processing function returns it.

The function is solprop.processing.fields.get_spectrum().

Parameters:
**keywordsAny

Its keywords, the plane excepted.

Returns:
tuple

The angular frequency axis and the spectrum.

stored()[source]#

Return the plane’s stored spectrum, as a file holds it.

The raw forward DFT in the internal convention, shape (n_modes, n_pol, n_omega) – what output.fields("fft") returns for the plane, and what the functionals of solprop.spatial (spatial_power, spatial_fluence and the rest) take with the run’s SpatialFlux, which is how a spatial run’s plane is measured while it runs.

Returns:
numpy.ndarray

A copy of the stored spectrum.

class solprop.driver.plane_view.PlaneWatch(reporter, metadata, fetch, spend)[source]#

Bases: object

Show a run’s saved planes to its reporter, when it is a plane observer.

Parameters:
reportersolprop.log.ProgressReporter

The run’s reporter; only a PlaneObserver is shown planes.

metadatasolprop.output.schema.RunMetadata

The run’s record.

fetchcallable

Returns the field at the current plane, for a plane the output keeps none of.

spendsolprop._host.ObserverSpend

The run’s observer ledger.

show(plane, index)[source]#

Show one committed plane, detaching an observer that fails.

Parameters:
planesolprop.output.schema.SavedPlane

The plane as committed.

indexint

Its index among the saved planes.

Warns:
SolpropWarning

When the observer raised, which then sees no more planes in this run.