stagyyparsers
Parsers of StagYY output files.
Note
These functions are low level utilities. You should not use these unless
you know what you are doing. To access StagYY output data, use an instance
of StagyyData
.
time_series
Read temporal series text file.
If colnames
is too long, it will be truncated. If it is too short,
additional numeric column names from 0 to N-1 will be attributed to the N
extra columns present in timefile
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timefile |
Path
|
path of the time.dat file. |
required |
colnames |
list[str]
|
names of the variables expected in |
required |
Returns:
Type | Description |
---|---|
Optional[DataFrame]
|
A |
time_series_h5
Read temporal series HDF5 file.
If colnames
is too long, it will be truncated. If it is too short,
additional column names will be deduced from the content of the file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timefile |
Path
|
path of the TimeSeries.h5 file. |
required |
colnames |
list[str]
|
names of the variables expected in |
required |
Returns:
Type | Description |
---|---|
Optional[DataFrame]
|
A |
rprof
Extract radial profiles data.
If colnames
is too long, it will be truncated. If it is too short,
additional numeric column names from 0 to N-1 will be attributed to the N
extra columns present in timefile
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rproffile |
Path
|
path of the rprof.dat file. |
required |
colnames |
list[str]
|
names of the variables expected in |
required |
Returns:
Name | Type | Description |
---|---|---|
profs |
dict[int, DataFrame]
|
a dict mapping istep to radial profiles. |
times |
Optional[DataFrame]
|
the time indexed by time steps. |
rprof_h5
rprof_h5(
rproffile: Path, colnames: list[str]
) -> tuple[dict[int, DataFrame], Optional[DataFrame]]
Extract radial profiles data.
If colnames
is too long, it will be truncated. If it is too short,
additional column names will be deduced from the content of the file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rproffile |
Path
|
path of the rprof.h5 file. |
required |
colnames |
list[str]
|
names of the variables expected in |
required |
Returns:
Name | Type | Description |
---|---|---|
profs |
dict[int, DataFrame]
|
a dict mapping istep to radial profiles. |
times |
Optional[DataFrame]
|
the time indexed by time steps. |
refstate
refstate(
reffile: Path, ncols: int = 8
) -> Optional[
tuple[list[list[DataFrame]], list[DataFrame]]
]
Extract reference state profiles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reffile |
Path
|
path of the refstate file. |
required |
ncols |
int
|
number of columns. |
8
|
Returns:
Name | Type | Description |
---|---|---|
syst |
Optional[tuple[list[list[DataFrame]], list[DataFrame]]]
|
list of list of |
adia |
Optional[tuple[list[list[DataFrame]], list[DataFrame]]]
|
list of |
field_istep
Read istep from binary field file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fieldfile |
Path
|
path of the binary field file. |
required |
Returns:
Type | Description |
---|---|
Optional[int]
|
the time step at which the binary file was written. |
field_header
Read header info from binary field file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fieldfile |
Path
|
path of the binary field file. |
required |
Returns:
Type | Description |
---|---|
Optional[dict[str, Any]]
|
the header information of the binary file. |
fields
Extract fields data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fieldfile |
Path
|
path of the binary field file. |
required |
Returns:
Type | Description |
---|---|
Optional[tuple[dict[str, Any], NDArray]]
|
the tuple |
tracers
Extract tracers data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tracersfile |
Path
|
path of the binary tracers file. |
required |
Returns:
Type | Description |
---|---|
Optional[dict[str, list[NDArray]]]
|
Tracers data organized by attribute names and blocks. |
read_geom_h5
Extract geometry information from hdf5 files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xdmf |
FieldXmf
|
xdmf file parser. |
required |
snapshot |
int
|
snapshot number. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
geometry information. |
read_field_h5
read_field_h5(
xdmf: FieldXmf,
fieldname: str,
snapshot: int,
header: Optional[dict[str, Any]] = None,
) -> Optional[tuple[dict[str, Any], NDArray]]
Extract field data from hdf5 files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xdmf |
FieldXmf
|
xdmf file parser. |
required |
fieldname |
str
|
name of field to extract. |
required |
snapshot |
int
|
snapshot number. |
required |
header |
Optional[dict[str, Any]]
|
geometry information. |
None
|
Returns:
Type | Description |
---|---|
Optional[tuple[dict[str, Any], NDArray]]
|
geometry information and field data. None is returned if data is unavailable. |
read_tracers_h5
Extract tracers data from hdf5 files.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xdmf |
TracersXmf
|
xdmf file parser. |
required |
infoname |
str
|
name of information to extract. |
required |
snapshot |
int
|
snapshot number. |
required |
Returns:
Type | Description |
---|---|
list[NDArray]
|
Tracers data organized by attribute and block. |