Browse Source

[DATALAD] Recorded changes

Daniel Busch 1 month ago
parent
commit
89adcbffe9

+ 1 - 0
conv_FAO_IPPCC2006_PRIMAP_CH4.csv

@@ -7,3 +7,4 @@ M.3.EF, 3.A.1, Enteric fermentation
 M.3.MM, 3.A.2, Manure Management
 6.A,3.C.1.a, FAO 6.A forest fires to IPCC 3.C.1.a Biomass burning in forest lands
 6.B,3.C.1.c, FAO 6.B savanna fires to IPCC 3.C.1.c Biomass burning in grasslands
+6.C, M.3.B.2.FOS, FAO 6.C Fires in organic soils to IPCC 3.B.3 cropland (fires in organic soils)

+ 3 - 3
conv_FAO_IPPCC2006_PRIMAP_CO2.csv

@@ -3,9 +3,9 @@
 FAO,IPCC2006_PRIMAP,comment
 4,3.B.1,Carbon stock change in forests
 4.B,M.NFC,Net Forest conversion
-5.A,3.B.3,FAO 5.A Drained grassland to IPCC 3.B.3 Grassland
+5.A,M.3.B.3.DOS,FAO 5.A Drained grassland to IPCC 3.B.3 Grassland (drained organic soils)
 5.B,M.3.B.2.DOS,FAO 5.B Drained cropland to IPCC 3.B.2 Cropland (drained organic soils)
-6.A,3.C.1.a, FAO 6.A forest fires to IPCC 3.C.1.a Biomass burning in forest lands
-6.B, 3.C.1.c, FAO 6.B savanna fires to IPCC 3.C.1.c Biomass burning in grasslands
+6.A,M.3.C.1.a, FAO 6.A forest fires to IPCC M.3.C.1.a Biomass burning in forest lands (M category because it is not contained in the 3.C.1 sum)
+6.B, M.3.C.1.c, FAO 6.B savanna fires to IPCC M.3.C.1.c Biomass burning in grasslands (M category because it is not contained in the 3.C.1 sum)
 6.C, M.3.B.2.FOS, FAO 6.C Fires in organic soils to IPCC 3.B.3 cropland (fires in organic soils)
 7.M + 7.A, 2.G, Manufacturing fertlisers and pesticides

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

@@ -1 +1 @@
-../../.git/annex/objects/z3/Mq/MD5E-s5980799--3043dd6bf8a609e041a5243794bcc826.csv/MD5E-s5980799--3043dd6bf8a609e041a5243794bcc826.csv
+../../.git/annex/objects/GJ/Z3/MD5E-s6065549--e0ce12dad1da8713b5b03b48321a54b8.csv/MD5E-s6065549--e0ce12dad1da8713b5b03b48321a54b8.csv

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

@@ -1 +1 @@
-../../.git/annex/objects/9g/Ff/MD5E-s1859181--f564c003c41b542bb3520e9151f85e16.nc/MD5E-s1859181--f564c003c41b542bb3520e9151f85e16.nc
+../../.git/annex/objects/jm/MK/MD5E-s1728952--5e26bf3a64fcda4e4e62073d1ffee66c.nc/MD5E-s1728952--5e26bf3a64fcda4e4e62073d1ffee66c.nc

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

@@ -1 +1 @@
-../../.git/annex/objects/20/P0/MD5E-s14450580--2e044a03684998487ff734df894273c1.nc/MD5E-s14450580--2e044a03684998487ff734df894273c1.nc
+../../.git/annex/objects/zM/X2/MD5E-s14597532--9ab0a8c13b665135e8876baf957da33f.nc/MD5E-s14597532--9ab0a8c13b665135e8876baf957da33f.nc

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

@@ -1 +1 @@
-../../.git/annex/objects/4m/5w/MD5E-s6104711--3aa09937e311620fd1a6e5f32e845935.csv/MD5E-s6104711--3aa09937e311620fd1a6e5f32e845935.csv
+../../.git/annex/objects/3z/XQ/MD5E-s6190399--16a342c6e944090d4d630915a7e6e4ff.csv/MD5E-s6190399--16a342c6e944090d4d630915a7e6e4ff.csv

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

@@ -1 +1 @@
-../../.git/annex/objects/V7/Q8/MD5E-s1885319--34b97929ef46e16f92251c442368df1c.nc/MD5E-s1885319--34b97929ef46e16f92251c442368df1c.nc
+../../.git/annex/objects/60/V5/MD5E-s1753492--894ac3cc25f273e8b476269a8ef0d164.nc/MD5E-s1753492--894ac3cc25f273e8b476269a8ef0d164.nc

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

@@ -1 +1 @@
-../../.git/annex/objects/Zm/QM/MD5E-s15105077--c6b011fcb6728c549b85b749f175e1cb.nc/MD5E-s15105077--c6b011fcb6728c549b85b749f175e1cb.nc
+../../.git/annex/objects/Jz/xQ/MD5E-s15356164--07fe672ce4b695d7cef28b8740d5fa88.nc/MD5E-s15356164--07fe672ce4b695d7cef28b8740d5fa88.nc

+ 9 - 8
src/faostat_data_primap/helper/category_aggregation.py

@@ -482,15 +482,15 @@ agg_info_ipcc2006_primap_CO2 = {
         "3.C.1": {  # Emissions from Biomass Burning
             "sources": [
                 # "3.C.1.a",  # Biomass Burning In Forest Lands, because not there in 2023 release
-                "3.C.1.b",  # Biomass Burning In Croplands
-                "3.C.1.c",  # Biomass Burning in Grasslands
+                # "3.C.1.b",  # Biomass Burning In Croplands - empty
+                "M.3.C.1.c",  # Biomass Burning in Grasslands - all zero
             ],
             "sel": {"variable": ["CO2"]},
         },
         "M.3.C.1.AG": {  # AG-related emissions from Biomass Burning
             "sources": [
                 # "3.C.1.b",  # Biomass Burning In Croplands
-                "3.C.1.c",  # Biomass Burning in Grasslands
+                "M.3.C.1.c",  # Biomass Burning in Grasslands
             ],
             "sel": {"variable": ["CO2"]},
         },
@@ -520,9 +520,9 @@ agg_info_ipcc2006_primap_CO2 = {
         "M.LULUCF": {
             "sources": [
                 "3.B.1",  # Carbon stock change in forests (FAO 4, or 4.A and 4.B)
-                "M.3.B.2.DOS",  # crop land - drained organic soils
-                "M.3.B.2.FOS",  # crop land - fires in organic soils
-                "3.B.3",  # grass land
+                "M.3.B.2.DOS",  # crop land - drained organic soils (FAO 5.B Drained cropland)
+                "M.3.B.2.FOS",  # crop land - fires in organic soils (6.C Fires in organic soils)
+                "M.3.B.3.DOS",  # grass land - drained organic soils (5.A Drained grassland)
             ],
             "sel": {"variable": ["CO2"]},
         },
@@ -629,9 +629,10 @@ agg_info_ipcc2006_primap_CH4 = {
         "M.LULUCF": {
             "sources": [
                 "3.B.1",  # Carbon stock change in forests
-                "3.B.2",  # Drained grassland
-                "3.B.3",  # Drained cropland
+                "3.B.2",  # Drained cropland
+                "3.B.3",  # Drained grassland
                 "3.C.1.a",  # Biomass Burning In Forests
+                "M.3.B.2.FOS",  # cropland (fires in organic soils)
             ],
             "sel": {"variable": ["CH4"]},
         },

+ 7 - 0
tests/unit/test_conversion.py

@@ -28,6 +28,13 @@ def test_processed_output_remains_the_same():
     # process raw data
     ds_processed_new = process(ds=ds_raw)
 
+    # filter by primap categories (sub-categories can change)
+    primap_sectors = ["3", "3.A", "M.AG", "M.AG.ELV", "M.LULUCF"]
+    ds_processed = ds_processed.loc[{"category (IPCC2006_PRIMAP)": primap_sectors}]
+    ds_processed_new = ds_processed_new.loc[
+        {"category (IPCC2006_PRIMAP)": primap_sectors}
+    ]
+
     # compare
     assert ds_processed.broadcast_equals(ds_processed_new)