earthobservations / wetterdienst

Open weather data for humans.
https://wetterdienst.readthedocs.io/
MIT License
360 stars 55 forks source link

Variables not found #555

Closed prayer007 closed 2 years ago

prayer007 commented 2 years ago

Hello,

First I will thank you for that great package!

If I want to download mosmix forecast data for a station, it seems that there is no data for variables "radiation_sky_short_wave_diffuse" and "radiation_sky_short_wave_direct". It seems that they are missing in the metadata parameters file -> https://github.com/earthobservations/wetterdienst/blob/main/wetterdienst/provider/dwd/forecast/metadata/parameter.py.

Or is there something wrong with the code or are these variables not available?

from wetterdienst import Wetterdienst
from wetterdienst.provider.dwd.forecast import DwdMosmixType

station_id = 11290 
variables = ["TEMPERATURE_AIR_MEAN_200", 
             "WIND_SPEED", 
             "WIND_DIRECTION",
             "WATER_EQUIVALENT_SNOW_DEPTH_NEW_LAST_1H",
             "CLOUD_COVER_TOTAL",
             "PRESSURE_AIR_SITE_REDUCED",
             "RADIATION_GLOBAL",
             "RADIATION_SKY_SHORT_WAVE_DIFFUSE", # SEEMS TO NOT EXIST
             "RADIATION_SKY_SHORT_WAVE_DIRECT"] # SEEMS TO NOT EXIST

variables = [v.lower() for v in variables]

API = Wetterdienst(provider="dwd", kind="forecast")
stations = API(parameter="large", mosmix_type=DwdMosmixType.SMALL)
station = stations.filter_by_station_id(station_id) 

values_all = station.values.all().df

values = values_all[values_all["parameter"].isin(variables)]
not_existing_vars = [var for var in variables if var not in values_all["parameter"].unique()]

if not_existing_vars:
    raise ValueError("Variables: {} does not exist.".format(not_existing_vars))

Best regards, und Grüße aus Österreich :-) Manuel Strohmaier

gutzbenj commented 2 years ago

Dear @prayer007 ,

I checked it once again and the listing of all mosmix elements at [1] does not contain both the elements you are requesting.

Furthermore I have to say that the parameters found at [2] are a summmary of ALL data found at any of the providers we are covering. I created this so that we have a consistent naming over all providers but obviously not all parameters are found at all providers. However I think you may use data from sunshine duration and cloud cover to calculate/estimate those parameters.

Do you have any further opinions on that?

Cheers so far Benjamin

[1] https://opendata.dwd.de/weather/lib/MetElementDefinition.xml [2] https://github.com/earthobservations/wetterdienst/blob/main/wetterdienst/metadata/parameter.py

prayer007 commented 2 years ago

Thank you for the fast response, now that's clear for me. I see Global radiation is available (Rad1h ), I think that's enough for my purpose.

Best regards Manuel

gutzbenj commented 2 years ago

I see Global radiation is available (Rad1h ), I think that's enough for my purpose.

I'd also guess that those radiation related parameters are probably the ones that could be estimated best by approximations.

Further good luck with your calculations!

Cheers Benjamin