Real-time Thunderstorm Prediction System using Time-Series Forecasting
Try it now: ThunderCast Live on Streamlit β
ThunderCast is an automated thunderstorm prediction system that uses Facebook Prophet (time-series forecasting) to predict thunderstorm probabilities for Pimpri-Chinchwad, Pune. The system collects real-time weather data, analyzes patterns, and provides predictions with an interactive dashboard.
- β Real-time Weather Data Collection - Automated hourly data collection via OpenWeatherMap API
- β Time-Series Forecasting - Facebook Prophet model for thunderstorm prediction
- β Interactive Dashboard - Built with Streamlit and Plotly for data visualization
- β Historical Analysis - EDA and statistical insights on 13+ years of weather data
- β Automated Predictions - 6-24 hour thunderstorm probability forecasts
- β Cloud Database - Supabase for data storage and retrieval
Languages & Libraries:
- Python 3.13
- Pandas & NumPy (Data manipulation)
- Prophet (Time-series forecasting)
- Plotly (Interactive visualizations)
- Streamlit (Dashboard framework)
Tools & Services:
- Supabase (PostgreSQL database)
- OpenWeatherMap API (Weather data source)
- APScheduler (Task automation)
Domain:
- Time-Series Forecasting
- Weather Analytics
- Predictive Analytics
ThunderCast/
β
βββ data/
β βββ raw/ # Raw Kaggle dataset
β βββ processed/ # Cleaned and featured data
β βββ models/ # Trained Prophet model
β βββ visualizations/ # Generated charts (Plotly HTML files)
β
βββ src/
β βββ data_collection.py # Fetch weather data from API
β βββ data_exploration.py # Initial data exploration
β βββ data_cleaning.py # Data cleaning and preprocessing
β βββ eda_analysis.py # Exploratory Data Analysis
β βββ feature_engineering.py # Feature creation
β βββ model_training.py # Prophet model training
β βββ prediction.py # Generate predictions
β βββ scheduler.py # Automated data collection
β βββ visualizations.py # Create Plotly charts
β
βββ dashboard/
β βββ app.py # Streamlit dashboard
β
βββ config/
β βββ config.py # Configuration settings
β
βββ .env # Environment variables (API keys)
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
- Python 3.13+
- pip package manager
- Supabase account (free tier)
- OpenWeatherMap API key (free)
git clone <repository-url>
cd ThunderCastpython -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Mac/Linuxpip install -r requirements.txtCreate .env file in project root:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
OPENWEATHER_API_KEY=your_openweather_api_key
Run SQL script in Supabase SQL Editor to create tables:
-- weather_data table
CREATE TABLE weather_data (
id BIGSERIAL PRIMARY KEY,
timestamp TIMESTAMPTZ DEFAULT NOW(),
temperature FLOAT,
humidity FLOAT,
pressure FLOAT,
wind_speed FLOAT,
cloud_cover FLOAT,
location VARCHAR(100),
latitude FLOAT,
longitude FLOAT
);
-- predictions table
CREATE TABLE predictions (
id BIGSERIAL PRIMARY KEY,
prediction_time TIMESTAMPTZ DEFAULT NOW(),
forecast_time TIMESTAMPTZ,
thunderstorm_probability FLOAT,
location VARCHAR(100),
model_version VARCHAR(50)
);
-- alerts table (optional)
CREATE TABLE alerts (
id BIGSERIAL PRIMARY KEY,
alert_time TIMESTAMPTZ DEFAULT NOW(),
location VARCHAR(100),
severity VARCHAR(20),
message TEXT,
sent BOOLEAN DEFAULT FALSE
);python src/data_collection.pypython src/data_cleaning.py
python src/feature_engineering.pypython src/model_training.pypython src/prediction.pystreamlit run dashboard/app.pypython src/scheduler.pyAlgorithm: Facebook Prophet (Time-Series Forecasting)
Features Used:
- Temperature (Β°C)
- Humidity (%)
- Atmospheric Pressure (hPa)
- Wind Speed (km/h)
- Cloud Cover (%)
- Precipitation (mm)
Target Variable: Thunderstorm occurrence (Binary: 0/1)
Training Data: 116,135 hourly records (2008-2022, Pune weather)
Prediction Horizon: 6-24 hours ahead
Performance Metrics:
- Model captures seasonal patterns
- Identifies high-risk conditions (humidity >70%, pressure <1010 hPa)
- Low false positive rate for clear weather conditions
Live Weather Monitoring:
- Current temperature, humidity, pressure, wind speed, cloud cover
Thunderstorm Predictions:
- 6-24 hour probability forecast
- Risk level indicators (Low/Moderate/High)
- Interactive Plotly charts
Historical Trends:
- Multi-parameter weather visualizations
- Statistical summaries
- Customizable time ranges (6h, 12h, 24h, 7 days)
-
Thunderstorm Conditions:
- Average humidity during storms: 85%+
- Average pressure during storms: <1008 hPa
- Peak occurrence: Monsoon season (June-September)
-
Temporal Patterns:
- Higher frequency in afternoon/evening hours
- Seasonal variations clearly visible
-
Data Quality:
- 0% missing values
- 116,136 complete records
- 482 thunderstorm events identified (0.42%)
This project is for educational purposes.
- OpenWeatherMap for weather data API
- Facebook (Meta) for Prophet library
- Supabase for cloud database
- Kaggle for historical weather dataset
For queries or collaboration:
- π¨βπ» Author Name: Akash Yadav
- GitHub: @akxyverse
- Email: akashyadav110502@gmail.com
- LinkedIn: [https://www.linkedin.com/in/akash-yadav-122a75288/]
Built with β€οΈ using Python, Prophet, and Streamlit