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

Add support for the raster data products using the KiWIS grid api to pywaterinfo #66

Open
MaritH9 opened this issue Dec 5, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@MaritH9
Copy link

MaritH9 commented Dec 5, 2023

  • pywaterinfo version: 0.7.0.post1.dev3+gaff3739
  • Python version: 3.9
  • Operating System: Windows 10

Description

I was already using Waterinfo("vmm") to gather precipitation data (accum. 24h) (ts_id = '6604010') from the raster data with request=getRasterToPointValues, which works fine. Now, I also wanted to get data on the confidence/uncertainty of this raster data, i.e. RMSE and NSE, as described in the manual with request = getTimeseriesValues. The problem is that I get an empty dataset or an error, depending on the request method.

So my question is, is this data no longer provided, or is there a problem with the accessibility via the API?
Or should I use another request method or ts_id?

What I Did

The example that is given in the manual does not contain any data: https://hydro.vmm.be/grid/kiwis/KiWIS?datasource=10&service=kisters&type=queryServices&request=gettimeseriesvalues&ts_id=6793010&period=P1D&metadata=true .

If I try any other method using the API, I also end up with empty datasets:

ts_id = '6793010' # 6792010 = NSE & 6793010 = RMSE
start_date = date(2023, 8, 1)
end_date = date(2023, 9, 21)
for dag in daterange(start_date, end_date):
    dag = dag.strftime("%Y-%m-%d")
    data =  pd.read_csv('https://hydro.vmm.be/grid/kiwis/KiWIS?datasource=10&service=kisters&type=queryServices'+
        '&request=GetTimeseriesValues&format=csv&ts_id='+ts_id+'&from='+dag+'T00:00:00.000+01:00&'+
        '&period=P1D&metadata=True&format=csv', sep=';',header=11)
    print(data)

Or when trying vmm.get_timeseries_values("6793010", start="2023-04-01", end="2023-08-01"), I get an error:
KiwisException: Waterinfo call returned 500 error with the message b'{"type": "error", "code": "InvalidParameterValue", "message": "One or more of the entered timseries ids could not be found."}'

Thanks!

@binomaiheu
Copy link
Collaborator

I don't think pywaterinfo currently supports the KiWIS grid api, which is at a different base url (https://hydro.vmm.be/grid/kiwis/KiWIS) then the timeseries url (https://download.waterinfo.be/tsmdownload/KiWIS/KiWIS).

The ts_id's don't exist in the timeseries database, but in the grid system, which is why pywaterinfo is not able to find them. I checked the queries for NSE and RMSE from the waterinfo open data document and they do seem to work, but indeed returning emtpy datasets.

I will have a closer look tomorrow in the grid system to see whether they are still calculated, but best forward the question to hydrometrie@waterinfo.be as well as indicated in the document so it's formally logged...

@binomaiheu
Copy link
Collaborator

The NSE and RMSE on the raster data are indeed not calculated anymore in the grid system (since 2019 even), so best consider these series as obsolete. Will have them removed from the open data document.

@stijnvanhoey
Copy link
Contributor

I'll rename this issue to mark the task to be done is to add support for the KiWIS grid api.

@stijnvanhoey stijnvanhoey changed the title Waterinfo("vmm"): The request “GetTimeseriesValues” for time series of RMSE & NSE associated with the raster data products are not accessible/available Add support for the raster data products using the KiWIS grid api to pywaterinfo Aug 23, 2024
@stijnvanhoey stijnvanhoey added the help wanted Extra attention is needed label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants