A polished end-to-end solar forecasting demo that predicts intensity (irradiance & AC kW) over regions and sites, with uncertainty bands and an aesthetic Streamlit UI. It runs fully offline using simulated satellite/NWP data so you can demo anywhere, then swap in real feeds later.
- Regional heatmaps (tile-level) for the next 6 hours (nowcast) and 48 hours (blend).
- Site-level power forecasts with P10/P50/P90 bands → convert irradiance to AC power with
pvlib(falls back gracefully if missing). - Model monitor: rolling MAE/CRPS on synthetic "truth" to showcase MLOps thinking.
- Upload your plant config (CSV) or use sample plants.
- Architecture set up for easy swap-in of real INSAT/NWP data and advanced models.
# 1) Create & activate a venv (recommended)
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
# 2) Install dependencies
pip install -r requirements.txt
# 3) Run the app
streamlit run app.pyOpen the local URL from Streamlit.
solar_forecast_hackathon/By Akash Pandey
├─ app.py # Streamlit app (multi-page style in one file)
├─ requirements.txt
├─ config.yaml # App/theme/config toggles
├─ data/
│ ├─ sample_sites.csv # Example sites (lat/lon/tilt/azimuth/size)
│ └─ simulate.py # Synthetic satellite/NWP + truth generator
├─ models/
│ ├─ nowcast.py # Lightweight cloud-field nowcaster
│ ├─ blend.py # Blend nowcast + "NWP-like" medium-term + calibration
│ └─ uncertainty.py # Quantile generation & reliability calibration
├─ pv/
│ └─ pvlib_wrap.py # AC conversion (pvlib PVWatts; with safe fallback)
├─ utils/
│ ├─ geo.py # Regional grid/tiling helpers
│ ├─ schema.py # Data schemas & validators
│ └─ theming.py # UI theme helpers
└─ README.md
- Replace
data/simulate.pyproviders with INSAT-3D/3DR cloud products and NWP (ECMWF/GFS/IMD). - Keep the same interfaces so
models/nowcast.pyandmodels/blend.pycontinue to work. - Use the
pv/pvlib_wrap.pyas the single place to convert irradiance → AC.
Good luck — Akash Pandey
uvicorn backend.api:app --reload --port 8000Try:
curl http://localhost:8000/health
curl "http://localhost:8000/tiles/forecast?horizon=blend&minutes=720"
curl -X POST "http://localhost:8000/site/forecast?horizon=nowcast&minutes=360" -H "Content-Type: application/json" -d '{"lat":26.9,"lon":75.8,"tilt":15,"azimuth":180,"dc_kw":1000,"inv_kw":900}'