Browse Source

[DATALAD] Recorded changes

Daniel Busch 2 weeks ago
parent
commit
e4a07cabdb

+ 1 - 1
extracted_data/v2023-12-13/FAOSTAT_Agrifood_system_emissions_v2023-12-13.csv

@@ -1 +1 @@
-../../.git/annex/objects/84/Jg/MD5E-s6104450--9149191fea1c8852b3236979b2092381.csv/MD5E-s6104450--9149191fea1c8852b3236979b2092381.csv
+../../.git/annex/objects/wJ/Qz/MD5E-s6786511--4e3bed125b3c8c62f1807cc99cfeb9b0.csv/MD5E-s6786511--4e3bed125b3c8c62f1807cc99cfeb9b0.csv

+ 1 - 1
extracted_data/v2023-12-13/FAOSTAT_Agrifood_system_emissions_v2023-12-13.nc

@@ -1 +1 @@
-../../.git/annex/objects/kp/vK/MD5E-s2060452--58e83164882ea4c6c00edf632822fb8a.nc/MD5E-s2060452--58e83164882ea4c6c00edf632822fb8a.nc
+../../.git/annex/objects/JJ/Fq/MD5E-s2686436--b52272b1ccc9b7813ff7d1e183dfd3e4.nc/MD5E-s2686436--b52272b1ccc9b7813ff7d1e183dfd3e4.nc

+ 1 - 1
extracted_data/v2023-12-13/FAOSTAT_Agrifood_system_emissions_v2023-12-13_raw.csv

@@ -1 +1 @@
-../../.git/annex/objects/fw/GZ/MD5E-s34374190--768dde56e1c4fc7f81797b7b27af4974.csv/MD5E-s34374190--768dde56e1c4fc7f81797b7b27af4974.csv
+../../.git/annex/objects/q7/Mv/MD5E-s34801019--9acb9532afc6adf5872894eaca6ce46b.csv/MD5E-s34801019--9acb9532afc6adf5872894eaca6ce46b.csv

+ 1 - 1
extracted_data/v2023-12-13/FAOSTAT_Agrifood_system_emissions_v2023-12-13_raw.nc

@@ -1 +1 @@
-../../.git/annex/objects/gF/Qq/MD5E-s14547165--24cf0274bd2391c902b55a416ce18713.nc/MD5E-s14547165--24cf0274bd2391c902b55a416ce18713.nc
+../../.git/annex/objects/jW/p9/MD5E-s16364654--93d4cc1eac9d6c286140ed9e63af4a59.nc/MD5E-s16364654--93d4cc1eac9d6c286140ed9e63af4a59.nc

+ 1 - 1
extracted_data/v2024-11-14/FAOSTAT_Agrifood_system_emissions_v2024-11-14.csv

@@ -1 +1 @@
-../../.git/annex/objects/xK/xP/MD5E-s6236738--50418baa31366f55c691f7191c0edd4e.csv/MD5E-s6236738--50418baa31366f55c691f7191c0edd4e.csv
+../../.git/annex/objects/GW/31/MD5E-s6929996--ee3e64f38db3308eab799e01e5929495.csv/MD5E-s6929996--ee3e64f38db3308eab799e01e5929495.csv

+ 1 - 1
extracted_data/v2024-11-14/FAOSTAT_Agrifood_system_emissions_v2024-11-14.nc

@@ -1 +1 @@
-../../.git/annex/objects/zF/0v/MD5E-s2312541--e26a340a34dd26f6e0ecc1fc9a054995.nc/MD5E-s2312541--e26a340a34dd26f6e0ecc1fc9a054995.nc
+../../.git/annex/objects/81/j9/MD5E-s2717339--1402852174ce728318f3cadebb60aa94.nc/MD5E-s2717339--1402852174ce728318f3cadebb60aa94.nc

+ 1 - 1
extracted_data/v2024-11-14/FAOSTAT_Agrifood_system_emissions_v2024-11-14_raw.csv

@@ -1 +1 @@
-../../.git/annex/objects/2Z/6J/MD5E-s34497846--b63b101b17be9b087c2da0ecc314cae6.csv/MD5E-s34497846--b63b101b17be9b087c2da0ecc314cae6.csv
+../../.git/annex/objects/KG/q2/MD5E-s34954660--b52d348a4b32c5dbf57fd8f7ffdfb9ad.csv/MD5E-s34954660--b52d348a4b32c5dbf57fd8f7ffdfb9ad.csv

+ 1 - 1
extracted_data/v2024-11-14/FAOSTAT_Agrifood_system_emissions_v2024-11-14_raw.nc

@@ -1 +1 @@
-../../.git/annex/objects/8X/PP/MD5E-s15324811--6fa001f28131894516b9ef9de70fa7d9.nc/MD5E-s15324811--6fa001f28131894516b9ef9de70fa7d9.nc
+../../.git/annex/objects/vJ/wJ/MD5E-s15617067--80546fa9cfe796e420c506fa0cc7dc67.nc/MD5E-s15617067--80546fa9cfe796e420c506fa0cc7dc67.nc

+ 20 - 5
src/faostat_data_primap/helper/category_aggregation.py

@@ -354,6 +354,22 @@ agg_info_fao = {
             ],
             "sel": {"variable": ["N2O", "CH4"]},
         },
+        "M.3.MA": {
+            "tolerance": 1,
+            "sources": [
+                "M.3.MA.direct",
+                "M.3.MA.indirect",
+            ],
+            "sel": {"variable": ["N2O"]},
+        },
+        "M.3.MP": {
+            "tolerance": 1,
+            "sources": [
+                "M.3.MP.direct",
+                "M.3.MP.indirect",
+            ],
+            "sel": {"variable": ["N2O"]},
+        },
         "4": {
             "tolerance": 0.01,
             "sources": [
@@ -423,9 +439,9 @@ agg_info_ipcc2006_primap_N2O = {
             # direct emissions. In does not make a difference for the primap-hist sectors,
             # but TODO direct / indirect should be mapped individually
             "sources": [
-                "M.3.C.45.MP",  # Direct and indirect emissions from manure left on pasture (FAO M.3.MP)
-                "M.3.C.45.MA",  # Direct and indirect emissions from manure applied to soils (FAO M.3.MA)
                 "M.3.C.4.CR",  # Direct emissions from crop residues (FAO M.1.CR.direct),
+                "M.3.C.4.MP",  # Direct emissions from manure left on pasture (FAO M.3.MP.direct)
+                "M.3.C.4.MA",  # Direct emissions from manure applied to soils (FAO M.3.MA.direct)
                 "3.C.4.a",  # synthetic fertilisers direct (FAO 1.B.1)
                 "M.3.C.4.DOS.CL",  # Drained cropland (FAO 5.A drained cropland)
                 "M.3.C.4.DOS.GL",  # Drained grassland (FAO 5.B drained grassland)
@@ -434,11 +450,10 @@ agg_info_ipcc2006_primap_N2O = {
         },
         "3.C.5": {  # Indirect N2O Emissions from Managed Soils
             "sources": [
-                # Similarly to 3.C.4, 3.C.5 does not accurately represent the IPCC categories
-                # There should be only indirect emissions in this category, but we only have direct and indirect combined,
-                # except for "M.3.C.5.SF", "M.3.C.5.CR" which are only indirect
                 "M.3.C.5.SF",  # synthetic fertilisers indirect - there is no IPCC sub-category for this
                 "M.3.C.5.CR",  # Indirect emissions from crop residues (FAO M.1.CR.indirect)
+                "M.3.C.5.MP",  # Indirect emissions from manure left on pasture (FAO M.3.MP.indirect)
+                "M.3.C.5.MA",  # Indirect emissions from manure applied to soils (FAO M.3.MA.indirect)
             ],
             "sel": {"variable": ["N2O"]},
         },

+ 16 - 22
src/faostat_data_primap/helper/definitions.py

@@ -492,6 +492,10 @@ read_config_all: Any = {
                 "All Animals - Manure management (Emissions N2O)": "M.3.MM",
                 "All Animals - Manure left on pasture (Emissions N2O)": "M.3.MP",
                 "All Animals - Emissions (N2O) (Manure applied)": "M.3.MA",
+                "All Animals - Manure left on pasture (Direct emissions N2O)": "M.3.MP.direct",
+                "All Animals - Manure left on pasture (Indirect emissions N2O)": "M.3.MP.indirect",
+                "All Animals - Manure applied to soils (Direct emissions N2O)": "M.3.MA.direct",
+                "All Animals - Manure applied to soils (Indirect emissions N2O)": "M.3.MA.indirect",
             },
             "category_mapping_item": {
                 "All Animals": "3",
@@ -537,7 +541,7 @@ read_config_all: Any = {
                 "Manure applied to soils (Indirect emissions N2O)": ".3.b",
             },
             "items-elements_to_remove": [
-                "All Animals - Manure left on pasture (Direct emissions N2O)",
+                # "All Animals - Manure left on pasture (Direct emissions N2O)",
                 (
                     "All Animals - Indirect emissions (N2O that leaches) "
                     "(Manure on pasture)"
@@ -546,21 +550,16 @@ read_config_all: Any = {
                     "All Animals - Indirect emissions (N2O that volatilises) "
                     "(Manure on pasture)"
                 ),
-                "All Animals - Manure left on pasture (Indirect emissions N2O)",
-                "All Animals - Manure applied to soils (Direct emissions N2O)",
+                # "All Animals - Manure left on pasture (Indirect emissions N2O)",
+                # "All Animals - Manure applied to soils (Direct emissions N2O)",
                 "All Animals - Indirect emissions (N2O that leaches) (Manure applied)",
                 (
                     "All Animals - Indirect emissions (N2O that volatilises) "
                     "(Manure applied)"
                 ),
-                "All Animals - Manure applied to soils (Indirect emissions N2O)",
+                # "All Animals - Manure applied to soils (Indirect emissions N2O)",
                 "All Animals - Manure management (Direct emissions N2O)",
                 "All Animals - Manure management (Indirect emissions N2O)",
-                # "All Animals - Enteric fermentation (Emissions CH4)",
-                # "All Animals - Manure management (Emissions CH4)",
-                # "All Animals - Manure management (Emissions N2O)",
-                # "All Animals - Manure left on pasture (Emissions N2O)",
-                # "All Animals - Emissions (N2O) (Manure applied)",
             ],
             "columns_to_drop": [
                 "Element",
@@ -631,6 +630,10 @@ read_config_all: Any = {
                 "All Animals - Manure management (Emissions N2O)": "M.3.MM",
                 "All Animals - Manure left on pasture (Emissions N2O)": "M.3.MP",
                 "All Animals - Emissions (N2O) (Manure applied)": "M.3.MA",
+                "All Animals - Manure left on pasture (Direct emissions N2O)": "M.3.MP.direct",
+                "All Animals - Manure left on pasture (Indirect emissions N2O)": "M.3.MP.indirect",
+                "All Animals - Manure applied to soils (Direct emissions N2O)": "M.3.MA.direct",
+                "All Animals - Manure applied to soils (Indirect emissions N2O)": "M.3.MA.indirect",
             },
             "category_mapping_item": {
                 "All Animals": "3",
@@ -676,7 +679,7 @@ read_config_all: Any = {
                 "Manure applied to soils (Indirect emissions N2O)": ".3.b",
             },
             "items-elements_to_remove": [
-                "All Animals - Manure left on pasture (Direct emissions N2O)",
+                # "All Animals - Manure left on pasture (Direct emissions N2O)",
                 (
                     "All Animals - Indirect emissions (N2O that leaches) "
                     "(Manure on pasture)"
@@ -685,21 +688,16 @@ read_config_all: Any = {
                     "All Animals - Indirect emissions (N2O that volatilises) "
                     "(Manure on pasture)"
                 ),
-                "All Animals - Manure left on pasture (Indirect emissions N2O)",
-                "All Animals - Manure applied to soils (Direct emissions N2O)",
+                # "All Animals - Manure left on pasture (Indirect emissions N2O)",
+                # "All Animals - Manure applied to soils (Direct emissions N2O)",
                 "All Animals - Indirect emissions (N2O that leaches) (Manure applied)",
                 (
                     "All Animals - Indirect emissions (N2O that volatilises) "
                     "(Manure applied)"
                 ),
-                "All Animals - Manure applied to soils (Indirect emissions N2O)",
+                # "All Animals - Manure applied to soils (Indirect emissions N2O)",
                 "All Animals - Manure management (Direct emissions N2O)",
                 "All Animals - Manure management (Indirect emissions N2O)",
-                # "All Animals - Enteric fermentation (Emissions CH4)",
-                # "All Animals - Manure management (Emissions CH4)",
-                # "All Animals - Manure management (Emissions N2O)",
-                # "All Animals - Manure left on pasture (Emissions N2O)",
-                # "All Animals - Emissions (N2O) (Manure applied)",
             ],
             "columns_to_drop": [
                 "Element",
@@ -858,8 +856,6 @@ read_config_all: Any = {
             "filename": "Emissions_Drained_Organic_Soils_E_All_Data_NOFLAG.csv",
             "areas_to_remove": [
                 *areas_to_remove_base,
-                # "Belgium-Luxembourg",
-                # "Serbia and Montenegro",
                 "European Union (27)",
             ],
             "elements_to_remove": [
@@ -893,8 +889,6 @@ read_config_all: Any = {
             "filename": "Emissions_Drained_Organic_Soils_E_All_Data_NOFLAG.csv",
             "areas_to_remove": [
                 *areas_to_remove_base,
-                # "Belgium-Luxembourg",
-                # "Serbia and Montenegro",
                 "European Union (27)",
             ],
             "elements_to_remove": [