Skip to content

openclimatefix/global-solar-forecast

Repository files navigation

Global Solar Forecast

All Contributors

workflows badge tags badge contributors badge

ease of contribution: medium

⚠️ This project is a working-in-progress

This aim of this project is to make a global solar forecast: a 0-48 hours forecast for every country in the world. We get the solar capacity for every country (mainly collected from Ember and Our World in Data and added in manually), and then create a solar forecast, displayed in the UI in various charts.

We've presented Global Solar Forecast at FOSDEM 2026, talking about why we built it, how it works, and how we hope for it to develop. Watch the talk

The solar forecast is very simple,

  • as it assume one solar panel in the middle of the country,
  • then we scaled it to the capacity of the country
  • We use open.quartz.solar which is for domestic solar, and uses free weather forecasts.

image image

How It Works

The following diagram shows the architecture and data flow of the Global Solar Forecast application:

flowchart TB
    subgraph App["Global Solar Forecast App"]
        direction TB
        A[("Streamlit App<br/>main.py")] --> B["Load Country Data<br/>capacities.csv"]
        B --> C{"For Each Country"}
    end

    subgraph Forecast["Forecast Generation"]
        direction TB
        C --> D["Get Country Center<br/>lat/lon coordinates"]
        D --> E["Call forecast.py<br/>get_forecast()"]
        E --> F["POST Request to<br/>open.quartz.solar/forecast"]
    end

    subgraph QuartzAPI["Quartz Solar API"]
        direction TB
        F --> G["Fetch Weather Data<br/>from Open-Meteo"]
        G --> H["Run ML Model<br/>Solar Prediction"]
        H --> I["Generate 48-hour<br/>Forecast"]
    end

    subgraph Display["UI Display"]
        direction TB
        I --> J["World Map<br/>Color-coded by generation"]
        I --> K["Stacked Area Charts<br/>by region/country"]
        I --> L["Country Details<br/>Individual forecasts"]
    end

    style App fill:#2d3436,stroke:#636e72,color:#dfe6e9
    style Forecast fill:#0984e3,stroke:#74b9ff,color:#fff
    style QuartzAPI fill:#6c5ce7,stroke:#a29bfe,color:#fff
    style Display fill:#00b894,stroke:#55efc4,color:#fff
Loading

Data Flow Summary

  1. App Startup: Streamlit app loads and reads solar capacity data for each country
  2. Forecast Request: For each country, the app calls the Quartz Solar API with location and capacity
  3. ML Prediction: The API fetches weather data from Open-Meteo and runs an ML model
  4. 48-Hour Forecast: Returns power generation predictions for the next 48 hours
  5. UI Rendering: Results displayed on an interactive world map and charts

TODO add weblink of where this is deployed

FAQ

See FAQs here

Development

In order to run the app locally, clone this repo and run uv sync. To start app run uv run streamlit run src/v1/main.py

Running the test suite

Current there are not tests, but it would be great if some were added

Contributing and community

issues badge

Contributors

Peter Dudfield
Peter Dudfield

💻
dantravers
dantravers

🤔
Megawattz
Megawattz

🤔
Ramkumar R
Ramkumar R

🎨
Ritkaar Singh
Ritkaar Singh

💻
Nataliia Sosnovshchenko
Nataliia Sosnovshchenko

💻
Walter Michel Raja
Walter Michel Raja

💻
Sagar K Pillai
Sagar K Pillai

💻

Part of the Open Climate Fix community.

OCF Logo

About

Forecast and Dashboard for Global Solar Forecast

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors