Agricultural non-CO2 emissions (Figure 2.25)

Notebook sr15_2.4.4_afolu_emissions

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).

sr15_2.4.4_afolu_emissions

IPCC SR15 scenario assessment

Analysis of non-CO2 emissions from agriculture, forestry and land use

This notebook plots figures for emissions of CH4 and N2O from the land use sector for Figure 2.25 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 https://data.ene.iiasa.ac.at/iamc-1.5c-explorer.

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
plt.style.use('style_sr15.mplstyle')
%matplotlib inline
import pyam

from utils import boxplot_by_cat
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 https://data.ene.iiasa.ac.at/iamc-1.5c-explorer. 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]:
sr1p5.load_meta('sr15_metadata_indicators.xlsx')
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')
all_cats = specs.pop('all_cats')
subcats = specs.pop('subcats')
all_subcats = specs.pop('all_subcats')
marker= specs.pop('marker')

Downselect scenario ensemble to categories of interest for this assessment

In [5]:
cats.remove('Above 2C')
In [6]:
years = [2010, 2030, 2050, 2100]
In [7]:
sr1p5.meta.rename(columns={'Kyoto-GHG|2010 (SAR)': 'kyoto_ghg_2010'}, inplace=True)
In [8]:
df = sr1p5.filter(kyoto_ghg_2010='in range', category=cats, year=years)

Set specifications for filter and plotting

In [9]:
plot_ylabel = 'Global {} emissions from AFOLU ({})'
save_name = 'output/fig2.25{}.{}'
data_header = 'Emissions from AFOLU'
In [10]:
filter_args = dict(df=sr1p5, category=cats, marker=None, join_meta=True)
In [11]:
def plotting_args(name, label, unit, panel_label=None, filetype='png'):
    return {'categories': cats, 'column': 'category', 'years': years,
            'add_marker': marker,
            'ylabel': plot_ylabel.format(label, unit),
            'save': save_name.format(name if panel_label is None else '{}_{}'.format(panel_label, name), filetype)}
In [12]:
data = []

Methane emissions from agriculture

In [13]:
ch4_afolu = df.filter(variable='Emissions|CH4|AFOLU').timeseries()
In [14]:
name = 'ch4_afolu'
species = 'CH4'
unit = 'MtCH4/yr'

_data = pyam.filter_by_meta(ch4_afolu, **filter_args)
boxplot_by_cat(_data, **plotting_args(name, species, unit, 'a'))
_data['species'] = species
data.append(_data)

Nitrous oxide emissions from agriculture

In [15]:
n2o_afolu = (
    df.filter(variable='Emissions|N2O|AFOLU')
    .convert_unit('kt N2O/yr', 'Mt N2O/yr', factor=1/1000)
    .timeseries()
)
In [16]:
name = 'no2_afolu'
species = 'N2O'
unit = 'MtN2O'

_data = pyam.filter_by_meta(n2o_afolu, **filter_args)
fig = boxplot_by_cat(_data, **plotting_args(name, species, unit, 'b'),
                     legend=False)
_data['species'] = species
data.append(_data)

Export timeseries data to xlsx

In [17]:
data = pd.concat(data).set_index(['species', 'category', 'marker'], append=True)
In [18]:
data.head()
Out[18]:
2010 2030 2050 2100
model scenario region variable unit species category marker
GCAM 4.2 SSP1-26 World Emissions|CH4|AFOLU Mt CH4/yr CH4 Lower 2C NaN 175.141841 164.524249 156.275277 108.393069
REMIND-MAgPIE 1.7-3.0 PEP_2C_red_goodpractice World Emissions|CH4|AFOLU Mt CH4/yr CH4 Lower 2C NaN 181.441600 234.163100 174.610000 133.665700
AIM/CGE 2.0 SFCM_SSP2_combined_2Degree World Emissions|CH4|AFOLU Mt CH4/yr CH4 Higher 2C NaN 180.391200 167.105200 140.526600 150.026000
IMAGE 3.0.1 ADVANCE_2020_WB2C World Emissions|CH4|AFOLU Mt CH4/yr CH4 Lower 2C NaN 165.800284 155.889552 121.107287 108.867928
SSP4-26 World Emissions|CH4|AFOLU Mt CH4/yr CH4 Lower 2C NaN 165.313137 152.760207 125.057195 110.662131
In [19]:
data.reset_index().to_excel('output/fig2.25_data_table.xlsx')
In [ ]: