Integrate weather data with bird detection patterns to analyze correlations between weather conditions and bird activity.
- Use OpenWeatherMap API for weather data
- Current weather
- Historical weather
- Hourly forecasts
- Key weather metrics to track:
- Temperature
- Precipitation
- Wind speed/direction
- Cloud cover
- Humidity
- Pressure
- Visibility
CREATE TABLE weather_data (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp DATETIME NOT NULL,
temperature REAL,
feels_like REAL,
humidity INTEGER,
pressure INTEGER,
wind_speed REAL,
wind_direction INTEGER,
precipitation REAL,
cloud_cover INTEGER,
visibility INTEGER,
weather_condition TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_weather_timestamp ON weather_data(timestamp);
-- Join table for correlating weather with detections
CREATE TABLE detection_weather (
detection_id INTEGER,
weather_id INTEGER,
FOREIGN KEY (detection_id) REFERENCES detections(id),
FOREIGN KEY (weather_id) REFERENCES weather_data(id)
);
- Fetch and store weather data periodically
- Match weather conditions with detection times
- Calculate weather-based statistics
# Weather data endpoints
GET /api/weather/current
GET /api/weather/historical/<date>
GET /api/weather/forecast
# Correlation analysis endpoints
GET /api/analysis/weather-correlation
- Parameters:
- start_date
- end_date
- species (optional)
- weather_metric (temp/wind/etc)
GET /api/analysis/activity-patterns
- Parameters:
- weather_condition
- temperature_range
- time_of_day
- WeatherCorrelationChart.vue
// Display correlation between weather metrics and bird activity
// - Line chart showing weather vs activity
// - Support for different weather metrics
// - Time range selection
// - Species filtering
- WeatherPatternInsights.vue
// Display ML-derived insights about weather patterns
// - Most active weather conditions
// - Temperature preference ranges
// - Wind tolerance patterns
// - Precipitation impact
- WeatherActivityHeatmap.vue
// Enhanced heatmap showing:
// - Bird activity intensity
// - Weather condition overlay
// - Temperature gradient
- Identify optimal weather conditions for each species
- Detect weather-based behavior patterns
- Predict activity levels based on weather forecast
- Calculate correlation coefficients between:
- Temperature and activity levels
- Precipitation and activity
- Wind speed and activity
- Time of day and weather preferences
- Generate human-readable insights:
- "Cardinals are most active during light rain"
- "Blue Jays prefer temperatures between 60-70°F"
- "Activity drops significantly in winds over 15mph"
- ✅ Set up OpenWeatherMap API integration
- ✅ Created weather_data and detection_weather tables
- ✅ Implemented WeatherService for data collection
- ✅ Added configurable units (imperial/metric)
- ✅ Added weather data to detection records
- ✅ Created API endpoints:
- /api/weather/current
- /api/weather/patterns
- /api/weather/correlation
- ✅ Implemented WeatherPatternInsights component
- ✅ Added test data for development
- ✅ Implemented basic pattern detection
- ✅ Added insight generation for:
- Temperature preferences
- Wind speed impact
- Weather condition correlation
- 🚧 TODO: Add more advanced ML analysis:
- Time-based patterns
- Seasonal trends
- Multi-variable correlations
- ✅ Added current weather display
- ✅ Implemented weather insights view
- 🚧 TODO:
- Add weather overlay to activity charts
- Create correlation visualization
- Add forecast-based predictions
Current config.yml weather section:
weather:
provider: "openweathermap"
api_key: "bcae6d32eeb3bc3d95c3397111743430"
location:
lat: 30.1561588
lon: -97.9716318
units: "imperial" # "imperial" for °F/mph or "metric" for °C/m/s
update_interval: 300 # seconds
historical_data: true
-
Data Collection Improvements:
- Add error recovery for API failures
- Implement data backfilling for gaps
- Add data validation and cleanup
-
Analysis Enhancements:
- Add seasonal pattern analysis
- Implement weather-based activity predictions
- Add multi-species correlation analysis
-
UI Improvements:
- Add weather overlay to existing charts
- Create correlation visualization component
- Add forecast-based notifications
-
Testing:
- Add unit tests for WeatherService
- Add integration tests for API endpoints
- Add E2E tests for weather components