Skip to content

Latest commit

 

History

History
158 lines (116 loc) · 2.8 KB

Readme.md

File metadata and controls

158 lines (116 loc) · 2.8 KB

Drawdown

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

drawdown.plot(
    threshold=100,
    show_up_locs=False,show_down_locs=False,
    offset=20)

png

Drawdown Distribution

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)')

png

Drawdown Stats

drawdown.df[['magnitude','duration','filling','draining']].describe()
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
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