Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

214 fix acceptance tests #222

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

# hatyan

A Python package for harmonic tidal analysis and prediction, based on the FORTRAN version and developed for Rijkswaterstaat. Hatyan contains the methods to derive water level extremes (high and low waters) and several other water level indicators (Kenmerkende Waarden). Furthermore, hatyan provides easier access to Rijkswaterstaat data via their data distribution layer (DataDistributieLaag, DDL).
A Python package for harmonic tidal analysis and prediction, based on the FORTRAN version and developed for Rijkswaterstaat. Hatyan also contains methods to derive water level extremes (high and low waters) and it is a dependency to derive the [Kenmerkende Waarden](https://github.com/Deltares-research/kenmerkendewaarden).

## Information

- install with ``pip install hatyan -U``
- [online documentation](https://deltares.github.io/hatyan) with contributing guide, tutorials/examples, API reference and a convenient search box.
- [online documentation](https://deltares.github.io/hatyan) with contributing guide, tutorials/examples and an API reference.
- [docs folder](https://github.com/Deltares/hatyan/tree/main/docs) with background information
- Bug or feature request? Create a [GitHub issue](https://github.com/Deltares/hatyan/issues)
4 changes: 2 additions & 2 deletions tests/examples/WMCN_tidescourse.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


# prediction M2 / S2, spring/neap cycle
if 0:
if 1:
dir_testdata = 'C:\\DATA\\hatyan_data_acceptancetests'

stat_list = ['HOEKVHLD']#,'DENHDR','IJMDBTHVN'] #'K13APFM'
Expand Down Expand Up @@ -313,7 +313,7 @@



if 1:
if 0:
import xarray as xr
data_nc_TS = xr.open_dataset(r'p:\1204257-dcsmzuno\1980-2017\DCSM-FM\A03_FES2014_GTSM_H1H2\DFM_OUTPUT_DCSM-FM_0_5nm\DCSM-FM_0_5nm_0000_his.nc')
data_nc_tide = xr.open_dataset(r'p:\1204257-dcsmzuno\1980-2017\DCSM-FM\A03_FES2014_GTSM_H1H2_astro\DFM_OUTPUT_DCSM-FM_0_5nm\DCSM-FM_0_5nm_0000_his.nc')
Expand Down
19 changes: 11 additions & 8 deletions tests/examples/astro2022_2cm_diff_rounding_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import pandas as pd
import datetime as dt
import ddlpy
import hatyan
hatyan.close('all')

Expand All @@ -16,7 +17,9 @@

dir_meas = r'p:\11208031-010-kenmerkende-waarden-k\work\measurements_wl_18700101_20220101_dataTKdia'

for pred_year in [2019, 2020, 2021, 2022, 2023]:
# year_list = [2019, 2020, 2021, 2022, 2023]
year_list = [2019, 2023]
for pred_year in year_list:

for current_station in ['HOEKVHLD']:#,'DORDT']:

Expand All @@ -32,15 +35,15 @@
file_astro = os.path.join(r'c:\Users\veenstra\Downloads',f'astro_{current_station}_{pred_year}.pkl')
if not os.path.exists(file_astro):
print('retrieving DDL catalog')
catalog_dict = hatyan.get_DDL_catalog(catalog_extrainfo=['WaardeBepalingsmethoden','MeetApparaten','Typeringen'])
print('...done')
locations = ddlpy.locations()
bool_station = locations.index.isin([current_station])
bool_grootheid = locations["Grootheid.Code"].isin(["WATHTBRKD"])
bool_groepering = locations["Groepering.Code"].isin(["NVT"])
selected = locations.loc[bool_station & bool_grootheid & bool_groepering]

cat_locatielijst = catalog_dict['LocatieLijst']
station_dict = cat_locatielijst[cat_locatielijst['Code']==current_station].iloc[0]
measurements = ddlpy.measurements(selected.iloc[0], start_date=tstart_pred, end_date=tstop_pred)

ts_astro, metadata, stationdata = hatyan.get_DDL_data(station_dict=station_dict,tstart_dt=tstart_pred,tstop_dt=tstop_pred,tzone='UTC+01:00',
meta_dict={'Grootheid.Code':'WATHTBRKD','Groepering.Code':'NVT'},allow_multipleresultsfor=['WaardeBepalingsmethode'])
ts_astro['values'] = ts_astro['values']/100 #convert from cm to m
ts_astro = hatyan.ddlpy_to_hatyan(measurements)
ts_astro.index = ts_astro.index.tz_localize(None)
ts_astro.to_pickle(file_astro)

Expand Down
Loading