/electricitymap

A real-time visualisation of the CO2 emissions of electricity generation

Primary LanguageJupyter NotebookGNU General Public License v3.0GPL-3.0

electricitymap Slack Status

A real-time visualisation of the GHG and CO2 footprint of electricity generation built with d3.js, optimized for Google Chrome. Try it out at http://electricitymap.tmrow.co.

image

Consider contributing or submit ideas, feature requests or bugs on the issues page.

Data sources

GreenHouse Gas footprint calcuation and data source

The GreenHouse Gas (GHG) footprint of each country is measured from the perspective of a consumer. It represents the GHG footprint of 1 kWh consumed inside a given country, in the gCO2eq unit (meaning each GHG is converted to its CO2 equivalent in terms of global warming potential).

The GHG footprint of each production mode takes into account the construction of production units and their usual lifetimes as calculated by the 2014 IPCC report (see wikipedia entry and co2eq.js#L1).

Each country has a GHG mass flow that depends on neighboring countries. In order to determine the GHG footprint of each country, the set of coupled GHG mass flow balance equations of each countries must be solved simultaneously. This is done by solving the linear system of equations defining the network of GHG exchanges (see co2eq.js#L52).

Real-time electricity data sources

Production capacity data sources

Real-time weather data sources

We use the US National Weather Service's Global Forecast System (GFS)'s GFS 0.25 Degree Hourly data. Forecasts are made every 6 hours, with a 1 hour time step. The values extracted are wind speed and direction at 10m altitude, and ground solar irradiance (DSWRF - Downward Short-Wave Radiation Flux), which takes into account cloud coverage. In order to obtain an estimate of those values at current time, an interpolation is made between two forecasts (the one at the beginning of the hour, and the one at the end of the hour).

Topology data

We use the Natural Earth Data Cultural Vectors country boundaries.

Contribute

Want to help? Join us on slack at http://slack.tmrow.co. In the meantime, here's some things you can do:

  • check out the issues
  • add your country by writing a parser
  • update an existing parser with a different API if you know one with more data or closer to real-time
  • optimise the code, correct inaccuracies...

You can also see a list of missing informations displayed as warnings in the developer console, or question marks in the country panel:

image

To get started, clone or fork the repository, and install Docker. then you just run docker-compose up. Head over to http://localhost:8000/ and you should see the map!

You can then start editing the code. If you edit the frontend it will need compiling. You should run

docker-compose run web npm run watch

in order to compile your modifications on the fly.

Once you're done doing your changes, submit a pull request to get them integrated.

Troubleshooting

  • ERROR: Couldn't find env file: env files are used to store sensitive information such as API keys. If you get this error after running docker-compose up, create an empty file named secrets.env in the root folder

  • KeyError: 'ENTSOE_TOKEN': in order to request data from the ENTSOE, you need an API key. You can create an account and request your API key by following this link. Once you have it, add it to your secrets.env file.