imagepbl / effort-sharing

Analysis and plotting scripts for effort sharing, associated with the Carbon Budget Explorer
MIT License
0 stars 0 forks source link

Introduction

This code combines a variety of data sources to compute fair national emissions allocations, studies variability in these allocations and compares them with NDC estimates and cost-optimal scenario projections. We plan to make the code more accessible in terms of commenting and cleaning up old code over time. The output data of this code is publicly available on Zenodo:

DOI

Main features

The main notebook you will be using is Main.ipynb in the main directory. Each cell in that notebook loads in a particular class and then goes through all of its methods.

One final important notebook is Aggregator.ipynb. This script aggregates the country-individual files xr_alloc_XYZ.nc. One output is the aggregation of those files into a single file for a single year, for example xr_alloc_2030.nc. Useful for analysis purposes. Input variables can be changed in input.yml.

Installation instructions (currently aimed at direct colleagues)

It is recommended to clone the code to the K:\ directory for best performance.

git clone https://github.com/imagepbl/EffortSharing

Setting up the environment

conda

We recommend to install the Conda environment also on the K:\ drive to increase performance. Create folders environments\effortsharing_env on K:\. Create a new conda environment with a --prefix in that folder. Activate it and update it the content based on the file environment.yml.

cd .\environments\effortsharing_env\
conda create --prefix .
conda activate K:\environments\effortsharing_env
conda env update --name K:\environments\effortsharing_env --file K:\<FILEPATH>\environment.yml

pip

pip install -r /path/to/requirements_pip.txt

Setting up required folder structure

You will need to make a folder+subfolder in the K:/ drive as follows: K:/Data/Data_effortsharing/DataUpdate_ongoing. There all the data files will appear. Most output files that are generated here are in netcdf (or xarray) format.

cd K:
mkdir Data\Data_effortsharing\DataUpdate_ongoing\Allocations
mkdir Data\Data_effortsharing\DataUpdate_ongoing\Allocations_CO2_excl