wetterdienst icon indicating copy to clipboard operation
wetterdienst copied to clipboard

Description of parameters, metrics and scales e.g. for temperature_air_mean_200

Open padmalcom opened this issue 2 years ago • 1 comments

Hi, I wrote a very simple demo to get the temperature for a specific station (see below). I get my data, which is nice. But I'm struggling with interpreting my results regarding the parameters. Parameters I get are:

  • wind_gust_max
  • wind_speed
  • precipitation_height
  • precipitation_form
  • sunshine_duration
  • snow_depth
  • cloud_cover_total
  • pressure_vapor
  • pressure_air_site
  • temperature_air_mean_200
  • humidity
  • temperature_air_max_200
  • temperature_air_min_200
  • temperature_air_min_005

I can interprete some but not all of them. What confuses me is e.g. the name temperature_air_mean_200 which has an average value of arount 270 which neither makes neither sense in celsius nor in kelvin. When I google the name, I find that there might be any kind of conversion (I read about 'origin' and 'si' somewhere in the examples). But all in all, it would be nice, to have a description for each parameter, its metric and scale.

Not to forget: Thank you for this awesome library!

import logging
from datetime import datetime
from wetterdienst import Settings
import pandas as pd
import matplotlib.pyplot as plt

from wetterdienst.provider.dwd.observation import DwdObservationRequest, DwdObservationPeriod, DwdObservationResolution, DwdObservationParameter, DwdObservationDataset

log = logging.getLogger()

Settings.humanize = True

def get_station():
	stations = DwdObservationRequest(
		parameter=DwdObservationDataset.CLIMATE_SUMMARY,
		resolution=DwdObservationResolution.DAILY,
		period=DwdObservationPeriod.RECENT,
	).filter_by_rank(49.19780976647141, 8.135207205143768, 20).df
	
	print(stations)

	if (len(stations)) > 0:
		return stations.iloc[0]
	return None

def get_data(station):
	request = DwdObservationRequest(
		parameter=DwdObservationDataset.CLIMATE_SUMMARY,
		resolution=DwdObservationResolution.DAILY,
		start_date="2005-01-01",
		end_date="2022-01-01"
	)
	station_data = request.filter_by_station_id(station['station_id']).values.all().df
	
	station_data = station_data[station_data['parameter'] == 'temperature_air_mean_200']
	
	parameters =  pd.unique(station_data['parameter'])
	for p in parameters:
		print(p)
	
	return station_data

def main():
	logging.basicConfig(level=logging.INFO)
	station = get_station()
	data = get_data(station)
	print(data)
	#data.to_csv('weather_data.csv', index=False)
	data.plot(x='date', y='value')
	plt.show()

if __name__ == "__main__":
	main()

padmalcom avatar Mar 09 '22 14:03 padmalcom

Dear @padmalcom ,

thanks for writing about this problem. Actually having a full detailed list of parameters is probably the hardest part when implementing a weather serivce. However I will try to work on this but it will probably take some weeks to write down all those descriptions...

For the case of temperature_air_mean_200 this name composes of temperature_air (variable), mean (statistical function) and 200 (height of measurement). Temperature values are converted to Kelvin when using SI units. The average of 285 K / 12 °C which I got for your request is absolutely reasonable.

Cheers Benjamin

gutzbenj avatar Mar 19 '22 11:03 gutzbenj

@gutzbenj, thanks a lot for clearifying the data types and metrics for the parameters with this merge!

padmalcom avatar Dec 15 '22 12:12 padmalcom