EVA - Extrem Values Analysis¶
Annual maxima¶
from warsa.discharge import eva
The function get_annual_maxima
has as a series (not a data frame) input parameter with datetime as index and discharges as values.
sr_annual_maxima = eva.get_annual_maxima(sr)
The output is a pandas series with year as index and the maxima as value:
1979 4.078448
1980 10.036425
1981 15.106880
...
2012 7.410849
2013 22.590010
2014 10.074438
Simple plot:
sr_annual_maxima.plot(kind='bar', color='b', title='Maximal annual discharge starting on 1st Nov.')
plt.show()

If not otherwise stated, the year starts on 1st January at 00:00:00. Hydrological years normally start in another month and at another time, e.g., on 1st November at 07:30am in Germany. In order to get maxima from 1st November 07:30 to 31th October before 07:30 of the next year:
sr_annual_maxima = eva.get_annual_maxima(sr, datetime.datetime(2000, 11, 1, 7, 30))
In the example above, the year is only a place holder. The function will split all years from YYYY-11-01 07:30:00 to (YYYY+1)-10-31 07:29:59.99999
The output is a pandas series with year as index and the maxima as value:
1980 6.514527
1981 15.106880
1982 11.751186
...
2012 5.625469
2013 22.590010
2014 10.074438
2015 5.337633
Note the difference between both outputs.
Plot:
ax = sr_annual_maxima.plot(kind='bar', color='b', title='Maximal annual discharge starting on 1st Nov.')
ax.set_xlabel("Year")
ax.set_ylabel("Qmax (m³/s)")
plt.tight_layout()
plt.show()
