# PyClimaExplorer
Turn 30+ years of raw climate data into interactive stories, forecasts, and AI-powered insights — in your browser.
Built by Team TechSmiths at IIT(BHU) Varanasi — March 2026
| Resource | Description |
|---|---|
| Presentation Deck | Project slides — IIT(BHU) Hackathon 2026 |
| Sample NetCDF Dataset | CESM2 climate data (1900–1932) for testing |
| Demo Video | Full walkthrough of all 5 modes |
PyClimaExplorer is a full-stack climate data dashboard that lets researchers, students, and curious users explore Earth's temperature and precipitation records without writing a single line of code.
Interactive global choropleth + city search + 30-year time series. Click any point on the map to pull up its full climate history.
Side-by-side heatmaps for any two years with dual time series — directly compare climate conditions across decades.
PyDeck 3D orthographic globe — rotate, zoom, change colour scale and time step interactively.
Gemini AI narrates real climate events (2003 European Heatwave, 2010 Pakistan Floods, 2022 India Heatwave) with what happened, why, and human impact. Includes a voice narrator and city explore tool.
Pixel-wise ML regression projects temperature/precipitation to any year up to 2100. City-level forecasts include 95% confidence intervals and Gemini-powered risk summaries.
Prerequisites: Python 3.9+
git clone https://github.com/<your-username>/pyclimaexplorer.git
cd pyclimaexplorer
pip install -r requirements.txtstreamlit run app.pyOpen http://localhost:8501 — the app loads with a built-in ERA5 sample dataset immediately. No sidebar, no setup required.
pyclimaexplorer/
├── assets/
│ ├── homepage.jpeg
│ ├── heatmap_global.jpeg
│ ├── heatmap_city.jpeg
│ ├── compare.jpeg
│ ├── globe.jpeg
│ ├── story_overview.jpeg
│ ├── story_ai.jpeg
│ ├── story_city.jpeg
│ ├── forecast_global.jpeg
│ └── forecast_city.jpeg
├── src/
│ ├── config.py # CSS, session state, API keys
│ ├── data.py # ERA5 loading & synthetic sample generation
│ ├── utils.py # Geocoding, nearest-index lookup, unit helpers
│ ├── plotting.py # Shared Plotly layout helpers & colorscale
│ └── pages/
│ ├── heatmap.py # Normal mode
│ ├── compare.py # Compare mode
│ ├── globe.py # 3D Globe mode
│ ├── story.py # Story / AI mode
│ └── future_scope.py # Forecast mode (ML + Gemini)
├── .streamlit/
│ └── config.toml # Theme configuration
├── app.py # Main Streamlit entry point
├── requirements.txt
├── README.md
└── .gitignore
The app ships with a synthetic ERA5-like dataset spanning 1990–2022 covering both t2m (2-metre temperature) and tp (total precipitation). It works out of the box — no download, no account.
- Create a free account at https://cds.climate.copernicus.eu
- Install the CDS API:
pip install cdsapi - Run this download script:
import cdsapi
c = cdsapi.Client()
c.retrieve(
'reanalysis-era5-single-levels',
{
'product_type': 'monthly_averaged_reanalysis',
'variable': '2m_temperature',
'year': [str(y) for y in range(1990, 2024)],
'month': [f'{m:02d}' for m in range(1, 13)],
'time': '00:00',
'format': 'netcdf',
},
'era5_t2m.nc'
)- In the app, toggle off the sample data switch and upload your
era5_t2m.ncfile.
The Forecast Mode runs a pixel-wise regression across every spatial grid point:
For each (lat, lon) pixel:
1. Extract the full monthly time series (1990–2022)
2. Fit a Polynomial (degree 2) regression on decimal year
3. Project forward to the target year (2030–2100)
4. Compute decadal rate-of-change for risk ranking
This means the app trains ~10,000+ independent models simultaneously (one per grid cell) using numpy.linalg.lstsq — fast enough to run in a browser thanks to @st.cache_data.
City-level forecasts extend to 2050 and include 95% confidence intervals that widen with projection distance, giving an honest uncertainty representation.
Limitations: This is a trend extrapolation, not a climate simulation. Results should be interpreted as illustrative projections, not scientific predictions. For research use, see CMIP6 models.
- Push this folder to a public GitHub repository
- Go to https://share.streamlit.io
- Click New app → select your repo → set
app.pyas the main file - Click Deploy — you get a live public URL with HTTPS
The app uses
@st.cache_datathroughout so Streamlit Cloud's resource limits are respected. Cold start is ~15 seconds on the free tier.
.streamlit/config.toml controls the app theme. To switch to light mode:
[theme]
base = "light"
primaryColor = "#ef4444"- Add CMIP6 model comparison alongside the regression forecast
- Support precipitation anomaly maps (not just absolute values)
- Add city-to-city climate comparison
- Export charts as PNG / CSV
- Multi-language support (Hindi, Spanish, French)
| Member | Role |
|---|---|
| Ayushi Agrawal | Full-stack development · ML forecast module · Feature architecture |
| Jhalak Mittal | Feature development · Data pipeline · ERA5 integration · Bug fixes & integration support |
| Neha Malhotra | Ideation & product design · Story mode · Gemini AI integration · Feature development |
| Reshmi Yadav | UI/UX & frontend development · Plotly visualizations · Technical documentation |
IIT(BHU) Varanasi · Hackathon 2026
MIT License — see LICENSE for details.
- ERA5 data provided by the Copernicus Climate Change Service (C3S)
- Geocoding powered by Nominatim / OpenStreetMap
- AI features powered by Google Gemini









