Browse Source

downscaling 1 and 2

Daniel Busch 5 months ago
parent
commit
d5d3f88038

+ 47 - 0
src/unfccc_ghg_data/unfccc_reader/Cabo_Verde/config_cpv_bur1.py

@@ -255,6 +255,53 @@ country_processing_step1 = {
         "entities": ["HFCS"],
         "source_GWP": gwp_to_use,
     },
+    # "downscale": {
+    #     "sectors": {
+    #         "1.A": {
+    #             "basket": "1",
+    #             "basket_contents": ["1.A"],
+    #             "entities": ["CO2", "CH4", "N2O"],
+    #             "dim": f'category ({coords_terminologies["category"]})',
+    #         },
+    #         # "2_CO2" : {
+    #         #     "basket" : "2",
+    #         #     "basket_contents" : ["2.A", "2.B", "2.C", "2.D", "2.H"],
+    #         #     "entities" : ["CO2"],
+    #         #     "dim" : f'category ({coords_terminologies["category"]})',
+    #         # },
+    #         "2_CH4" : {
+    #             "basket" : "2",
+    #             "basket_contents" : ["2.A", "2.B", "2.C", "2.H"],
+    #             "entities" : ["CH4"],
+    #             "dim" : f'category ({coords_terminologies["category"]})',
+    #         },
+    #     },
+    # },
+}
+
+country_processing_step2 = {
+    "downscale": {
+        "sectors": {
+            "1.A": {
+                "basket": "1",
+                "basket_contents": ["1.A"],
+                "entities": ["CO2", "CH4", "N2O"],
+                "dim": f'category ({coords_terminologies["category"]})',
+            },
+            "2_CO2": {
+                "basket": "2",
+                "basket_contents": ["2.A", "2.B", "2.C", "2.D", "2.H"],
+                "entities": ["CO2"],
+                "dim": f'category ({coords_terminologies["category"]})',
+            },
+            # "2_CH4" : {
+            #     "basket" : "2",
+            #     "basket_contents" : ["2.A", "2.B", "2.C", "2.H"],
+            #     "entities" : ["CH4"],
+            #     "dim" : f'category ({coords_terminologies["category"]})',
+            # },
+        },
+    },
 }
 
 gas_baskets = {

+ 16 - 4
src/unfccc_ghg_data/unfccc_reader/Cabo_Verde/read_CPV_BUR1_from_pdf.py

@@ -19,6 +19,7 @@ from unfccc_ghg_data.unfccc_reader.Cabo_Verde.config_cpv_bur1 import (
     coords_value_mapping,
     coords_value_mapping_main,
     country_processing_step1,
+    country_processing_step2,
     filter_remove,
     gas_baskets,
     inv_conf,
@@ -265,7 +266,18 @@ if __name__ == "__main__":
     # # ###
 
     # create the gas baskets before aggregating the categories
-    data_proc_pm2_gas_baskets = process_data_for_country(
+    # data_proc_pm2_gas_baskets = process_data_for_country(
+    #     data_country=data_pm2,
+    #     entities_to_ignore=[],
+    #     gas_baskets=gas_baskets,
+    #     filter_dims=None,
+    #     cat_terminology_out=None,
+    #     category_conversion=None,
+    #     sectors_out=None,
+    #     processing_info_country=None,
+    # )
+
+    data_proc_pm2 = process_data_for_country(
         data_country=data_pm2,
         entities_to_ignore=[],
         gas_baskets=gas_baskets,
@@ -273,18 +285,18 @@ if __name__ == "__main__":
         cat_terminology_out=None,
         category_conversion=None,
         sectors_out=None,
-        processing_info_country=None,
+        processing_info_country=country_processing_step1,
     )
 
     data_proc_pm2 = process_data_for_country(
-        data_country=data_proc_pm2_gas_baskets,
+        data_country=data_proc_pm2,
         entities_to_ignore=[],
         gas_baskets=None,
         filter_dims=None,
         cat_terminology_out=None,
         category_conversion=None,
         sectors_out=None,
-        processing_info_country=country_processing_step1,
+        processing_info_country=country_processing_step2,
     )
 
     # # ###