import mikeio1d
res = mikeio1d.open('../data/network.res1d')
res<mikeio1d.Res1D>
Res1D is the main interface for accessing data on a Network. Create a Res1D object by providing the path to a supported file type.
Support is provided for MIKE collection system, water distribution, and river modelling result files. Specific file extensions supported include:
All file types use the Res1D object despite their different file extensions. Behind the scenes, they are converted into the common Res1D format.
Network result files can be opened with mikeio1d.open.
Alternatively, you can explicitly create an instance of Res1D:
An overview of the file contents can be obtained by calling the info method.
Start time: 1994-08-07 16:35:00
End time: 1994-08-07 18:35:00
# Timesteps: 110
# Catchments: 0
# Nodes: 119
# Reaches: 118
# Globals: 0
0 - Water level (m)
1 - Discharge (m^3/s)
The unique quantity IDs are accessible via the quantities attribute.
All results share a common time index, which can be accessed via the quantities attribute.
DatetimeIndex([ '1994-08-07 16:35:00', '1994-08-07 16:36:01.870000',
'1994-08-07 16:37:07.560000', '1994-08-07 16:38:55.828000',
'1994-08-07 16:39:55.828000', '1994-08-07 16:40:55.828000',
'1994-08-07 16:41:55.828000', '1994-08-07 16:42:55.828000',
'1994-08-07 16:43:55.828000', '1994-08-07 16:44:55.828000',
...
'1994-08-07 18:25:07.967000', '1994-08-07 18:26:07.967000',
'1994-08-07 18:27:07.967000', '1994-08-07 18:28:07.967000',
'1994-08-07 18:29:07.967000', '1994-08-07 18:30:07.967000',
'1994-08-07 18:31:07.967000', '1994-08-07 18:32:07.967000',
'1994-08-07 18:33:07.967000', '1994-08-07 18:35:00'],
dtype='datetime64[ns]', length=110, freq=None)
All data can be read into a DataFrame by calling the mikeio1d.Res1D.read method.
| WaterLevel:1 | WaterLevel:2 | WaterLevel:3 | WaterLevel:4 | WaterLevel:5 | WaterLevel:6 | WaterLevel:7 | WaterLevel:8 | WaterLevel:9 | WaterLevel:10 | ... | Discharge:99l1:22.2508 | WaterLevel:9l1:0 | WaterLevel:9l1:10 | Discharge:9l1:5 | WaterLevel:Weir:119w1:0 | WaterLevel:Weir:119w1:1 | Discharge:Weir:119w1:0.5 | WaterLevel:Pump:115p1:0 | WaterLevel:Pump:115p1:82.4281 | Discharge:Pump:115p1:41.214 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1994-08-07 16:35:00.000 | 195.052994 | 195.821503 | 195.8815 | 193.604996 | 193.615005 | 193.625000 | 193.675003 | 193.764999 | 193.774994 | 193.804993 | ... | 0.000002 | 193.774994 | 193.764999 | 0.000031 | 193.550003 | 188.479996 | 0.0 | 193.304993 | 195.005005 | 0.0 |
| 1994-08-07 16:36:01.870 | 195.052994 | 195.821701 | 195.8815 | 193.604996 | 193.615005 | 193.625320 | 193.675110 | 193.765060 | 193.775116 | 193.804993 | ... | 0.000002 | 193.775070 | 193.765060 | 0.000031 | 193.550003 | 188.479996 | 0.0 | 193.306061 | 195.005005 | 0.0 |
| 1994-08-07 16:37:07.560 | 195.052994 | 195.821640 | 195.8815 | 193.604996 | 193.615005 | 193.625671 | 193.675369 | 193.765106 | 193.775513 | 193.804993 | ... | 0.000002 | 193.775391 | 193.765106 | 0.000033 | 193.550034 | 188.479996 | 0.0 | 193.307144 | 195.005005 | 0.0 |
| 1994-08-07 16:38:55.828 | 195.052994 | 195.821503 | 195.8815 | 193.604996 | 193.615005 | 193.626236 | 193.675751 | 193.765228 | 193.776077 | 193.804993 | ... | 0.000002 | 193.775894 | 193.765228 | 0.000037 | 193.550079 | 188.479996 | 0.0 | 193.308884 | 195.005005 | 0.0 |
| 1994-08-07 16:39:55.828 | 195.052994 | 195.821503 | 195.8815 | 193.604996 | 193.615005 | 193.626556 | 193.675949 | 193.765335 | 193.776352 | 193.804993 | ... | 0.000002 | 193.776154 | 193.765335 | 0.000039 | 193.550095 | 188.479996 | 0.0 | 193.309860 | 195.005005 | 0.0 |
5 rows × 495 columns
Locations are where model results exist in the network. The main location types are nodes, reaches, and catchments.
Limited functionality is provided for modifying result data. A common use case for this is hotstart files. Modifying static network data is not supported.
There are also several notebook examples available on our GitHub repositoryhttps://github.com/DHI/mikeio1d/tree/main/notebooks.