Deltares-research / kenmerkendewaarden

Derive indicators from waterlevel measurements
https://deltares-research.github.io/kenmerkendewaarden/
GNU General Public License v3.0
1 stars 0 forks source link

Improve gemiddeldgetij #86

Open veenstrajelmer opened 1 month ago

veenstrajelmer commented 1 month ago

Todo:

import hatyan
import numpy as np
import pandas as pd

const_list_year = hatyan.get_const_list_hatyan("year")
dummy,shallowrel,dummy = hatyan.foreman.get_foreman_shallowrelations()
bool_M2S2only = shallowrel[1].isin([1,2]) & shallowrel[3].isin(['M2','S2']) & shallowrel[5].isin(['M2','S2',np.nan]) & shallowrel.index.isin(const_list_year)
shallowdeps_M2S2 = shallowrel.loc[bool_M2S2only,:5]
list_harmonischen_M2S2_code = shallowdeps_M2S2.index.append(pd.Index(["M2","S2","MU2"]))
# print(list_harmonischen_M2S2_code)
#['2SM2', '3MS4', 'M4', 'MS4', 'S4', 'M6', '2MS6', '2SM6', 'M7', 'M8', '3MS8', 'M10', 'M12', 'SM', '3MS2', '4MS4', '4MS6', '2(MS)8', '4MS10', '3M2S10', '5MS12', '4M2S12']

list_harmonischen_M2S2_1991 = pd.Index(['SM','3MS2','MU2','M2','S2','2SM2','3MS4','M4','MS4','4MS6','M6','2MS6','M8','3MS8','M10','4MS10','M12','5MS12'])
# print(list_harmonischen_M2S2_1991)

# list_harmonischen_M2S2_1991[~pd.Series(list_harmonischen_M2S2_1991).isin(list_harmonischen_M2S2_code)]
print(list_harmonischen_M2S2_code[~pd.Series(list_harmonischen_M2S2_code).isin(list_harmonischen_M2S2_1991)])
# ['S4', '2SM6', 'M7', '4MS4', '2(MS)8', '3M2S10', '4M2S12']

So this would result in 7 different components. If we use all schureman components instead of the year-list, "S6" is also included. "M7" is not even, so should not be included.