ArtesiaWater / hydropandas

Module for loading observation data into custom DataFrames
https://hydropandas.readthedocs.io
MIT License
51 stars 10 forks source link

Feature request: import hourly pressure data from KNMI #87

Closed HMEUW closed 1 year ago

HMEUW commented 1 year ago

KNMI meteostations have a daily and hourly export format.

E.g. on daily, basis pressure is available as: PG = Daily mean sea level pressure (in 0.1 hPa) calculated from 24 hourly values PX = Maximum hourly sea level pressure (in 0.1 hPa) PXH = Hourly division in which PX was measured

E.g. on hourly basis, pressure is available as: P = Air pressure (in 0.1 hPa) reduced to mean sea level, at the time of observation

The documentation of MeteoObs.from_knmi shows only the parameters that are in the 'daily format'.

I tried to import hourly pressure data, but the column has no data:

o = hpd.MeteoObs.from_knmi(310, meteo_var='P', interval='hourly',fill_missing_obs=False)

OnnoEbbens commented 1 year ago

Hi Hendrik, thanks for pointing this out.

I was a bit suprised as I have never tested the hourly pressure data but I do get hourly pressure data when I use your code:

o = hpd.MeteoObs.from_knmi(310, meteo_var='P', interval='hourly',fill_missing_obs=False)

o
Out[10]: 
-----metadata------
name : P_VLISSINGEN 
x : 30760.151750692 
y : 385968.5963456279 
meta : {'P': 'Luchtdruk (in hPa) herleid naar zeeniveau; tijdens de waarneming / Air pressure (in hPa) reduced to mean sea level; at the time of observation', 'x': 30760.151750692, 'y': 385968.5963456279, 'station': 310, 'name': 'P_VLISSINGEN'} 
filename :  
station : 310 
meteo_var : P 

                          P
2022-01-01 01:00:00  1023.1
2022-01-01 02:00:00  1022.7
2022-01-01 03:00:00  1022.7
2022-01-01 04:00:00  1022.9
2022-01-01 05:00:00  1022.9
                    ...
2023-01-30 20:00:00  1026.7
2023-01-30 21:00:00  1026.5
2023-01-30 22:00:00  1026.7
2023-01-30 23:00:00  1026.3
2023-01-31 00:00:00  1025.8

It worked both for the latest version of hydropandas 0.6.0 and the beta version in the 'dev' branch. Which version of hydropandas are you using?

HMEUW commented 1 year ago

Thanks for your swift response. Please close the issue. Today the code is working at my laptop as well. I am running version 0.6.1.