Browse Source

fix bug in processing; add M.0.EL to Israel, BUR2

Johannes Gütschow 1 year ago
parent
commit
7be6e8179b

+ 5 - 3
UNFCCC_GHG_data/UNFCCC_DI_reader/UNFCCC_DI_reader_config.py

@@ -1,4 +1,5 @@
 # TODO: check if downscaling respects gas basket resolution for GWP transformation
+# TODO: why is albania IPPU KYOTOGHG 0 in 2005
 
 di_query_filters = [
     'classifications', 'measures', 'gases',
@@ -279,6 +280,7 @@ cat_conversion = {
             '1.B': '1.B',
             '1.B.1': '1.B.1',
             '1.B.2': '1.B.2',
+            '2': '2',
             '2.A': '2.A',
             '2.B': 'M.2.B_2.B',
             '2.C': '2.C',
@@ -311,8 +313,8 @@ cat_conversion = {
         'aggregate': {
             '2.B': {'sources': ['M.2.B_2.B', 'M.2.B_2.E'], 'name': 'Chemical Industry'},
             '2.H': {'sources': ['M.2.H.1_2', '2.H.3'], 'name': 'Other'},
-            '2': {'sources': ['2.A', '2.B', '2.C', '2.F', '2.H'],
-                  'name': 'Industrial Processes and Product Use'},
+            #'2': {'sources': ['2.A', '2.B', '2.C', '2.F', '2.H'],
+            #      'name': 'Industrial Processes and Product Use'},
             '3.A': {'sources': ['3.A.1', '3.A.2'], 'name': 'Livestock'},
             '3.C.1': {'sources': ['3.C.1.b', '3.C.1.c'],
                          'name': 'Emissions from biomass burning'},
@@ -382,7 +384,7 @@ di_processing_templates = {
                     'entities': ['CO2', f'KYOTOGHG ({gwp_to_use})'],
                         'time': ['2005'],
                 },
-                'Bunkers': { # Aviation and marine swappen in 2005
+                'Bunkers': { # Aviation and marine swapped in 2005
                     'category': ['14423', '14424'],
                     'entities': [f'KYOTOGHG ({gwp_to_use})'],
                         'time': ['2005'],

+ 5 - 2
UNFCCC_GHG_data/UNFCCC_reader/Israel/config_ISR_BUR2.py

@@ -325,6 +325,7 @@ cat_conversion = {
         '1.B': '1.B', # currently not needed
         '1.B.1': '1.B.1', # currently not needed
         '1.B.2': '1.B.2', # currently not needed
+        '2': '2',
         '2.A': '2.A',
         '2.A.1': '2.A.1', # cement
         '2.A.2': '2.A.2', # lime
@@ -370,8 +371,8 @@ cat_conversion = {
         '2.B.10': {'sources': ['M.2.B.10.a', 'M.2.B.10.b'], 'name': 'Other'},
         '2.B': {'sources': ['2.B.2', '2.B.8', '2.B.9', '2.B.10'], 'name': 'Chemical Industry'},
         '2.H': {'sources': ['M.2.H.1_2', '2.H.3'], 'name': 'Other'},
-        '2': {'sources': ['2.A', '2.B', '2.C', '2.F', '2.H'],
-              'name': 'Industrial Processes and Product Use'},
+        # '2': {'sources': ['2.A', '2.B', '2.C', '2.F', '2.H'],
+        #       'name': 'Industrial Processes and Product Use'},
         '3.A': {'sources': ['3.A.1', '3.A.2'], 'name': 'Livestock'},
         '3.C.1': {'sources': ['3.C.1.b', '3.C.1.c'],
                      'name': 'Emissions from biomass burning'},
@@ -384,6 +385,8 @@ cat_conversion = {
                              'Agriculture)'},
         'M.AG.ELV': {'sources': ['M.3.C.AG'], 'name': 'Agriculture excluding livestock'},
         '3': {'sources': ['M.AG', 'M.LULUCF'], 'name': 'AFOLU'},
+        'M.0.EL': {'sources': ['1', '2', 'M.AG', '4', '5'], 'name': 'National total '
+                                                                    'excluding LULUCF'},
     },
     'basket_copy': {
         'GWPs_to_add': ["AR4GWP100", "AR5GWP100", "AR6GWP100"],

+ 3 - 1
UNFCCC_GHG_data/helper/functions.py

@@ -1,3 +1,5 @@
+import copy
+
 import pycountry
 import json
 import re
@@ -114,7 +116,7 @@ def process_data_for_country(
         # remove timeseries if desired
         if 'remove_ts' in processing_info_country:
             for case in processing_info_country['remove_ts']:
-                remove_info = processing_info_country['remove_ts'][case]
+                remove_info = copy.deepcopy(processing_info_country['remove_ts'][case])
                 entities = remove_info.pop("entities")
                 for entity in entities:
                     data_country[entity].pr.loc[remove_info] = \