config_MAR_BUR3.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # define which raw tables to combine
  2. table_defs = {
  3. 2010: {
  4. 'Energy': [0, 1],
  5. 'Agriculture': [10],
  6. 'IPPU': [15, 16, 17],
  7. 'LULUCF': [30],
  8. 'Waste': [35],
  9. },
  10. 2012: {
  11. 'Energy': [2, 3],
  12. 'Agriculture': [11],
  13. 'IPPU': [18, 19, 20],
  14. 'LULUCF': [31],
  15. 'Waste': [36],
  16. },
  17. 2014: {
  18. 'Energy': [4, 5],
  19. 'Agriculture': [10],
  20. 'IPPU': [21, 22, 23],
  21. 'LULUCF': [32],
  22. 'Waste': [37],
  23. },
  24. 2016: {
  25. 'Energy': [6, 7],
  26. 'Agriculture': [10],
  27. 'IPPU': [24, 25, 26],
  28. 'LULUCF': [33],
  29. 'Waste': [38],
  30. },
  31. 2018: {
  32. 'Energy': [8, 9],
  33. 'Agriculture': [14],
  34. 'IPPU': [27, 28, 29],
  35. 'LULUCF': [34],
  36. 'Waste': [39],
  37. },
  38. }
  39. header_defs = {
  40. 'Energy': [['Catégories', 'CO2', 'CH4', 'N2O', 'NOx', 'CO', 'COVNM', 'SO2'],
  41. ['', 'Gg', 'Gg', 'Gg', 'Gg', 'Gg', 'Gg', 'Gg']],
  42. 'Agriculture': [['Catégories', 'CO2', 'CH4', 'N2O', 'NOx', 'CO', 'COVNM', 'SO2'],
  43. ['', 'Gg', 'GgCO2eq', 'GgCO2eq', 'Gg', 'Gg', 'Gg', 'Gg']], # units are wrong
  44. # in BUR pdf
  45. 'IPPU': [['Catégories', 'CO2', 'CH4', 'N2O', 'HFCs', 'PFCs', 'SF6', 'NOx', 'CO', 'COVNM', 'SO2'],
  46. ['', 'GgCO2eq', 'GgCO2eq', 'GgCO2eq', 'GgCO2eq', 'GgCO2eq', 'GgCO2eq', 'Gg', 'Gg', 'Gg', 'Gg']],
  47. 'LULUCF': [['Catégories', 'CO2', 'CH4', 'N2O', 'NOx', 'CO', 'COVNM', 'SO2'],
  48. ['', 'GgCO2eq', 'GgCO2eq', 'GgCO2eq', 'Gg', 'Gg', 'Gg', 'Gg']],
  49. 'Waste': [['Catégories', 'CO2', 'CH4', 'N2O', 'NOx', 'CO', 'COVNM', 'SO2'],
  50. ['', 'GgCO2eq', 'GgCO2eq', 'GgCO2eq', 'Gg', 'Gg', 'Gg', 'Gg']],
  51. }
  52. remove_cats = ['3.A.4', '3.B', '3.B.4', '1.B.2.a', '1.B.2.b', '1.B.2.c']
  53. cat_mapping = {
  54. "1.B.2.a.4": "1.B.2.a.iii.4",
  55. "1.B.2.a.5": "1.B.2.a.iii.5",
  56. "1.B.2.a.6": "1.B.2.a.iii.6",
  57. "1.B.2.b.2": "1.B.2.b.iii.2",
  58. "1.B.2.b.4": "1.B.2.b.iii.4",
  59. "1.B.2.b.5": "1.B.2.b.iii.5",
  60. "1.B.2.b.6": "1.B.2.b.iii.6",
  61. "1.B.2.c.1": "1.B.2.b.i", # simplification, split to oil and gas ("1.B.2.X.i")
  62. "1.B.2.c.2": "1.B.2.b.ii", # simplification, split to oil and gas ("1.B.2.X.ii")
  63. '1.A.2.g': '1.A.2.m', # other industry
  64. '3.A': '3.A.1', # enteric fermentation
  65. '3.A.1': '3.A.1.a', # cattle
  66. '3.A.1.a': '3.A.1.a.i',
  67. '3.A.1.b': '3.A.1.a.ii',
  68. '3.A.2': '3.A.1.c',
  69. '3.A.3': '3.A.1.h', # Swine
  70. '3.A.4.a': '3.A.1.d', # goats
  71. '3.A.4.b': '3.A.1.e', # camels
  72. '3.A.4.c': '3.A.1.f', # horses
  73. '3.A.4.d': '3.A.1.g', # Mules and asses
  74. '3.A.4.e': '3.A.1.i', # poultry
  75. # '3.B': '3.A.2', # Manure Management
  76. '3.B.1': '3.A.2.a', # cattle
  77. '3.B.1.a': '3.A.2.a.i',
  78. '3.B.1.b': '3.A.2.a.ii',
  79. '3.B.2': '3.A.2.c', # Sheep
  80. '3.B.3': '3.A.2.h', # Swine
  81. '3.B.4.a': '3.A.2.d', # Goats
  82. '3.B.4.b': '3.A.2.e', # Camels
  83. '3.B.4.c': '3.A.2.f', # Horses
  84. '3.B.4.d': '3.A.2.g', # Mules and Asses
  85. '3.B.4.e': '3.A.2.i', # Poultry
  86. '3.B.5': '3.C.6', # indirect N2O from manure management
  87. '3.C': '3.C.7', # rice
  88. '3.D': 'M.3.C.45AG', # Agricultural soils
  89. '3.D.a': '3.C.4', #direct N2O from agri soils
  90. '3.D.a.1': '3.C.4.a', # inorganic fertilizers
  91. '3.D.a.2': '3.C.4.b', # organic fertilizers
  92. '3.D.a.3': '3.C.4.c', # urine and dung by grazing animals
  93. '3.D.a.4': '3.C.4.d', # N in crop residues
  94. '3.D.b': '3.C.5', # indirect N2O from managed soils
  95. '3.D.b.1': '3.C.5.a', # Atmospheric deposition
  96. '3.D.b.2': '3.C.5.b', # nitrogen leeching and runoff
  97. '3.H': '3.C.3', # urea application
  98. 'LU.3.B.1': '3.B.1', # forest
  99. 'LU.3.B.2': '3.B.2', # cropland
  100. 'LU.3.B.3': '3.B.3', # grassland
  101. 'LU.3.B.4': '3.B.4', # wetland
  102. 'LU.3.B.5': '3.B.5', # Settlements
  103. 'LU.3.B.6': '3.B.6', # other land
  104. }
  105. aggregate_cats = {
  106. '1.B.2.a.iii': {'sources': ['1.B.2.a.iii.4', '1.B.2.a.iii.5', '1.B.2.a.iii.6'],
  107. 'name': 'All Other'},
  108. '1.B.2.b.iii': {'sources': ['1.B.2.b.iii.2', '1.B.2.b.iii.4', '1.B.2.b.iii.5',
  109. '1.B.2.b.iii.6',],
  110. 'name': 'All Other'},
  111. '1.B.2.a': {'sources': ['1.B.2.a.iii'], 'name': 'Oil'},
  112. '1.B.2.b': {'sources': ['1.B.2.b.i', '1.B.2.b.ii', '1.B.2.b.iii'],
  113. 'name': 'Natural Gas'},
  114. '2.D': {'sources': ['2.D.4'], 'name': 'Non-Energy Products from Fuels and Solvent Use'},
  115. '2.F.1': {'sources': ['2.F.1.a', '2.F.1.b'], 'name': 'Refrigeration and Air Conditioning'},
  116. '2.F': {'sources': ["2.F.1", "2.F.2", "2.F.3", "2.F.4", "2.F.5", "2.F.6"],
  117. 'name': 'Product uses as Substitutes for Ozone Depleting Substances'},
  118. '2.H': {'sources': ["2.H.1", "2.H.2", "2.H.3"], 'name': 'Other'},
  119. '3.A.2': {'sources': ['3.A.2.a', '3.A.2.c', '3.A.2.d', '3.A.2.e', '3.A.2.f',
  120. '3.A.2.g', '3.A.2.h', '3.A.2.i'],
  121. 'name': 'Manure Management'},
  122. '3.A': {'sources': ['3.A.1', '3.A.2'], 'name': 'Livestock'},
  123. '3.B': {'sources': ['3.B.1', '3.B.2', '3.B.3', '3.B.4', '3.B.5', '3.B.6'], 'name': 'Land'},
  124. '3.C': {'sources': ['3.C.3', '3.C.4', '3.C.5', '3.C.6', '3.C.7'],
  125. 'name': 'Aggregate sources and non-CO2 emissions sources on land'},
  126. 'M.3.C.AG': {'sources': ['3.C.3', '3.C.4', '3.C.5', '3.C.6', '3.C.7'],
  127. 'name': 'Aggregate sources and non-CO2 emissions sources on land (Agriculture)'},
  128. 'M.AG': {'sources': ['3.A', 'M.3.C.AG'], 'name': 'Agriculture'},
  129. '3': {'sources': ['M.AG', 'M.LULUCF'], 'name': 'AFOLU'},
  130. 'M.AG.ELV': {'sources': ['M.3.C.AG'], 'name': 'Agriculture excluding livestock emissions'},
  131. '4': {'sources': ['4.A', '4.D'], 'name': 'Waste'},
  132. '0': {'sources': ['1', '2', '3', '4']},
  133. 'M.0.EL': {'sources': ['1', '2', 'M.AG', '4']},
  134. }
  135. zero_cats = ['1.B.2.a.i', '1.B.2.a.ii'] # venting and flaring with 0 for oil as
  136. # all mapped to natural gas