take min/max from prediction based on 4-year-vectoravg component set. This is implemented in kw.calc_hat_lat_fromcomponents(). Component files are not used in the rest of the kenmerkendewaarden process
take 19 years of measurements, do analysis_peryear and prediction_peryear, take min/max from resulting prediction. This is implemented in kw.calc_hat_lat_frommeasurements(). Also used to KWK_process.py since it uses data in the kenmerkendewaarden scope. SA/SM should maybe be from 19 years at once. Vertref better from end of period.
retrieve 19 years of astro prediction timeseries/extremes from ddl and get min/max from these timeseries. astro data is not used in the rest of the kenmerkendewaarden process
what is currently used? e.g in P:/archivedprojects/11205258-005-kpp2020_rmm-g5/C_Work/00_KenmerkendeWaarden/02_Literature/RDNAPTRANS2018_NLLAT2018.pdf
Also the settings can be varied:
the main importance is to use the same settings for the prediction as were used for the analysis
frequency 1min vs 10min has limited impact on hat/lat values (2mm for HOEKVHLD)
xfac has very limited impact on hat/lat values (<1mm for HOEKVHLD)
fu_alltimes=False makes the process significantly faster
A0 (or slotgemiddelde) might also influence the results
The two implemented methods can be compared with this code:
import os
import pandas as pd
import hatyan
import kenmerkendewaarden as kw
dir_hatyan_data = r'c:\DATA\hatyan\tests\data_unitsystemtests'
# or online at https://github.com/Deltares/hatyan/blob/main/tests/data_unitsystemtests/HOEKVHLD_ana.txt
dir_kw_data = r'c:\DATA\kenmerkendewaarden\tests\testdata'
# or online at https://github.com/Deltares-research/kenmerkendewaarden/blob/main/tests/testdata/HOEK_KW.dia
current_station = 'HOEKVHLD'
methods = ["components", "measurements"]
hatlat = ["HAT","LAT"]
hat_lat_allstats = pd.DataFrame(index=methods, columns=hatlat)
# based on components
print(f'computing hat/lat from components for {current_station}')
file_comp = os.path.join(dir_hatyan_data, f'{current_station}_ana.txt')
comp = hatyan.read_components(filename=file_comp)
print(f'>> components for period {comp.attrs["tstart"]} to {comp.attrs["tstop"]}, SA/SM from 19y')
hat, lat = kw.calc_hat_lat_fromcomponents(comp=comp)
hat_lat_allstats.loc["components","HAT"] = hat
hat_lat_allstats.loc["components","LAT"] = lat
# based on measurements
print(f'computing hat/lat from measurements for {current_station}')
file_meas = os.path.join(dir_kw_data, 'HOEK_KW.dia')
df_meas = hatyan.read_dia(filename=file_meas)
df_meas_19y = df_meas.loc["2001":"2019"]
print(f">> measurements for period {df_meas_19y.index.min()} to {df_meas_19y.index.max()}")
hat, lat = kw.calc_hat_lat_frommeasurements(df_meas_19y)
hat_lat_allstats.loc["measurements","HAT"] = hat
hat_lat_allstats.loc["measurements","LAT"] = lat
# compute range and print
hat_lat_allstats["range"] = hat_lat_allstats["HAT"] - hat_lat_allstats["LAT"]
print(hat_lat_allstats)
Prints:
computing hat/lat from components for HOEKVHLD
>> period 2009-01-01 00:00:00 to 2012-12-31 23:00:00
computing hat/lat from measurements for HOEKVHLD
>> period 2001-01-01 00:00:00+01:00 to 2019-12-31 23:50:00+01:00
HAT LAT range
components 1.604644 -0.914127 2.518772
measurements 1.685611 -1.039573 2.725184
Several methods possible:
kw.calc_hat_lat_fromcomponents()
. Component files are not used in the rest of the kenmerkendewaarden processkw.calc_hat_lat_frommeasurements()
. Also used toKWK_process.py
since it uses data in the kenmerkendewaarden scope. SA/SM should maybe be from 19 years at once. Vertref better from end of period.Also the settings can be varied:
Consider the method and settings before deciding on a method, a 2021 memo shows the impact of different choices: 11204107-003-ZKS-0003_v0.5-Comparison of several LAT calculation methods.docx
The two implemented methods can be compared with this code:
Prints: