data source

CAIT 2.0 UNFCCC Annex I emissions

http://www.wri.org/resources/data-sets/unfccc-annex-i-ghg-emissions-0

CAIT 2.0 Country GHG Emissions.csv

http://cait2.wri.org/docs/CAIT2.0_CountryGHG_Methods.pdf

,,Emissions Totals,,Emissions by Gas,,,,Emissions by Sector,,,,,,Energy Emissions by Sub-Sector,,,,,


In [1]:
import csv

In [3]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
# import prettyplotlib as ppl
import pandas as pd

In [12]:
cy = pd.read_csv('WRIdata/CAIT 2.0 Country GHG Emissions.csv')
cy = cy.replace('', '0')
cy = cy.fillna(0)

In [16]:
cy.to_pickle("WRIdata/CountyGHGs.pkl")
cy.columns


Out[16]:
Index([u'Country', u'Year', u'Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e)', u'Total GHG Emissions Including Land-Use Change and Forestry (MtCO2e)', u'Total CO? Excluding Land-Use Change and Forestry (MtCO2)', u'Total CH4 (MtCO2e)', u'Total N2O (MtCO2e)', u'Total F-Gas (MtCO2e)', u'Energy (MtCO2e)', u'Industrial Processes (MtCO2e)', u'Agriculture (MtCO2e)', u'Waste (MtCO2e)', u'LUCF (MtCO2)', u'Bunker Fuels (MtCO2)', u'Electricity/Heat (MtCO2)', u'Manufacturing/Construction (MtCO2)', u'Transportation (MtCO2)', u'Other Fuel Combustion (MtCO2e)', u'Fugitive Emissions (MtCO2e)'], dtype='object')

In [17]:
e2011 = cy[cy['Year'] == 2011]

In [18]:
len(e2011['Country'])
e2011.head()


Out[18]:
Country Year Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e) Total GHG Emissions Including Land-Use Change and Forestry (MtCO2e) Total CO? Excluding Land-Use Change and Forestry (MtCO2) Total CH4 (MtCO2e) Total N2O (MtCO2e) Total F-Gas (MtCO2e) Energy (MtCO2e) Industrial Processes (MtCO2e) Agriculture (MtCO2e) Waste (MtCO2e) LUCF (MtCO2) Bunker Fuels (MtCO2) Electricity/Heat (MtCO2) Manufacturing/Construction (MtCO2) Transportation (MtCO2) Other Fuel Combustion (MtCO2e) Fugitive Emissions (MtCO2e)
21 Afghanistan 2011 25.3140 25.3140 6.5892 14.918806 3.555945 0.250075 0.000000 0.000000 10.649049 7.807114 0.00000 0.00 0.00 0.00 0.00 0.000000 0.018588
43 Albania 2011 6.6421 6.4350 3.8700 2.042046 0.709250 0.020793 4.178090 0.000000 1.815239 0.626808 -0.20709 0.06 0.13 0.87 2.32 0.813442 0.044648
65 Algeria 2011 171.0483 172.5160 121.3781 43.355179 2.738071 3.576946 140.423879 14.253527 6.605581 9.755265 1.46775 2.23 39.60 13.51 32.34 18.847913 36.125966
87 Angola 2011 223.3533 263.4348 28.4594 125.905947 68.879997 0.107982 116.460058 0.000000 104.617518 2.167738 40.08147 1.16 2.40 2.71 6.82 5.439277 99.090781
109 Antigua & Barbuda 2011 1.2977 1.2977 0.7316 0.176359 0.045035 0.344739 0.000000 0.000000 0.068951 0.151450 0.00000 0.00 0.00 0.00 0.00 0.000000 0.000000

now try to make a pie chart with country emissions totals from 2011

including land use change


In [16]:
e2011 = e2011.sort('Total GHG Emissions Including Land-Use Change and Forestry (MtCO2e)', ascending = 0)
e2011mini = e2011[['Total GHG Emissions Including Land-Use Change and Forestry (MtCO2e)','Country']]
# get rid of World total 
# also get rid of EU15 and EU28
pieces = [e2011mini[1:3],e2011mini[5:]]
e2011totals = pd.concat(pieces)

In [17]:
ts = e2011totals['Total GHG Emissions Including Land-Use Change and Forestry (MtCO2e)']
# top 10 countries get called out.
# group everyone else in Other
other = ts.values[10:].sum()
topten = ts.values[0:9]
plt.pie(np.insert(topten, 0, other), labels = np.insert(e2011totals[0:9]['Country'].values, 0, 'Other'))
plt.show()


excluding land use change


In [18]:
e2011 = e2011.sort('Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e)', ascending = 0)
e2011mini = e2011[['Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e)','Country']]
# get rid of World total 
# also get rid of EU15 and EU28
pieces = [e2011mini[1:3],e2011mini[5:]]
e2011totals = pd.concat(pieces)

In [19]:
ts = e2011totals['Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e)']
# top 10 countries get called out.
# group everyone else in Other
other = ts.values[10:].sum()
topten = ts.values[0:9]
plt.pie(np.insert(topten, 0, other), labels = np.insert(e2011totals[0:9]['Country'].values, 0, 'Other'))
plt.show()



In [20]:
other


Out[20]:
16094.787699999999

In [21]:
e2011mini[0:10]


Out[21]:
Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e) Country
4091 43816.7343 World
769 10552.6054 China
3959 6550.0981 United States of America
1297 4540.9445 European Union (28)
1275 3611.0495 European Union (15)
1715 2486.1713 India
3101 2374.3143 Russian Federation
1891 1307.4082 Japan
505 1131.1022 Brazil
1451 882.9341 Germany

In [22]:
ts.values.sum()


Out[22]:
43645.731599999999

In [23]:
topten


Out[23]:
array([ 10552.6054,   6550.0981,   2486.1713,   2374.3143,   1307.4082,
         1131.1022,    882.9341,    834.5754,    716.2074])

break up into sectors


In [24]:
# USAtotal emissions excluding LUC = 6550.0981
energy_sectors = ['Electricity/Heat (MtCO2)','Manufacturing/Construction (MtCO2)', 'Transportation (MtCO2)',
                  'Fugitive Emissions (MtCO2e)', 'Other Fuel Combustion (MtCO2e)']
sectors = ['Energy (MtCO2e)', 'Industrial Processes (MtCO2e)',
            'Agriculture (MtCO2e)',
            'Waste (MtCO2e)', 'Bunker Fuels (MtCO2)']
USA2011 = e2011[2:3]
USA2011


Out[24]:
Agriculture (MtCO2e) Bunker Fuels (MtCO2) Country Electricity/Heat (MtCO2) Energy (MtCO2e) Fugitive Emissions (MtCO2e) Industrial Processes (MtCO2e) LUCF (MtCO2) Manufacturing/Construction (MtCO2) Other Fuel Combustion (MtCO2e) Total CH4 (MtCO2e) Total CO? Excluding Land-Use Change and Forestry (MtCO2) Total F-Gas (MtCO2e) Total GHG Emissions Excluding Land-Use Change and Forestry (MtCO2e) Total GHG Emissions Including Land-Use Change and Forestry (MtCO2e) Total N2O (MtCO2e) Transportation (MtCO2) Waste (MtCO2e) Year
3959 472.282729 148.18 United States of America 2478.03 5670.781257 329.55169 243.930401 -415.07089 597.86 627.229568 686.068747 5333.0553 175.121032 6550.0981 6135.0273 355.853041 1638.11 163.093757 2011

In [25]:
e2011[2:3][energy_sectors]


Out[25]:
Electricity/Heat (MtCO2) Manufacturing/Construction (MtCO2) Transportation (MtCO2) Fugitive Emissions (MtCO2e) Other Fuel Combustion (MtCO2e)
3959 2478.03 597.86 1638.11 329.55169 627.229568

In [26]:
print USA2011[energy_sectors].values.sum()
print USA2011['Energy (MtCO2e)'].values
print USA2011[sectors].values.sum()
print 6550.0981


5670.7812573
[ 5670.781257]
6698.2681442
6550.0981

question...

1. Electricity/Heat emissions are those emissions from producing electricity or heat. Does manufacturing also use electricity, though?

I guess electricity or heat used in manufacturing that is purchased is already counted in electricity/heat


In [66]:
# e2011[1:3][e2011[sectors][1:2].keys()[0]]
top_four_pieces = [e2011[1:3],e2011[5:7]]
top_four = pd.concat(top_four_pieces)
top_four[sectors].sum()


Out[66]:
Energy (MtCO2e)                  18052.814307
Industrial Processes (MtCO2e)     1727.737042
Agriculture (MtCO2e)              1691.495522
Waste (MtCO2e)                     491.112296
Bunker Fuels (MtCO2)               236.820000
dtype: float64

In [31]:
e2011[sectors][0:1]-top_four[sectors].sum()


Out[31]:
Energy (MtCO2e) Industrial Processes (MtCO2e) Agriculture (MtCO2e) Waste (MtCO2e) Bunker Fuels (MtCO2)
4091 15483.599813 1015.978708 4361.793603 992.213023 876.82

In [29]:
top_ten_pieces = [e2011[1:3],e2011[5:13]]
top_ten = pd.concat(top_ten_pieces)
e2011[sectors][0:1]-top_ten[sectors].sum()
e2011[energy_sectors][0:1]-top_ten[energy_sectors].sum()


Out[29]:
Electricity/Heat (MtCO2) Manufacturing/Construction (MtCO2) Transportation (MtCO2) Fugitive Emissions (MtCO2e) Other Fuel Combustion (MtCO2e)
4091 4430.81 1892.65 2260.38 1226.36472 1548.779394

take out EU28 countries


In [49]:
EU28_names = ['Austria', 'Belgium', 'Bulgaria', 'Croatia', 'Cyprus', 'Czech Republic', 'Denmark', 'Estonia', 
              'Finland', 'France', 'Germany', 'Greece', 'Hungary', 'Italy', 'Latvia', 'Lithuania', 'Luxembourg', 
              'Malta', 'Netherlands', 'Poland', 'Portugal', 'Romania', 'Slovakia', 'Slovenia', 'Spain', 'Sweden',
              'United Kingdom']

In [57]:
EU28_subset = e2011[e2011['Country'].isin(EU28_names)]

In [78]:
e2011_wo_EU28 = e2011[~e2011['Country'].isin(EU28_names + ['World', 'European Union (15)'])]
first20_EU28 = e2011_wo_EU28[0:20][sectors + energy_sectors + ['Country']]

In [73]:
# collapse all other countries into one entry
e2011_wo_EU28[20:][sectors].sum()


Out[73]:
Energy (MtCO2e)                  4651.053669
Industrial Processes (MtCO2e)     205.697176
Agriculture (MtCO2e)             2260.558423
Waste (MtCO2e)                    382.845512
Bunker Fuels (MtCO2)              333.720000
dtype: float64

In [74]:
e2011_wo_EU28[20:][energy_sectors].sum()


Out[74]:
Electricity/Heat (MtCO2)              1550.710000
Manufacturing/Construction (MtCO2)     828.640000
Transportation (MtCO2)                 794.150000
Fugitive Emissions (MtCO2e)            929.494938
Other Fuel Combustion (MtCO2e)         573.331933
dtype: float64

In [ ]: