step
Implementation of Step objects.
Note
This module and the classes it defines are internals of StagPy, they
should not be used in an external script. Instead, use the
StagyyData class.
Geometry
dataclass
Geometry information.
It is deduced from the information in the header of binary field files output by StagYY.
r_centers
cached
property
Position of FV centers along the z/r direction.
cylindrical
cached
property
Whether the grid is in cylindrical geometry (2D spherical).
axisymmetric
cached
property
Whether the grid is in cartesian axisymmetric geometry.
at_z
Return iz closest to given zval position.
In spherical geometry, the bottom boundary is considered to be at z=0.
Use at_r to find a cell at a given radial position.
Fields
dataclass
Fields data structure.
The Step.fields attribute is an instance of this class.
Tracers
dataclass
Tracers data structure.
The Step.tracers attribute is an instance of this class.
Tracers implements the getitem mechanism. Items are tracervar names such
as "Type" or "Mass". The position of tracers are the "x", "y" and
"z" items.
Rprofs
Bases: ABC
Radial profiles.
Rprofs implements the getitem mechanism. Keys are profile names
defined in stagpy.phyvars.RPROF[_EXTRA]. Items are
Rprof instances.
RprofsInstant
dataclass
Bases: Rprofs
Radial profiles at a given step.
The Step.rprofs attribute is an instance of this class.
Step
dataclass
Time step data structure.
Elements of Steps and
Snaps instances are all Step
instances. Note that Step objects are not duplicated.
Examples:
Here are a few examples illustrating some properties of Step
instances.
sdat = StagyyData(Path("path/to/run"))
istep_last_snap = sdat.snaps[-1].istep
assert(sdat.steps[istep_last_snap] is sdat.snaps[-1])
n = 0 # or any valid time step / snapshot index
assert(sdat.steps[n].sdat is sdat)
assert(sdat.steps[n].istep == n)
assert(sdat.snaps[n].isnap == n)
assert(sdat.snaps[n] is sdat.snaps[n].fields.step)
Attributes:
| Name | Type | Description |
|---|---|---|
istep |
int
|
the index of the time step that the instance represents. |
sdat |
StagyyData
|
the owner of the |
geom
cached
property
Geometry information.
Geometry instance holding geometry information.
It is issued from binary files holding field information.