Closed veenstrajelmer closed 3 months ago
After merging https://github.com/Deltares-research/kenmerkendewaarden/tree/31-add-indicators-for-monthyear-meanminmax-of-wlhwlw, the yearly means of extremes during spring and neaptide are now all computed in kw.calc_HWLWtidalindicators()
. This is an example code for the computation and plot:
import kenmerkendewaarden as kw # pip install git+https://github.com/Deltares-research/kenmerkendewaarden
import hatyan
import matplotlib.pyplot as plt
plt.close("all")
file_dia = r"c:\DATA\hatyan\tests\data_unitsystemtests\HOEKVHLD_obs19.txt"
ts = hatyan.read_dia(file_dia)
ts_ext = hatyan.calc_HWLW(ts)
indicators_wl = kw.calc_wltidalindicators(ts, min_count=0)
indicators_ext = kw.calc_HWLWtidalindicators(ts_ext, min_count=0)
print("available indicators wl: ", indicators_wl.keys())
print("available indicators ext: ", indicators_ext.keys())
yearly_mean = indicators_wl["wl_mean_peryear"]
monthly_mean = indicators_wl["wl_mean_permonth"]
ghws = indicators_ext["HW_monthmax_mean_peryear"]
ghwn = indicators_ext["HW_monthmin_mean_peryear"]
glwn = indicators_ext["LW_monthmax_mean_peryear"]
glws = indicators_ext["LW_monthmin_mean_peryear"]
fig, ax = plt.subplots(figsize=(10,6))
ax.plot(ghws, label="ghws", color='r')
ax.plot(ghwn, label="ghwn", color='orange')
ax.plot(yearly_mean, label="yearly_mean", color='c')
ax.plot(monthly_mean, label="monthly_mean", color='m')
ax.plot(glwn, label="glwn", color='lime')
ax.plot(glws, label="glws", color='g')
ax.legend(loc=1)
ax.grid()
fig.tight_layout()
Which gives:
currently, there is
kw.tidalindicators.calc_HWLWtidalindicators()
with which we can compute several of these indicators but not all:This gives:
['HW_mean', 'LW_mean', 'HW_mean_peryear', 'LW_mean_peryear', 'HW_monthmax_permonth', 'LW_monthmin_permonth', 'HW_monthmax_mean_peryear', 'LW_monthmin_mean_peryear']
Todo: