import mikeio1d
Read entire LTS event statistics file into a data frame.
res1d_events = mikeio1d.open("../tests/testdata/lts_event_statistics.res1d")
df_events = res1d_events.read()
Let's look at the full data frame. Here the integer index of the data frame specifies label of the event. The events are ordered from having the largest value to smallest value. So the smallest integer label represents an event with largest value. Note that entries with delete value $-1\times 10^{-35}$ specifies that there is no event.
df_events
WaterLevelMaximum:A0.0327 | WaterLevelMaximumTime:A0.0327 | DischargeIntegrated:A0.0327 | DischargeIntegratedTime:A0.0327 | DischargeMaximum:A0.0327 | DischargeMaximumTime:A0.0327 | DischargeDuration:A0.0327 | DischargeDurationTime:A0.0327 | Component_1Maximum:A0.0327 | Component_1MaximumTime:A0.0327 | ... | Component_1MaximumTime:Pump:B4.1510p2:0 | Component_1MaximumTime:Pump:B4.1510p2:80.0006 | Component_2Maximum:Pump:B4.1510p2:0 | Component_2Maximum:Pump:B4.1510p2:80.0006 | Component_2MaximumTime:Pump:B4.1510p2:0 | Component_2MaximumTime:Pump:B4.1510p2:80.0006 | Component_1TransportIntegrated:Pump:B4.1510p2:40.0003 | Component_1TransportIntegratedTime:Pump:B4.1510p2:40.0003 | Component_2TransportIntegrated:Pump:B4.1510p2:40.0003 | Component_2TransportIntegratedTime:Pump:B4.1510p2:40.0003 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | -1.000000e-35 | 1957-01-01 | 4684.849609 | 1959-08-15 09:36:24 | 1.256756 | 1961-06-13 15:58:24 | 9.108004 | 1957-07-20 09:39:20 | -1.000000e-35 | 1957-01-01 | ... | 1961-09-05 15:54:40 | 1957-06-11 10:27:52 | 5.000000e+01 | 50.0 | 1961-09-05 15:54:40 | 1957-06-11 10:27:52 | 67.307213 | 1961-09-05 14:31:28 | 33.653606 | 1961-09-05 14:31:28 |
1 | -1.000000e-35 | 1957-01-01 | 4608.099609 | 1961-09-05 12:17:20 | 1.236605 | 1961-09-05 15:02:24 | 6.788862 | 1957-06-11 04:12:20 | -1.000000e-35 | 1957-01-01 | ... | 1957-07-20 17:42:00 | 1957-07-20 16:33:04 | 5.000000e+01 | 50.0 | 1957-07-20 17:42:00 | 1957-07-20 16:33:04 | 45.068405 | 1961-06-13 15:44:16 | 22.534203 | 1961-06-13 15:44:16 |
2 | -1.000000e-35 | 1957-01-01 | 3744.287842 | 1961-06-13 15:38:24 | 0.958780 | 1959-08-15 13:38:08 | 5.560763 | 1959-08-15 09:36:24 | -1.000000e-35 | 1957-01-01 | ... | 1958-05-26 00:36:16 | 1958-05-26 00:44:24 | 5.000000e+01 | 50.0 | 1958-05-26 00:36:16 | 1958-05-26 00:44:24 | 43.389675 | 1958-05-25 23:16:16 | 21.694838 | 1958-05-25 23:16:16 |
3 | -1.000000e-35 | 1957-01-01 | 3631.110596 | 1958-05-25 21:11:20 | 0.941482 | 1958-05-25 23:35:16 | 4.831801 | 1961-09-05 12:17:20 | -1.000000e-35 | 1957-01-01 | ... | 1961-06-13 18:35:28 | 1961-09-05 15:54:56 | 5.000000e+01 | 50.0 | 1961-06-13 18:35:28 | 1961-09-05 15:54:56 | 35.251358 | 1959-08-15 13:26:56 | 17.625679 | 1959-08-15 13:26:56 |
4 | -1.000000e-35 | 1957-01-01 | 3070.262939 | 1957-07-20 09:39:20 | 0.878175 | 1957-07-27 16:30:04 | 4.549961 | 1958-05-25 21:11:20 | -1.000000e-35 | 1957-01-01 | ... | 1959-08-15 16:23:04 | 1959-08-15 16:04:08 | 5.000000e+01 | 50.0 | 1959-08-15 16:23:04 | 1959-08-15 16:04:08 | 23.928904 | 1957-06-04 15:09:51 | 11.964452 | 1957-06-04 15:09:51 |
5 | -1.000000e-35 | 1957-01-01 | 2337.491455 | 1957-06-11 04:12:20 | 0.830876 | 1962-07-21 15:19:28 | 4.169593 | 1958-05-24 19:07:20 | -1.000000e-35 | 1957-01-01 | ... | 1957-01-01 00:00:00 | 1961-06-13 18:10:56 | -1.000000e-35 | 50.0 | 1957-01-01 00:00:00 | 1961-06-13 18:10:56 | 23.925802 | 1962-07-21 14:31:28 | 11.962901 | 1962-07-21 14:31:28 |
6 | -1.000000e-35 | 1957-01-01 | 2319.675293 | 1957-06-04 14:28:20 | 0.763936 | 1959-08-15 10:02:00 | 4.119199 | 1958-11-10 13:35:20 | -1.000000e-35 | 1957-01-01 | ... | 1957-01-01 00:00:00 | 1958-11-10 16:18:44 | -1.000000e-35 | 50.0 | 1957-01-01 00:00:00 | 1958-11-10 16:18:44 | 21.306870 | 1957-07-27 16:17:58 | 10.653435 | 1957-07-27 16:17:58 |
7 | -1.000000e-35 | 1957-01-01 | 2229.712158 | 1962-07-21 13:50:24 | 0.742085 | 1957-06-04 15:22:01 | 3.769463 | 1957-09-07 22:18:20 | -1.000000e-35 | 1957-01-01 | ... | 1957-01-01 00:00:00 | 1962-06-19 15:37:52 | -1.000000e-35 | 50.0 | 1957-01-01 00:00:00 | 1962-06-19 15:37:52 | 18.159843 | 1959-08-15 09:49:36 | 9.079922 | 1959-08-15 09:49:36 |
8 | -1.000000e-35 | 1957-01-01 | 1884.727661 | 1962-06-19 12:18:24 | 0.710324 | 1957-06-11 09:53:49 | 3.661735 | 1959-07-02 03:15:20 | -1.000000e-35 | 1957-01-01 | ... | 1957-01-01 00:00:00 | 1957-06-04 16:38:19 | -1.000000e-35 | 50.0 | 1957-01-01 00:00:00 | 1957-06-04 16:38:19 | 15.088912 | 1957-07-20 15:23:58 | 7.544456 | 1957-07-20 15:23:58 |
9 | -1.000000e-35 | 1957-01-01 | 1610.750977 | 1958-11-10 13:35:20 | 0.669762 | 1961-08-22 06:47:12 | 3.626211 | 1962-06-19 12:18:24 | -1.000000e-35 | 1957-01-01 | ... | 1957-01-01 00:00:00 | 1962-07-21 15:56:16 | -1.000000e-35 | 50.0 | 1957-01-01 00:00:00 | 1962-07-21 15:56:16 | 13.787300 | 1959-07-28 06:34:48 | 6.893650 | 1959-07-28 06:34:48 |
10 rows × 1562 columns
The available quantities in LTS event statistics result file are
res1d_events.quantities
['WaterLevelMaximum', 'WaterLevelMaximumTime', 'DischargeIntegrated', 'DischargeIntegratedTime', 'DischargeMaximum', 'DischargeMaximumTime', 'DischargeDuration', 'DischargeDurationTime', 'Component_1Maximum', 'Component_1MaximumTime', 'Component_2Maximum', 'Component_2MaximumTime', 'Component_1TransportIntegrated', 'Component_1TransportIntegratedTime', 'Component_2TransportIntegrated', 'Component_2TransportIntegratedTime', 'SurchargeMaximum', 'SurchargeMaximumTime', 'SurchargeIntegrated', 'SurchargeIntegratedTime', 'SurchargeDuration', 'SurchargeDurationTime', 'FlowVelocityMaximum', 'FlowVelocityMaximumTime']
The quantities ending with label '...Time' give the time of the correspoding quantity '...'. For example, quantity 'WaterLevelMaximum' has the event time quantity 'WaterLevelMaximumTime'. For example, water level maximum event statistics for node 'B4.1200' can be retrieved as:
df_events[["WaterLevelMaximum:B4.1200", "WaterLevelMaximumTime:B4.1200"]]
WaterLevelMaximum:B4.1200 | WaterLevelMaximumTime:B4.1200 | |
---|---|---|
0 | 20.357243 | 1961-06-13 15:55:44 |
1 | 20.273409 | 1961-09-05 14:48:00 |
2 | 20.067089 | 1959-08-15 13:30:48 |
3 | 19.239136 | 1957-07-27 16:22:48 |
4 | 19.165405 | 1962-07-21 15:15:28 |
5 | 19.103199 | 1961-08-22 06:40:48 |
6 | 18.928940 | 1958-05-25 23:21:04 |
7 | 18.692797 | 1959-07-11 19:06:48 |
8 | 18.399147 | 1961-04-06 20:36:16 |
9 | 18.359352 | 1959-08-15 09:56:00 |
Additionally, for flow type quantities like Discharge there are these LTS event quantities:
Let's see the discharge statistics at the start of the pipe (reach) B4.1200l1:0
quantities = [c for c in df_events.columns if "Discharge" in c and "B4.1200l1:26.666" in c]
df_events[quantities]
DischargeIntegrated:B4.1200l1:26.6666 | DischargeIntegratedTime:B4.1200l1:26.6666 | DischargeMaximum:B4.1200l1:26.6666 | DischargeMaximumTime:B4.1200l1:26.6666 | DischargeDuration:B4.1200l1:26.6666 | DischargeDurationTime:B4.1200l1:26.6666 | |
---|---|---|---|---|---|---|
0 | 1081.991333 | 1961-09-05 12:17:20 | 0.464411 | 1961-06-13 15:44:16 | 9.108004 | 1957-07-20 09:39:20 |
1 | 1048.237183 | 1959-08-15 09:36:24 | 0.436320 | 1959-08-15 13:27:52 | 6.788862 | 1957-06-11 04:12:20 |
2 | 908.647827 | 1961-06-13 15:38:24 | 0.377782 | 1961-09-05 14:41:20 | 5.560763 | 1959-08-15 09:36:24 |
3 | 815.226196 | 1958-05-25 21:11:20 | 0.352194 | 1961-08-22 06:39:12 | 4.831801 | 1961-09-05 12:17:20 |
4 | 664.019165 | 1957-07-20 09:39:20 | 0.328294 | 1959-07-11 19:05:04 | 4.549961 | 1958-05-25 21:11:20 |
5 | 508.447784 | 1957-06-04 14:28:20 | 0.325543 | 1957-07-27 16:21:48 | 4.169593 | 1958-05-24 19:07:20 |
6 | 501.339294 | 1957-06-11 04:12:20 | 0.314239 | 1958-05-25 23:18:24 | 4.119199 | 1958-11-10 13:35:20 |
7 | 490.517639 | 1962-07-21 13:50:24 | 0.312885 | 1962-07-21 15:14:56 | 3.769463 | 1957-09-07 22:18:20 |
8 | 418.507965 | 1962-06-19 12:18:24 | 0.298825 | 1961-04-06 20:34:24 | 3.661735 | 1959-07-02 03:15:20 |
9 | 356.224335 | 1957-07-27 16:09:20 | 0.286779 | 1961-09-25 00:51:28 | 3.626211 | 1962-06-19 12:18:24 |
Note that entries with the same integer label for DischargeIntegrated, DischargeMaximum, DischargeDuration does not represent the same event.
Let's plot the water level maximum for pipe (reach) B4.1200l1 having chainages (0, 479.999) and connecting nodes start/end nodes B4.1200/B4.1485
df_events[
[
"WaterLevelMaximum:B4.1200",
"WaterLevelMaximum:B4.1200l1:0",
"WaterLevelMaximum:B4.1200l1:479.999",
"WaterLevelMaximum:B4.1485",
]
].plot();
Read entire LTS monthly statistics file into a data frame.
res1d_monthly = mikeio1d.open("../tests/testdata/lts_monthly_statistics.res1d")
df_monthly = res1d_monthly.read()
For monthly/yearly statistics the time index has value for every month/year.
df_monthly.head(10)
DischargeIntegratedMonthly:A0.0327 | DischargeIntegratedMonthlyCount:A0.0327 | DischargeIntegratedMonthlyDuration:A0.0327 | Component_1TransportIntegratedMonthly:A0.0327 | Component_1TransportIntegratedMonthlyCount:A0.0327 | Component_1TransportIntegratedMonthlyDuration:A0.0327 | Component_2TransportIntegratedMonthly:A0.0327 | Component_2TransportIntegratedMonthlyCount:A0.0327 | Component_2TransportIntegratedMonthlyDuration:A0.0327 | DischargeIntegratedMonthly:B4.1200 | ... | Component_2TransportIntegratedMonthlyDuration:Pump:B4.1510p2:40.0003 | DischargeIntegratedMonthlyOutlets | DischargeIntegratedMonthlyWeirs | DischargeIntegratedMonthlyTotalOutflow | Component_1TransportIntegratedMonthlyTotalEmission | Component_2TransportIntegratedMonthlyTotalEmission | Component_1TransportIntegratedMonthlyOutlets | Component_2TransportIntegratedMonthlyOutlets | Component_1TransportIntegratedMonthlyWeirs | Component_2TransportIntegratedMonthlyWeirs | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1957-01-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
1957-02-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
1957-03-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
1957-04-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
1957-05-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
1957-06-01 | 4657.166504 | 2.0 | 9.395469 | 454.666199 | 2.0 | 9.395469 | 227.333099 | 2.0 | 9.395469 | 0.0 | ... | 1.265970 | 4657.166504 | 31.408979 | 4688.575684 | 458.651001 | 229.325500 | 455.510712 | 227.755356 | 3.140271 | 1.570136 |
1957-07-01 | 4643.333496 | 2.0 | 10.702984 | 453.083099 | 2.0 | 10.702984 | 226.541550 | 2.0 | 10.702984 | 0.0 | ... | 1.124598 | 4643.335449 | 64.702248 | 4708.037598 | 460.440796 | 230.220398 | 454.080963 | 227.040482 | 6.359827 | 3.179913 |
1957-08-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
1957-09-01 | 1432.653320 | 1.0 | 3.769463 | 137.650818 | 1.0 | 3.769463 | 68.825409 | 1.0 | 3.769463 | 0.0 | ... | 0.261507 | 1432.653320 | 0.000000 | 1432.653320 | 138.132156 | 69.066078 | 138.132156 | 69.066078 | 0.000000 | 0.000000 |
1957-10-01 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.000000 | 0.0 | 0.000000 | 0.0 | ... | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
10 rows × 759 columns
For flow type quantities like Discharge there are these LTS monthly (similary to yearly statistics) event quantities:
Let's see the discharge chronological statistics at the start of the pipe (reach) B4.1200l1:0
quantities = [c for c in df_monthly.columns if "Discharge" in c and "B4.1200l1:26.666" in c]
df_monthly[quantities].head(10)
DischargeIntegratedMonthly:B4.1200l1:26.6666 | DischargeIntegratedMonthlyCount:B4.1200l1:26.6666 | DischargeIntegratedMonthlyDuration:B4.1200l1:26.6666 | |
---|---|---|---|
1957-01-01 | 0.000000 | 0.0 | 0.000000 |
1957-02-01 | 0.000000 | 0.0 | 0.000000 |
1957-03-01 | 0.000000 | 0.0 | 0.000000 |
1957-04-01 | 0.000000 | 0.0 | 0.000000 |
1957-05-01 | 0.000000 | 0.0 | 0.000000 |
1957-06-01 | 1009.787048 | 2.0 | 9.395469 |
1957-07-01 | 1020.243530 | 2.0 | 10.702984 |
1957-08-01 | 0.000000 | 0.0 | 0.000000 |
1957-09-01 | 315.122833 | 1.0 | 3.769463 |
1957-10-01 | 0.000000 | 0.0 | 0.000000 |
Some plots of LTS dsicharge monthly statistics
print(quantities[0])
df_monthly[quantities[0]].plot();
DischargeIntegratedMonthly:B4.1200l1:26.6666
print(quantities[1])
df_monthly[quantities[1]].plot();
DischargeIntegratedMonthlyCount:B4.1200l1:26.6666
print(quantities[2])
df_monthly[quantities[2]].plot();
DischargeIntegratedMonthlyDuration:B4.1200l1:26.6666