Explorar el Código

F-gases conversion

Daniel Busch hace 5 meses
padre
commit
9a3330206c

+ 13 - 3
src/unfccc_ghg_data/unfccc_reader/Cabo_Verde/config_cpv_bur1.py

@@ -84,7 +84,12 @@ inv_conf_per_sector = {
             "Waste": "4",
         },
         "header": ["category", "entity", *trend_years],
-        "unit": ["Gg"] * 4 + ["Gg CO2eq"] + ["Gg"] * 9,
+        "unit": ["Gg"] * 4 + ["GgCO2eq"] + ["Gg"] * 9,
+        "unit_conversion": {
+            "index": 6,
+            "conversion_factor": 2240.625,
+        },
+        # "unit": ["Gg"] * 4 + ["Gg CO2eq"] + ["Gg"] * 9,
     },
     "int_bunkers": {
         "page": "39",
@@ -265,6 +270,8 @@ country_processing_step2 = {
                 "entities": ["CO2", "CH4", "N2O"],
                 "dim": f'category ({coords_terminologies["category"]})',
             },
+            # Values for 1995/2000/2005/2010/2015/2019 are only available for CO2 and F-gases (table 6)
+            #
             "2_CO2": {
                 "basket": "2",
                 "basket_contents": ["2.A", "2.B", "2.C", "2.D", "2.H"],
@@ -272,9 +279,8 @@ country_processing_step2 = {
                 "dim": f'category ({coords_terminologies["category"]})',
             },
             "2_KYOTO": {
-                "check_consistency": False,
                 "basket": "2",
-                "basket_contents": ["2.A", "2.B", "2.C", "2.H", "2.D"],
+                "basket_contents": ["2.A", "2.B", "2.C", "2.F", "2.H", "2.D"],
                 "entities": [
                     "KYOTOGHG (SARGWP100)",
                     "KYOTOGHG (AR4GWP100)",
@@ -288,6 +294,10 @@ country_processing_step2 = {
 }
 
 gas_baskets = {
+    "FGASES (SARGWP100)": ["HFCS (SARGWP100)"],
+    "FGASES (AR4GWP100)": ["HFCS (AR4GWP100)"],
+    "FGASES (AR5GWP100)": ["HFCS (AR5GWP100)"],
+    "FGASES (AR6GWP100)": ["HFCS (AR6GWP100)"],
     "KYOTOGHG (SARGWP100)": ["CO2", "CH4", "N2O", "FGASES (SARGWP100)"],
     "KYOTOGHG (AR4GWP100)": ["CO2", "CH4", "N2O", "FGASES (AR4GWP100)"],
     "KYOTOGHG (AR5GWP100)": ["CO2", "CH4", "N2O", "FGASES (AR5GWP100)"],

+ 10 - 0
src/unfccc_ghg_data/unfccc_reader/Cabo_Verde/read_CPV_BUR1_from_pdf.py

@@ -205,6 +205,16 @@ if __name__ == "__main__":
         if "entity" in inv_conf_per_sector[sector].keys():
             df_page["entity"] = inv_conf_per_sector[sector]["entity"]
 
+        if "unit_conversion" in inv_conf_per_sector[sector].keys():
+            for year in trend_years:
+                index = inv_conf_per_sector[sector]["unit_conversion"]["index"]
+                conv_factor = inv_conf_per_sector[sector]["unit_conversion"][
+                    "conversion_factor"
+                ]
+                df_page.loc[index, year] = str(
+                    conv_factor * float(df_page.loc[index, year])
+                )
+
         # stack the tables vertically
         if df_trend is None:
             df_trend = df_page