solprop.driver.plane_view#
The lazy view of a saved plane that a plane observer is shown (SEP 41, S3).
A reporter that defines observe_plane (ProgressReporter) 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
|
One saved plane, as a plane observer sees it; valid only during the call. |
|
Show a run's saved planes to its reporter, when it defines |
- class solprop.driver.plane_view.PlaneView(plane, index, metadata, fetch, spend, *, stored=None)[source]#
Bases:
objectOne saved plane, as a plane observer sees it; valid only during the call.
- Parameters:
- planesolprop.output.records.SavedPlane
The plane as committed, its field
Nonewhere the output keeps none.- indexint
Its index among the saved planes.
- metadatasolprop.output.metadata.RunMetadata
The run’s record.
- fetchcallable or None
Returns the plane’s field where it was not kept;
Nonewhere it was.- spendsolprop._host.ObserverSpend
The run’s observer ledger, which counts the fetches.
- storedsolprop.output.records.StoredField or None, optional
The kept field as the output stored it, where it was exported straight into the output (SEP 47 section 5.4) and the plane carries none: the view reads that, with no fetch.
- 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]#
The run’s basis.
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_energyis a spatial plane’s energy per frequency bin, wherespectral_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]#
What the plane’s derived quantities are.
Whether its power, energy, density and field are physical fluxes, as
solprop.capabilities.output()states them; a spatial plane has only its field.
- 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)– whatoutput.fields("fft")returns for the plane, and what the functionals ofsolprop.spatial(spatial_power,spatial_fluenceand the rest) take with the run’sSpatialFlux, 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:
objectShow a run’s saved planes to its reporter, when it defines
observe_plane.- Parameters:
- reportersolprop.log.ProgressReporter
The run’s reporter; only one that defines
observe_planeis shown planes.- metadatasolprop.output.metadata.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, stored=None)[source]#
Show one committed plane, detaching an observer that fails.
- Parameters:
- planesolprop.output.records.SavedPlane
The plane as committed.
- indexint
Its index among the saved planes.
- storedsolprop.output.records.StoredField or None, optional
Its kept field as the output stored it, where it was exported straight into the output and the plane carries none.
- Warns:
- SolpropWarning
When the observer raised, which then sees no more planes in this run.