Weather info with Meteostat Python Library

234 views
Skip to first unread message

mondoshiwan

unread,
Jan 18, 2023, 9:07:00 AM1/18/23
to golden-cheetah-users
Meteostat now provides a python library with no need for an API key as documented here.

Since the old example in the Wiki (Python Data Proccessor) is outdated i invested some time to get it back to life. The only downside: your own python installation is mandatory since the meteostat library is neccessary to run the new code.

Additionally you will need the ca-certificates. If they are not installed yet, you have to run the "Install Certificates.command" script(Throw it in a terminal window) which comes with the python installation. Otherwise they are not linked correctly and you get SSL errors while establishing the connection with meteostat.

The old code picked up the weather information once from a position in the middle of the ride/move which wasn't ideal for e.g. bikepacking / rides from place to place.
Now it will retrieve the data for every full hour from the nearest weather station to that current position.

If no full hour is found - in case of a short run/move/ride - it will pull the weather data from the hour prior start.
NaN values in the dataframe record will be filled with -100, this could be changed - in my tests i had only a few in 'Windgust' from smaller weather stations.
Information about the Weather Stations are printed to the Python Konsole.
The documentation of the weather condition codes can be found here.

I'm not that coding… & python genius and i read a lot of panda, python & GC docs ( puhh…:-) ) to understand the old code and rewrite it. I had no idea how to do this as i started, but what i like: you are learning and raising your skills by doing this. So it may not be perfect. Tweaks, improvements and suggestions are welcome.

Regards
Carsten
Weather Data_V2.py

pepe

unread,
Jan 24, 2023, 8:22:40 AM1/24/23
to golden-cheetah-users
Thank you.
Message has been deleted

mondoshiwan

unread,
May 23, 2023, 2:43:25 PM5/23/23
to golden-cheetah-users
At the charts library i found a python Winddirection chart that prints the Weather X_Data.
I extended this with the translated condition weather codes, temperature and windgusts.

Maybe someone find this useful… at least one ;-)

The chart will look like this:Wind Direction.png

i deleted the previous post, cause the code had an error

Carsten
Wind Direction.gchart
Reply all
Reply to author
Forward
0 new messages