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
Geometry information.
It is deduced from the information in the header of binary field files output by StagYY.
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
Bases: Mapping
Fields data structure.
The Step.fields
attribute is an instance of this class.
Fields
implements collections.abc.Mapping
. Keys are
fields names defined in stagpy.phyvars.[S]FIELD[_EXTRA]
. Each item
is a Field
instance.
geom
cached
property
Geometry information.
Geometry
instance holding geometry information.
It is issued from binary files holding field information.
Tracers
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
Radial profiles data structure.
The Step.rprofs
attribute is an instance of this class.
Rprofs
implements the getitem mechanism. Keys are profile names
defined in stagpy.phyvars.RPROF[_EXTRA]
. Items are
Rprof
instances.
Step
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.steps[n].geom is sdat.steps[n].fields.geom)
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 |
fields |
Fields
|
fields available at this time step. |
sfields |
Fields
|
surface fields available at this time step. |
tracers |
Tracers
|
tracers available at this time step. |
geom
property
Geometry information.
Geometry
instance holding geometry information.
It is issued from binary files holding field information. It is set to
None if not available for this time step.