File size: 4,179 Bytes
7e9222f
16680d4
 
 
 
7e9222f
16680d4
7e9222f
 
16680d4
7e9222f
 
16680d4
33a3d42
16680d4
33a3d42
16680d4
33a3d42
16680d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33a3d42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
title: Global Wind Map
emoji: 🌍
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.19.2
app_file: app.py
pinned: false
license: mit
---

# 🌍 Global Wind Map

A real-time interactive wind map showing global wind patterns using live data from the OpenMeteo API.

## 🌟 Features

- **🌬️ Real-Time Wind Data**: Live wind speed and direction from OpenMeteo API
- **πŸ—ΊοΈ Interactive Map**: Pan, zoom, and explore wind patterns worldwide
- **πŸ“Š Multiple Visualizations**:
  - Animated wind particles
  - Color-coded wind vectors
  - Wind speed heatmap
- **πŸŽ›οΈ Customizable Display**:
  - Adjustable data resolution
  - Toggle different visualization layers
  - Detailed wind information on hover

## πŸš€ Usage

1. Adjust the resolution slider to control data density
2. Toggle visualization layers:
   - Wind Vectors: Arrows showing wind direction and speed
   - Wind Speed Heatmap: Color-coded wind intensity
   - Animated Particles: Dynamic wind flow visualization
3. Click on wind vectors for detailed information
4. Pan and zoom to explore different regions

## πŸ› οΈ Technical Details

- Built with Gradio and Folium
- Real-time data from OpenMeteo API
- Parallel data fetching for improved performance
- Adaptive resolution based on latitude
- Enhanced visualization with dynamic scaling

## πŸ“ Data Sources

Wind data is provided by the [OpenMeteo API](https://open-meteo.com/), offering:
- Current wind conditions
- Global coverage
- Regular updates
- Wind speed and direction at 10m height

## 🀝 Contributing

Feel free to open issues or submit pull requests to improve the visualization!

## Wind Pattern Simulation

The application currently displays simulated wind data with realistic patterns:

- **Trade Winds**: Easterly winds near the equator (-30Β° to 30Β° latitude)
- **Westerlies**: Westerly winds in mid-latitudes (30Β° to 60Β° and -60Β° to -30Β°)
- **Polar Winds**: Variable winds in polar regions

## Quick Start

### Option 1: Using the run script
```bash
chmod +x run.sh
./run.sh
```

### Option 2: Manual setup
```bash
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the application
python app.py
```

## Usage

1. **Start the application** using one of the methods above
2. **Open your browser** to the provided URL (typically `http://localhost:7860`)
3. **Adjust controls** in the left panel:
   - **Data Resolution**: Lower values = more detail (but slower rendering)
   - **Show Wind Vectors**: Toggle wind direction arrows
   - **Show Wind Speed Heatmap**: Toggle colored wind speed overlay
4. **Explore the map** by zooming and panning
5. **Click on wind arrows** to see detailed wind information

## Wind Speed Legend

- πŸ”΅ **Blue (0-3 m/s)**: Light winds
- 🟒 **Green (3-7 m/s)**: Moderate winds  
- 🟠 **Orange (7-12 m/s)**: Strong winds
- πŸ”΄ **Red (12+ m/s)**: Very strong winds

## Dependencies

- **gradio**: Web interface framework
- **folium**: Interactive mapping library
- **numpy**: Numerical computations
- **pandas**: Data manipulation
- **requests**: HTTP requests (for future API integration)

## Future Enhancements

The current version uses simulated data for demonstration. Planned improvements include:

- **Real Weather Data**: Integration with APIs like:
  - OpenWeather API
  - NOAA Global Forecast System
  - European Centre for Medium-Range Weather Forecasts
- **Historical Data**: View wind patterns from past dates
- **Weather Forecast**: Show predicted wind patterns
- **Additional Layers**: Temperature, pressure, precipitation
- **Export Features**: Save maps as images or data

## Configuration

For production deployment on Hugging Face Spaces, the application will automatically start when the Space is loaded.

## Development

To extend the application:

1. **Add real data sources** in the `get_wind_data()` function
2. **Customize map styling** in the `create_wind_map()` function  
3. **Add new controls** in the Gradio interface section
4. **Implement additional weather layers** using Folium plugins

## License

GPL-3.0 License - see the LICENSE file for details.