How aditya-pm/climate-twin works
ClimateTwin is a Chennai urban-heat digital twin: the web app explores grid cells, explains vulnerability, compares mitigation scenarios, and presents citywide priorities and model methodology. Its main runtime path is the browser’s API client to FastAPI, which serves a Twin built from grid data and an LST model; the Twin computes vulnerability, scenario effects, and recommendations. The README documents the product capabilities and HTTP boundary; source excerpts support the backend dependencies and selected UI composition. Unshown frontend data wiring is not expanded beyond that boundary.
Main entry points: engine.py Twin analytics · Simulator.tsx Scenario simulator · data.py Dataset loader · geo.py Chennai geography
Components 17
ClimateTwin web app
- City landing
web/components/landing/Landing.tsx - Grid explorer
web/components/explorer/Explorer.tsx - Cell diagnosis
web/components/explorer/CellPanel.tsx - Scenario simulator
web/components/simulator/Simulator.tsx - Before-after map
web/components/simulator/CompareMap.tsx - City insights
web/components/insights/Insights.tsx - Model methodology
web/components/methodology/Methodology.tsx - Interactive map
web/components/MapView.tsx - API client
web/lib/api.ts
API and twin
- FastAPI service
backend/app.py - Twin analytics
backend/climatetwin/engine.py
Grid data
- Dataset loader
backend/climatetwin/data.py - Real-data pipeline
backend/climatetwin/realdata.py - Synthetic observations
backend/climatetwin/synth.py - Chennai geography
backend/climatetwin/geo.py
Climate analysis
- LST and SHAP
backend/climatetwin/model.py
Other components
- City user
Connections 17
- City user → City landing: opens app
README.md - City user → Grid explorer: explores cells
README.md - City user → Scenario simulator: sets scenario
README.md - City user → City insights: reviews priorities
README.md - City user → Model methodology: reviews method
README.md - Grid explorer → Cell diagnosis: selects cell
web/components/explorer/Explorer.tsx - Scenario simulator → Before-after map: renders comparison
web/components/simulator/Simulator.tsx - Scenario simulator → Interactive map: renders map
web/components/simulator/Simulator.tsx - API client → FastAPI service: requests API
README.md - FastAPI service → Twin analytics: serves twin results
backend/app.py - Twin analytics → Dataset loader: loads dataset
backend/climatetwin/engine.py - Twin analytics → LST and SHAP: uses model
backend/climatetwin/engine.py - Twin analytics → Chennai geography: uses grid bounds
backend/climatetwin/engine.py - Dataset loader → Synthetic observations: loads fallback
backend/climatetwin/data.py - Synthetic observations → Chennai geography: uses geography
backend/climatetwin/synth.py - Real-data pipeline → Chennai geography: uses grid
backend/climatetwin/realdata.py - Dataset loader → Real-data pipeline: selects real data