Figures and data tables for SPM Figure 3a of emission pathways

Notebook spm_sr15_figure_3a_global_emissions_pathways

This notebook is based on the Release 1.1 of the IAMC 1.5C Scenario Explorer and Data and refers to the published version of the IPCC Special Report on Global Warming of 1.5C (SR15).

The notebook is run with pyam release 0.5.0.

The source code of this notebook is available on GitHub (release 2.0.2).


IPCC SR15 scenario assessment

Global emission pathway characteristics

Figure 3a of the Summary for Policymakers

This notebook extracts the emissions pathways for Figure 3a in the Summary for Policymakers of the IPCC's "Special Report on Global Warming of 1.5°C".

The scenario data used in this analysis can be accessed and downloaded at


The figures shown in this notebook are NOT the same figures as used in Figure 3a of the SPM. They are simplified figures included here only for reference.

Load pyam package and other dependencies

In [1]:
import pandas as pd
import numpy as np
import io
import itertools
import yaml
import math
import matplotlib.pyplot as plt'style_sr15.mplstyle')
%matplotlib inline
import pyam
pyam - INFO: Running in a notebook, setting `pyam` logging level to `logging.INFO` and adding stderr handler

Import scenario data, categorization and specifications files

The metadata file with scenario categorisation and quantitative indicators can be downloaded at
Alternatively, it can be re-created using the notebook sr15_2.0_categories_indicators.

The last cell of this section loads and assigns a number of auxiliary lists as defined in the categorization notebook.

In [2]:
sr1p5 = pyam.IamDataFrame(data='../data/iamc15_scenario_data_world_r2.0.xlsx')
pyam.utils - INFO: Reading `../data/iamc15_scenario_data_world_r2.0.xlsx`
In [3]:
pyam.core - INFO: Importing metadata for 416 scenarios (for total of 416)
In [4]:
with open("sr15_specs.yaml", 'r') as stream:
    specs = yaml.load(stream, Loader=yaml.FullLoader)

rc = pyam.run_control()
for item in specs.pop('run_control').items():
    rc.update({item[0]: item[1]})
cats = specs.pop('cats')
cats_15 = specs.pop('cats_15')
cats_15_no_lo = specs.pop('cats_15_no_lo')
marker= specs.pop('marker')

Downselect scenario ensemble to categories of interest for this assessment

This figure only includes scenarios where the 2010 Kyoto GHG emissions are in line with the valid range as determined by the Second Assessment Report.

In [5]:
sr1p5.meta.rename(columns={'Kyoto-GHG|2010 (SAR)': 'kyoto_ghg_2010'}, inplace=True)
In [6]:
df = sr1p5.filter(category=cats_15, kyoto_ghg_2010='in range')
In [7]:
df.set_meta(meta='1.5C limited overshoot', name='supercategory', index=df.filter(category=cats_15_no_lo))
rc.update({'color': {'supercategory': {'1.5C limited overshoot': 'xkcd:bluish'}}})

Set specifications for filters and initialize data list

In [8]:
filter_args = dict(df=df, category=cats, marker=None, join_meta=True)
In [9]:
data = []

Plot different emissions pathways by category

Net carbon dioxide emissions for all pathways limiting global warming to 1.5°C by the end of the century

In [10]:
co2 = (
    .convert_unit('Mt CO2/yr', 'Gt CO2/yr')
data.append(('Net carbon dioxide', co2))
In [11]:
_co2 = co2.filter(category=cats_15, year=range(2010, 2101, 5))

fig, ax = plt.subplots()
_co2.filter(year=[2010]).line_plot(ax=ax, color='category', linewidth=2)
_co2.line_plot(ax=ax, color='category', linewidth=0.1, fill_between=True, final_ranges=True)
_co2.filter(marker=marker).line_plot(ax=ax, color='category')
<matplotlib.axes._subplots.AxesSubplot at 0x1a3511b8d0>

Emissions of methane, black carbon and nitrous oxide for 1.5°C pathways with limited overshoot

The figures below are shown as reduction relative to 2010.

In [12]:
def plot_relative(data, baseyear=2010):
    _data = data.timeseries()
    _data_rel = pd.DataFrame()
    for y in range(2010, 2101, 5):
        _data_rel[y] = _data[y] / _data[2010]

    _data_rel['unit'] = 'relative to {}'.format(baseyear)
    _df = pyam.IamDataFrame(_data_rel)
    _df.set_meta(meta='1.5C limited overshoot', name='supercategory')
    _df.filter(supercategory='1.5C limited overshoot', year=range(2010, 2101, 5))\
        .line_plot(color='supercategory', linewidth=0.1, fill_between=True, legend=False)
In [13]:
ch4 = df.filter(variable='Emissions|CH4')
data.append(('Methane', ch4))
In [14]:
In [15]:
bc = df.filter(variable='Emissions|BC')
data.append(('Black carbon', bc))
In [16]:
In [17]:
n2o = df.filter(variable='Emissions|N2O')
n2o.convert_unit('kt N2O/yr', 'Mt N2O/yr', factor=1/1000, inplace=True)
data.append(('Nitrous oxide', n2o))
In [18]:

Save timeseries data to xlsx

In [19]:
writer = pd.ExcelWriter('output/spm_sr15_figure3a_data_table.xlsx')
for (name, _df) in data:
    pyam.utils.write_sheet(writer, name,
                           pyam.filter_by_meta(_df.timeseries(), **filter_args), index=True)
In [ ]: