Find the locations, magnitude, and duration of drawdown events in a time series of Plant Available Water Storage.
from Drawdown import Drawdown, cum_dist
file = 'BoulderS.csv'
drawdown = Drawdown(filename=file, find_drawdowns=True, debug=False)
[2023-01-24 14:09:26,071 Drawdown.py->__init__():65]INFO: There are 5902 total downvals
[2023-01-24 14:09:26,071 Drawdown.py->__init__():66]INFO: There are 5901 total upvals
[2023-01-24 14:09:26,072 Drawdown.py->__init__():68]INFO: Cacluating drawdowns...
0%| | 0/5900 [00:00<?, ?it/s]
drawdown.plot(
threshold=100,
show_up_locs=False,show_down_locs=False,
offset=20)
from matplotlib import pyplot as plot
x, y = cum_dist(drawdown.df['magnitude'])
plot.plot(x,y)
plot.xlabel('Drawdown Size, d (cm)')
plot.ylabel('Cumulative Distribution, F(d)')
plot.title('CDF of Drawdown Sizes, F(d)')
Text(0.5, 1.0, 'CDF of Drawdown Sizes, F(d)')
drawdown.df[['magnitude','duration','filling','draining']].describe()
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
</style>
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
magnitude | duration | filling | draining | |
---|---|---|---|---|
count | 1775.000000 | 1775.000000 | 1.775000e+03 | 1775.000000 |
mean | 17.693007 | 26.097465 | 1.742178e+02 | 86.043756 |
std | 63.317201 | 297.067234 | 3.126146e+02 | 180.941009 |
min | 0.000000 | 2.000000 | 5.551115e-17 | 0.000000 |
25% | 1.636735 | 2.000000 | 5.544403e+00 | 2.797929 |
50% | 4.429416 | 4.000000 | 3.232907e+01 | 8.130028 |
75% | 11.120472 | 8.000000 | 2.255705e+02 | 64.936869 |
max | 1027.690402 | 8813.000000 | 1.999801e+03 | 1235.979007 |