lds133 / weather_landscape

Visualizing Weather Forecasts Through Landscape Imagery
MIT License
485 stars 14 forks source link
eink esp32 micropython openweathermap-api python3 weather-forecast

Weather as Landscape

Visualizing Weather Forecasts Through Landscape Imagery

house

Traditional weather stations often display sensor readings as raw numerical data. Navigating these dashboards can be overwhelming and stressful, as it requires significant effort to locate, interpret, and visualize specific parameters effectively.

Viewing a landscape image feels natural to the human eye. The calming effect of observing landscape elements reduces stress and requires minimal effort, allowing for a more relaxed visual experience.

The method below demonstrates how to encode weather information within a landscape image, with no or minimal reliance on numerical data.

Encoding principles

The landscape depicts a small house in the woods. The horizontal axis of the image represents a 24-hour timeline, starting from the current moment on the left, marked by the house, and extending to the conditions of the next day on the right. Various landscape elements distributed along the vertical axis symbolize weather events and conditions. The further an event is from the present, the farther it is positioned to the right in the image.

encode

The following information can be encoded within the landscape image:

Implementation

The image generation code is written in Python using the Pillow library and is based on data from OpenWeather. The image is designed specifically for use on a 296x128 E-Ink display. The code tested on Python 3.9.

Event image Description
example Sunrise
example Sunset
example Cloud cover
example Current time position
example Midnight
example Midday
example South wind
example East wind
example West wind
example North wind
example Rain

Examples

 Landscape image                                       Description
example It’s around noon, with clear skies and a few clouds expected. A moderate north wind will develop overnight. Temperatures are currently rising but will begin to fall after sunset, reaching their lowest point before sunrise. During this time, the wind is expected to shift to the northeast.
example The sun is rising and it will be a hot sunny day with a light southeast breeze. The temperature will remain high even after sunset, and the wind will shift to the east, becoming stronger throughout the evening.
example It will be cold and rainy throughout the day and night. The south wind will shift to the northeast overnight.

How the landscape changed during the day

Dynamic

Running the code

Preparing environment Linux

./makevenv.sh
source .venv/bin/activate

Preparing environment Windows

makevenv.bat
.venv/Scripts/Activate

Image creation test

Update OWM_KEY variable in the weather_landscape.py file with your OpenWeather API key.

python run_test.py

Run server

python run_server.py

Hardware

Setup

The hardware setup includes an ESP32 development board and 2.9inch E-Ink display module. Currently, the setup only displays an image sourced from the internet, updating every 15 minutes. It is uncertain whether the image generation code can be adapted for use with MicroPython on the ESP32 at this time.

More information