import mikeio
"Viken", mikeio.EUMType.Water_Level) mikeio.ItemInfo(
Viken <Water Level> (meter)
The Dataset is the common MIKE IO data structure for data read from dfs files. The mikeio.read
method returns a Dataset with a DataArray for each item.
Each DataArray have the following properties:
mikeio.ItemInfo
with name, type and unitpandas.DatetimeIndex
with the time instances of the datanumpy.ndarray
The dfs items in MIKE IO are represented by the ItemInfo class. An ItemInfo consists of:
A dfs0 file is also called a time series file.
Read Dfs0 to Dataset:
<mikeio.Dataset>
dims: (time:744)
time: 2017-10-27 00:00:00 - 2017-10-29 18:00:00 (744 non-equidistant records)
geometry: GeometryUndefined()
items:
0: State 1Sign. Wave Height <Significant wave height> (meter)
1: State 2Sign. Wave Height <Significant wave height> (meter)
2: Mean StateSign. Wave Height <Significant wave height> (meter)
3: MeasurementSign. Wave Height <Significant wave height> (meter)
Read more on the Dfs0 page.
Convert the timeseries dataset to a pandas DataFrame:
State 1Sign. Wave Height | State 2Sign. Wave Height | Mean StateSign. Wave Height | MeasurementSign. Wave Height | |
---|---|---|---|---|
2017-10-27 00:00:00 | 1.749465 | 1.749465 | 1.749465 | 1.72 |
2017-10-27 00:10:00 | 1.811340 | 1.796895 | 1.807738 | NaN |
2017-10-27 00:20:00 | 1.863424 | 1.842759 | 1.853422 | NaN |
2017-10-27 00:30:00 | 1.922261 | 1.889839 | 1.897670 | NaN |
2017-10-27 00:40:00 | 1.972455 | 1.934886 | 1.935281 | NaN |
A dfs2 file is also called a grid series file. Values in a dfs2 file are ‘element based’, i.e. values are defined in the centre of each grid cell.
<mikeio.Dataset>
dims: (time:1, y:264, x:216)
time: 2020-05-15 11:04:52 (time-invariant)
geometry: Grid2D (ny=264, nx=216)
items:
0: Elevation <Total Water Depth> (meter)
Read more on the Dfs2 page.
MIKE IO has generic
functionality that works for all dfs files:
concat()
- Concatenates files along the time axisextract()
- Extract timesteps and/or items to a new dfs filediff()
- Calculate difference between two dfs files with identical geometrysum()
- Calculate the sum of two dfs filesscale()
- Apply scaling to any dfs fileavg_time()
- Create a temporally averaged dfs filequantile()
- Create a dfs file with temporal quantilesAll generic methods creates a new dfs file.