Browse Source

Merge pull request #104 from JGuetschow/CCPI_nAI_2024

Merge fixed data and code
Johannes Gütschow 4 months ago
parent
commit
7477951c8f
28 changed files with 121 additions and 56 deletions
  1. 3 1
      downloaded_data/non-UNFCCC/folder_mapping.json
  2. 1 1
      extracted_data/UNFCCC/Australia/AUS_CRT1_12042024.csv
  3. 1 1
      extracted_data/UNFCCC/Australia/AUS_CRT1_12042024.nc
  4. 4 4
      extracted_data/UNFCCC/Australia/AUS_CRT1_12042024.yaml
  5. 1 1
      extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC1996_KOR_INV.nc
  6. 2 2
      extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC1996_KOR_INV.yaml
  7. 1 1
      extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC2006_PRIMAP.csv
  8. 1 1
      extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC2006_PRIMAP.nc
  9. 3 3
      extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC2006_PRIMAP.yaml
  10. 1 1
      extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_CRF2013_2023.nc
  11. 2 2
      extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_CRF2013_2023.yaml
  12. 1 1
      extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_IPCC2006_PRIMAP.csv
  13. 1 1
      extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_IPCC2006_PRIMAP.nc
  14. 4 4
      extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_IPCC2006_PRIMAP.yaml
  15. 1 1
      extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_CRF2013_2023.csv
  16. 1 1
      extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_CRF2013_2023.nc
  17. 1 1
      extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_IPCC2006_PRIMAP.csv
  18. 1 1
      extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_IPCC2006_PRIMAP.nc
  19. 2 2
      extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_IPCC2006_PRIMAP.yaml
  20. 3 1
      extracted_data/non-UNFCCC/folder_mapping.json
  21. 1 1
      src/unfccc_ghg_data/unfccc_crf_reader/crf_specifications/crt1_specification.py
  22. 28 6
      src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_core.py
  23. 1 0
      src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_devel.py
  24. 1 0
      src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_prod.py
  25. 8 0
      src/unfccc_ghg_data/unfccc_reader/Republic_of_Korea/config_KOR_INV2023.py
  26. 2 1
      src/unfccc_ghg_data/unfccc_reader/Republic_of_Korea/read_KOR_2023_Inventory_from_xlsx.py
  27. 40 15
      src/unfccc_ghg_data/unfccc_reader/United_Kingdom/config_uk_inv2024.py
  28. 5 2
      src/unfccc_ghg_data/unfccc_reader/United_States_of_America/config_usa_inv2024.py

+ 3 - 1
downloaded_data/non-UNFCCC/folder_mapping.json

@@ -1,7 +1,9 @@
 {
 {
     "CHL": "Chile",
     "CHL": "Chile",
+    "GBR": "United_Kingdom_of_Great_Britain_and_Northern_Ireland",
     "JPN": "Japan",
     "JPN": "Japan",
     "KOR": "Republic_of_Korea",
     "KOR": "Republic_of_Korea",
     "PSE": "PSE",
     "PSE": "PSE",
-    "TWN": "Taiwan"
+    "TWN": "Taiwan",
+    "USA": "United_States_of_America"
 }
 }

+ 1 - 1
extracted_data/UNFCCC/Australia/AUS_CRT1_12042024.csv

@@ -1 +1 @@
-../../../.git/annex/objects/6g/qp/MD5E-s1237117--9b409343319c889adfa1eebbf976c80f.csv/MD5E-s1237117--9b409343319c889adfa1eebbf976c80f.csv
+../../../.git/annex/objects/m6/50/MD5E-s1237112--bf392a60946fc13ebbbf142a1b837b1f.csv/MD5E-s1237112--bf392a60946fc13ebbbf142a1b837b1f.csv

+ 1 - 1
extracted_data/UNFCCC/Australia/AUS_CRT1_12042024.nc

@@ -1 +1 @@
-../../../.git/annex/objects/zw/f1/MD5E-s1733750--36e2ec46100726445fc8a904b3021a6f.nc/MD5E-s1733750--36e2ec46100726445fc8a904b3021a6f.nc
+../../../.git/annex/objects/Pp/z6/MD5E-s1733435--23efa42b84ac3a2f2cbe5d3206dd6038.nc/MD5E-s1733435--23efa42b84ac3a2f2cbe5d3206dd6038.nc

+ 4 - 4
extracted_data/UNFCCC/Australia/AUS_CRT1_12042024.yaml

@@ -6,7 +6,7 @@ attrs:
     Australia. Submission date: 12042024'
     Australia. Submission date: 12042024'
   comment: Read fom xlsx file by Johannes Gütschow
   comment: Read fom xlsx file by Johannes Gütschow
   institution: United Nations Framework Convention on Climate Change (www.unfccc.int)
   institution: United Nations Framework Convention on Climate Change (www.unfccc.int)
-  cat: category (CRF2013_1)
+  cat: category (CRT1)
   area: area (ISO3)
   area: area (ISO3)
   scen: scenario (PRIMAP)
   scen: scenario (PRIMAP)
   sec_cats:
   sec_cats:
@@ -15,12 +15,12 @@ time_format: '%Y'
 dimensions:
 dimensions:
   '*':
   '*':
   - time
   - time
-  - category (CRF2013_1)
+  - category (CRT1)
+  - source
+  - scenario (PRIMAP)
   - provenance
   - provenance
   - area (ISO3)
   - area (ISO3)
-  - scenario (PRIMAP)
   - class
   - class
-  - source
   - entity
   - entity
   - unit
   - unit
 data_file: AUS_CRT1_12042024.csv
 data_file: AUS_CRT1_12042024.csv

+ 1 - 1
extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC1996_KOR_INV.nc

@@ -1 +1 @@
-../../../.git/annex/objects/7K/3K/MD5E-s117632--8f3007f68ca3e257a788b3046e15af33.nc/MD5E-s117632--8f3007f68ca3e257a788b3046e15af33.nc
+../../../.git/annex/objects/8J/62/MD5E-s117632--bf1de1512275209e40f8006ea8c3339a.nc/MD5E-s117632--bf1de1512275209e40f8006ea8c3339a.nc

+ 2 - 2
extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC1996_KOR_INV.yaml

@@ -14,11 +14,11 @@ time_format: '%Y'
 dimensions:
 dimensions:
   '*':
   '*':
   - time
   - time
-  - provenance
-  - source
   - category (IPCC1996_KOR_INV)
   - category (IPCC1996_KOR_INV)
+  - provenance
   - scenario (PRIMAP)
   - scenario (PRIMAP)
   - area (ISO3)
   - area (ISO3)
+  - source
   - entity
   - entity
   - unit
   - unit
 data_file: KOR_2023-Inventory_2023_IPCC1996_KOR_INV.csv
 data_file: KOR_2023-Inventory_2023_IPCC1996_KOR_INV.csv

+ 1 - 1
extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC2006_PRIMAP.csv

@@ -1 +1 @@
-../../../.git/annex/objects/3X/Vq/MD5E-s415722--0cf26a164e61929468bf53f1fb383a8a.csv/MD5E-s415722--0cf26a164e61929468bf53f1fb383a8a.csv
+../../../.git/annex/objects/3F/VM/MD5E-s451700--f18735bb83e6445db263675be4fdf4e1.csv/MD5E-s451700--f18735bb83e6445db263675be4fdf4e1.csv

+ 1 - 1
extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC2006_PRIMAP.nc

@@ -1 +1 @@
-../../../.git/annex/objects/gV/6v/MD5E-s215604--02e1b627fb3762f88de0df1dd2318fc6.nc/MD5E-s215604--02e1b627fb3762f88de0df1dd2318fc6.nc
+../../../.git/annex/objects/VW/QX/MD5E-s245142--008391910325e0004106a8554c1be94e.nc/MD5E-s245142--008391910325e0004106a8554c1be94e.nc

+ 3 - 3
extracted_data/non-UNFCCC/Republic_of_Korea/KOR_2023-Inventory_2023_IPCC2006_PRIMAP.yaml

@@ -4,8 +4,8 @@ attrs:
   rights: ''
   rights: ''
   contact: mail@johannes-guetschow.de
   contact: mail@johannes-guetschow.de
   title: 'Republic of Korea: National Greenhouse Gas Inventory Report 2023 Processed
   title: 'Republic of Korea: National Greenhouse Gas Inventory Report 2023 Processed
-    on 2024-06-07'
-  comment: Read fom xlsx file by Johannes Gütschow Processed on 2024-06-07
+    on 2024-08-22'
+  comment: Read fom xlsx file by Johannes Gütschow Processed on 2024-08-22
   institution: Republic of Korea, Ministry of Environment, Greenhouse Gas Inventory
   institution: Republic of Korea, Ministry of Environment, Greenhouse Gas Inventory
     and Research Center
     and Research Center
   cat: category (IPCC2006_PRIMAP)
   cat: category (IPCC2006_PRIMAP)
@@ -16,10 +16,10 @@ dimensions:
   '*':
   '*':
   - time
   - time
   - provenance
   - provenance
-  - source
   - scenario (PRIMAP)
   - scenario (PRIMAP)
   - area (ISO3)
   - area (ISO3)
   - category (IPCC2006_PRIMAP)
   - category (IPCC2006_PRIMAP)
+  - source
   - entity
   - entity
   - unit
   - unit
 data_file: KOR_2023-Inventory_2023_IPCC2006_PRIMAP.csv
 data_file: KOR_2023-Inventory_2023_IPCC2006_PRIMAP.csv

+ 1 - 1
extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_CRF2013_2023.nc

@@ -1 +1 @@
-../../../.git/annex/objects/KQ/WV/MD5E-s124043--373eee21639db07acfaf2e7dc5c4c256.nc/MD5E-s124043--373eee21639db07acfaf2e7dc5c4c256.nc
+../../../.git/annex/objects/8g/MZ/MD5E-s124043--f5520c724fcf2277edadbc77d68d0002.nc/MD5E-s124043--f5520c724fcf2277edadbc77d68d0002.nc

+ 2 - 2
extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_CRF2013_2023.yaml

@@ -12,11 +12,11 @@ time_format: '%Y'
 dimensions:
 dimensions:
   '*':
   '*':
   - time
   - time
-  - source
   - area (ISO3)
   - area (ISO3)
+  - source
+  - scenario (PRIMAP)
   - provenance
   - provenance
   - category (CRF2013_2023)
   - category (CRF2013_2023)
-  - scenario (PRIMAP)
   - entity
   - entity
   - unit
   - unit
 data_file: GBR_2024-Inventory_CRF2013_2023.csv
 data_file: GBR_2024-Inventory_CRF2013_2023.csv

+ 1 - 1
extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_IPCC2006_PRIMAP.csv

@@ -1 +1 @@
-../../../.git/annex/objects/kJ/xW/MD5E-s1019513--a0065c926c456f319e1562ea49a0fd90.csv/MD5E-s1019513--a0065c926c456f319e1562ea49a0fd90.csv
+../../../.git/annex/objects/17/QV/MD5E-s1034166--2d2d4e3c9917d470583710e1ec36c9ce.csv/MD5E-s1034166--2d2d4e3c9917d470583710e1ec36c9ce.csv

+ 1 - 1
extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_IPCC2006_PRIMAP.nc

@@ -1 +1 @@
-../../../.git/annex/objects/2z/ff/MD5E-s492947--0ab97e850f31fa6bf031f241dc59e836.nc/MD5E-s492947--0ab97e850f31fa6bf031f241dc59e836.nc
+../../../.git/annex/objects/1G/Qk/MD5E-s492425--e020a2a63d8ae807d8c4939b8b0ae99e.nc/MD5E-s492425--e020a2a63d8ae807d8c4939b8b0ae99e.nc

+ 4 - 4
extracted_data/non-UNFCCC/United_Kingdom/GBR_2024-Inventory_IPCC2006_PRIMAP.yaml

@@ -2,8 +2,8 @@ attrs:
   references: https://naei.beis.gov.uk/reports/reports?report_id=1140
   references: https://naei.beis.gov.uk/reports/reports?report_id=1140
   rights: ''
   rights: ''
   contact: mail@johannes-guetschow.de
   contact: mail@johannes-guetschow.de
-  title: Devolved Administration GHG Inventory 1990-2022 Processed on 2024-07-31
-  comment: Read fom xlsx file by Johannes Gütschow Processed on 2024-07-31
+  title: Devolved Administration GHG Inventory 1990-2022 Processed on 2024-08-08
+  comment: Read fom xlsx file by Johannes Gütschow Processed on 2024-08-08
   institution: National Atmospheric Emissions Inventory (United Kingdom)
   institution: National Atmospheric Emissions Inventory (United Kingdom)
   cat: category (IPCC2006_PRIMAP)
   cat: category (IPCC2006_PRIMAP)
   area: area (ISO3)
   area: area (ISO3)
@@ -14,11 +14,11 @@ time_format: '%Y'
 dimensions:
 dimensions:
   '*':
   '*':
   - time
   - time
-  - source
   - area (ISO3)
   - area (ISO3)
+  - source
+  - scenario (PRIMAP)
   - provenance
   - provenance
   - category (IPCC2006_PRIMAP)
   - category (IPCC2006_PRIMAP)
-  - scenario (PRIMAP)
   - entity
   - entity
   - unit
   - unit
 data_file: GBR_2024-Inventory_IPCC2006_PRIMAP.csv
 data_file: GBR_2024-Inventory_IPCC2006_PRIMAP.csv

+ 1 - 1
extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_CRF2013_2023.csv

@@ -1 +1 @@
-../../../.git/annex/objects/WG/QQ/MD5E-s36036--4efe0e848709275b585f7b54e59620b9.csv/MD5E-s36036--4efe0e848709275b585f7b54e59620b9.csv
+../../../.git/annex/objects/qg/Zm/MD5E-s36037--27c21556b928cbba4da96fb106423f12.csv/MD5E-s36037--27c21556b928cbba4da96fb106423f12.csv

+ 1 - 1
extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_CRF2013_2023.nc

@@ -1 +1 @@
-../../../.git/annex/objects/Fz/5K/MD5E-s83273--591a6e661f9cc1db3f57180e296eba86.nc/MD5E-s83273--591a6e661f9cc1db3f57180e296eba86.nc
+../../../.git/annex/objects/qj/2G/MD5E-s73747--b1f624953fb4b0cda4cf7e3fab42de3f.nc/MD5E-s73747--b1f624953fb4b0cda4cf7e3fab42de3f.nc

+ 1 - 1
extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_IPCC2006_PRIMAP.csv

@@ -1 +1 @@
-../../../.git/annex/objects/mK/WM/MD5E-s331636--3388d98406c5db9dcf6d6a31ec4f1e8b.csv/MD5E-s331636--3388d98406c5db9dcf6d6a31ec4f1e8b.csv
+../../../.git/annex/objects/K9/qM/MD5E-s330096--0c40311c7fb74091ab89c931a975ca01.csv/MD5E-s330096--0c40311c7fb74091ab89c931a975ca01.csv

+ 1 - 1
extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_IPCC2006_PRIMAP.nc

@@ -1 +1 @@
-../../../.git/annex/objects/qj/Q7/MD5E-s230309--a47abff0125233c321323a9ceb41319e.nc/MD5E-s230309--a47abff0125233c321323a9ceb41319e.nc
+../../../.git/annex/objects/fM/v2/MD5E-s225399--fbfb645335b9328280775ea0a502134b.nc/MD5E-s225399--fbfb645335b9328280775ea0a502134b.nc

+ 2 - 2
extracted_data/non-UNFCCC/United_States_of_America/USA_2024-Inventory_IPCC2006_PRIMAP.yaml

@@ -4,8 +4,8 @@ attrs:
   rights: ''
   rights: ''
   contact: johannes.guetschow@climate-resource.com
   contact: johannes.guetschow@climate-resource.com
   title: 'Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2022 Processed
   title: 'Inventory of U.S. Greenhouse Gas Emissions and Sinks: 1990-2022 Processed
-    on 2024-08-06'
-  comment: Read fom csv files by Johannes Gütschow Processed on 2024-08-06
+    on 2024-08-08'
+  comment: Read fom csv files by Johannes Gütschow Processed on 2024-08-08
   institution: United States Environmental Protection Agency
   institution: United States Environmental Protection Agency
   cat: category (IPCC2006_PRIMAP)
   cat: category (IPCC2006_PRIMAP)
   area: area (ISO3)
   area: area (ISO3)

+ 3 - 1
extracted_data/non-UNFCCC/folder_mapping.json

@@ -1,5 +1,7 @@
 {
 {
+    "GBR": "United_Kingdom",
     "JPN": "Japan",
     "JPN": "Japan",
     "KOR": "Republic_of_Korea",
     "KOR": "Republic_of_Korea",
-    "TWN": "Taiwan"
+    "TWN": "Taiwan",
+    "USA": "United_States_of_America"
 }
 }

+ 1 - 1
src/unfccc_ghg_data/unfccc_crf_reader/crf_specifications/crt1_specification.py

@@ -837,7 +837,7 @@ CRT1 = {
             ["1.B.2.a.vi. Other", ["1.B.2.a.6"], 1],
             ["1.B.2.a.vi. Other", ["1.B.2.a.6"], 1],
             ["Drop down list:", ["\\IGNORE"], 2],
             ["Drop down list:", ["\\IGNORE"], 2],
             ["1.B.2.a.vi.1. Abandoned wells", ["1.B.2.a.6.1"], 2],
             ["1.B.2.a.vi.1. Abandoned wells", ["1.B.2.a.6.1"], 2],
-            ["1.B.2.a.vi.2. Other (please specify)", ["1.B.1.a.6.2"], 2],
+            ["1.B.2.a.vi.2. Other (please specify)", ["1.B.2.a.6.2"], 2],
             ["NA", ["\\IGNORE"], 3],
             ["NA", ["\\IGNORE"], 3],
             ["1.B.2.b. Natural gas", ["1.B.2.b"], 0],
             ["1.B.2.b. Natural gas", ["1.B.2.b"], 0],
             ["1.B.2.b.i. Exploration", ["1.B.2.b.1"], 1],
             ["1.B.2.b.i. Exploration", ["1.B.2.b.1"], 1],

+ 28 - 6
src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_core.py

@@ -37,6 +37,7 @@ def convert_crf_table_to_pm2if(  # noqa: PLR0913
     filter_remove_input: dict[str, dict[str, str | list]] | None = None,
     filter_remove_input: dict[str, dict[str, str | list]] | None = None,
     filter_keep_input: dict[str, dict[str, str | list]] | None = None,
     filter_keep_input: dict[str, dict[str, str | list]] | None = None,
     meta_data_input: dict[str, str] | None = None,
     meta_data_input: dict[str, str] | None = None,
+    type: str = "CRF",
 ) -> pd.DataFrame:
 ) -> pd.DataFrame:
     """
     """
     Convert a given pandas long format crf table to PRIMAP2 interchange format
     Convert a given pandas long format crf table to PRIMAP2 interchange format
@@ -60,6 +61,8 @@ def convert_crf_table_to_pm2if(  # noqa: PLR0913
     meta_data_input: Optional[Dict[str,str]]
     meta_data_input: Optional[Dict[str,str]]
         Meta data information. If values filled by this function automatically
         Meta data information. If values filled by this function automatically
         are given as input the automatic values are overwritten.
         are given as input the automatic values are overwritten.
+    type: str default = "CRF"
+        read CRF or CRF data
 
 
     Returns
     Returns
     -------
     -------
@@ -67,6 +70,10 @@ def convert_crf_table_to_pm2if(  # noqa: PLR0913
         Pandas DataFrame containing the data in PRIMAP2 interchange format
         Pandas DataFrame containing the data in PRIMAP2 interchange format
         Metadata is stored as attrs in the DataFrame
         Metadata is stored as attrs in the DataFrame
     """
     """
+    # check type
+    if type not in ["CRF", "CRT"]:
+        raise ValueError("Type must be CRF or CRT")  # noqa: TRY003
+
     coords_cols = {
     coords_cols = {
         "category": "category",
         "category": "category",
         "entity": "entity",
         "entity": "entity",
@@ -76,21 +83,37 @@ def convert_crf_table_to_pm2if(  # noqa: PLR0913
         "data": "data",
         "data": "data",
     }
     }
 
 
+    # set scenario and terminologies
+    if type == "CRF":
+        category_terminology = f"CRF2013_{submission_year}"
+        class_terminology = "CRF2013"
+        scenario = f"CRF{submission_year}"
+        title = f"Data submitted in {submission_year} to the UNFCCC in the common "
+        "reporting format (CRF)"
+    else:
+        category_terminology = f"CRT{submission_year}"
+        class_terminology = f"CRT{submission_year}"
+        scenario = f"CRT{submission_year}"
+        title = (
+            f"Data submitted in {submission_year} to the UNFCCC using the "
+            f"common reporting tables (CRT)"
+        )
+
     add_coords_cols = {
     add_coords_cols = {
         #    "orig_cat_name": ["orig_cat_name", "category"],
         #    "orig_cat_name": ["orig_cat_name", "category"],
     }
     }
-
+    # TODO: fix this for CRT
     coords_terminologies = {
     coords_terminologies = {
         "area": "ISO3",
         "area": "ISO3",
-        "category": f"CRF2013_{submission_year}",
+        "category": category_terminology,
         "scenario": "PRIMAP",
         "scenario": "PRIMAP",
-        "class": "CRF2013",
+        "class": class_terminology,
     }
     }
 
 
     coords_defaults = {
     coords_defaults = {
         "source": "UNFCCC",
         "source": "UNFCCC",
         "provenance": "measured",
         "provenance": "measured",
-        "scenario": f"CRF{submission_year}",
+        "scenario": scenario,
     }
     }
     if coords_defaults_input is not None:
     if coords_defaults_input is not None:
         for key in coords_defaults_input.keys():
         for key in coords_defaults_input.keys():
@@ -125,8 +148,7 @@ def convert_crf_table_to_pm2if(  # noqa: PLR0913
         f"{submission_year}",
         f"{submission_year}",
         "rights": "",
         "rights": "",
         "contact": "mail@johannes-guetschow.de",
         "contact": "mail@johannes-guetschow.de",
-        "title": f"Data submitted in {submission_year} to the UNFCCC in the common "
-        f"reporting format (CRF)",
+        "title": title,
         "comment": "Read fom xlsx file by Johannes Gütschow",
         "comment": "Read fom xlsx file by Johannes Gütschow",
         "institution": "United Nations Framework Convention on Climate Change "
         "institution": "United Nations Framework Convention on Climate Change "
         "(www.unfccc.int)",
         "(www.unfccc.int)",

+ 1 - 0
src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_devel.py

@@ -180,6 +180,7 @@ def read_year_to_test_specs(  # noqa: PLR0912, PLR0915
                             f"Submission date: {submission_date}"
                             f"Submission date: {submission_date}"
                         },
                         },
                         entity_mapping=entity_mapping,
                         entity_mapping=entity_mapping,
+                        type=type,
                     )
                     )
 
 
                     # now convert to native PRIMAP2 format
                     # now convert to native PRIMAP2 format

+ 1 - 0
src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_prod.py

@@ -177,6 +177,7 @@ def read_crf_for_country(  # noqa: PLR0912, PLR0915
                     f"Submission date: {submission_date}"
                     f"Submission date: {submission_date}"
                 },
                 },
                 entity_mapping=entity_mapping,
                 entity_mapping=entity_mapping,
+                type=type,
             )
             )
 
 
             # now convert to native PRIMAP2 format
             # now convert to native PRIMAP2 format

+ 8 - 0
src/unfccc_ghg_data/unfccc_reader/Republic_of_Korea/config_KOR_INV2023.py

@@ -616,3 +616,11 @@ filter_remove_after_agg = {
         "category (IPCC2006_PRIMAP)": ["2.E_1", "2.E_2"],
         "category (IPCC2006_PRIMAP)": ["2.E_1", "2.E_2"],
     },
     },
 }
 }
+
+processing_info_country_basket_copy = {
+    "basket_copy": {
+        "GWPs_to_add": ["AR4GWP100", "AR4GWP100", "AR6GWP100"],
+        "entities": ["HFCS", "PFCS"],
+        "source_GWP": "SARGWP100",
+    }
+}

+ 2 - 1
src/unfccc_ghg_data/unfccc_reader/Republic_of_Korea/read_KOR_2023_Inventory_from_xlsx.py

@@ -25,6 +25,7 @@ from unfccc_ghg_data.unfccc_reader.Republic_of_Korea.config_KOR_INV2023 import (
     filter_remove_2006,
     filter_remove_2006,
     filter_remove_after_agg,
     filter_remove_after_agg,
     fix_rows,
     fix_rows,
+    processing_info_country_basket_copy,
 )
 )
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
@@ -390,7 +391,7 @@ if __name__ == "__main__":
         data_pm2_2006,
         data_pm2_2006,
         entities_to_ignore=[],
         entities_to_ignore=[],
         gas_baskets=gas_baskets,
         gas_baskets=gas_baskets,
-        processing_info_country=None,
+        processing_info_country=processing_info_country_basket_copy,
     )
     )
 
 
     # convert back to IF to have units in the fixed format
     # convert back to IF to have units in the fixed format

+ 40 - 15
src/unfccc_ghg_data/unfccc_reader/United_Kingdom/config_uk_inv2024.py

@@ -412,23 +412,23 @@ cat_conversion = {
         "3.B.3": "3.A.2.h",  # 3B23_Manure_Management_X_swine
         "3.B.3": "3.A.2.h",  # 3B23_Manure_Management_X_swine
         "3.B.4": "3.A.2.i",  # 3B24_Manure_Management_X_other:poultry
         "3.B.4": "3.A.2.i",  # 3B24_Manure_Management_X_other:poultry
         "3.B.5": "3.C.6",  # 3B25_Manure_Management_Indirect_Emissions_swine
         "3.B.5": "3.C.6",  # 3B25_Manure_Management_Indirect_Emissions_swine
-        "3.D.a.1": "3.C.4.a",  # 3D11_Agriculural_Soils_Inorganic_N_Fertilisers
-        "3.D.a.2.a": "M.3.C.4.b.i",  # 3D12a_Agricultural_Soils_Manure_Applied_to_Soils
-        "3.D.a.2.b": "M.3.C.4.b.ii",  # 3D12b_Agricultural_Soils_Sewage_Sludge_Applied_to_Soils
-        "3.D.a.2.c": "M.3.C.4.b.iii",  # 3D12c_Agricultural_Soils_Other_Organic_Fertilisers_Applied_to_Soils
+        "3.D.a.1": "M.3.C.4.a.AG",  # 3D11_Agriculural_Soils_Inorganic_N_Fertilisers
+        "3.D.a.2.a": "M.3.C.4.b.i.AG",  # 3D12a_Agricultural_Soils_Manure_Applied_to_Soils
+        "3.D.a.2.b": "M.3.C.4.b.ii.AG",  # 3D12b_Agricultural_Soils_Sewage_Sludge_Applied_to_Soils
+        "3.D.a.2.c": "M.3.C.4.b.iii.AG",  # 3D12c_Agricultural_Soils_Other_Organic_Fertilisers_Applied_to_Soils
         "3.D.a.3": "3.C.4.c",  # 3D13_Agricultural_Soils_Manure_Deposited_by_Grazing_Animals
         "3.D.a.3": "3.C.4.c",  # 3D13_Agricultural_Soils_Manure_Deposited_by_Grazing_Animals
         "3.D.a.4": "3.C.4.d",  # 3D14_Agriculural_Soils_Residues
         "3.D.a.4": "3.C.4.d",  # 3D14_Agriculural_Soils_Residues
-        "3.D.a.5": "M.3.C.4.e",  # 3D15_Agricultural_soils_Mineralization/Immobilization
-        "3.D.a.6": "M.3.C.4.f",  # 3D16_Agricultural_soils_Cultivation_of_Organic_Soils
-        "3.D.b.1": "M.3.C.5.AG.a",  # 3D21_Agriculural_Soils_Indirect_Deposition
-        "3.D.b.2": "M.3.C.5.AG.b",  # 3D22_Agriculural_Soils_Indirect_Leaching_and_Run-off
+        "3.D.a.5": "M.3.C.4.e.AG",  # 3D15_Agricultural_soils_Mineralization/Immobilization
+        "3.D.a.6": "M.3.C.4.f.AG",  # 3D16_Agricultural_soils_Cultivation_of_Organic_Soils
+        "3.D.b.1": "M.3.C.5.a.AG",  # 3D21_Agriculural_Soils_Indirect_Deposition
+        "3.D.b.2": "M.3.C.5.b.AG",  # 3D22_Agriculural_Soils_Indirect_Leaching_and_Run-off
         "3.F.1.a": "M.3.C.1.b.i",  # 3F11_Field_burning_wheat
         "3.F.1.a": "M.3.C.1.b.i",  # 3F11_Field_burning_wheat
         "3.F.1.b": "M.3.C.1.b.ii",  # 3F12_Field_burning_barley
         "3.F.1.b": "M.3.C.1.b.ii",  # 3F12_Field_burning_barley
         "3.F.1.d": "M.3.C.1.b.iii",  # 3F14_Field_burning_other_cereals
         "3.F.1.d": "M.3.C.1.b.iii",  # 3F14_Field_burning_other_cereals
         "3.F.5": "M.3.C.1.b.iv",  # 3F5_Field_burning_other_residues
         "3.F.5": "M.3.C.1.b.iv",  # 3F5_Field_burning_other_residues
         "3.G.1": "M.3.C.2.a",  # 3G1_Liming - limestone
         "3.G.1": "M.3.C.2.a",  # 3G1_Liming - limestone
         "3.G.2": "M.3.C.2.b",  # 3G2_Liming - dolomite
         "3.G.2": "M.3.C.2.b",  # 3G2_Liming - dolomite
-        "3.H": "3.C.3",  # 3H_Urea application
+        "3.H": "M.3.C.3.AG",  # 3H_Urea application
         "4": "M.3.C.5.LU",  # 4_Indirect_N2O_Emissions (LULUCF)
         "4": "M.3.C.5.LU",  # 4_Indirect_N2O_Emissions (LULUCF)
         "4.A": "M.3.B.1.DR",  # 4A_Forest Land_Emissions_from_Drainage
         "4.A": "M.3.B.1.DR",  # 4A_Forest Land_Emissions_from_Drainage
         "4.A.1": "3.B.1.a",  # 4A1_ Forest Land remaining Forest Land
         "4.A.1": "3.B.1.a",  # 4A1_ Forest Land remaining Forest Land
@@ -609,23 +609,48 @@ cat_conversion = {
         },
         },
         "3.C.1": {"sources": ["3.C.1.b"]},
         "3.C.1": {"sources": ["3.C.1.b"]},
         "M.3.C.1.AG": {"sources": ["3.C.1.b"]},
         "M.3.C.1.AG": {"sources": ["3.C.1.b"]},
-        "3.C.2": {"sources": ["M.3.C.2.a", "M.3.C.2.b"]},
-        "3.C.4.b": {"sources": ["M.3.C.4.b.i", "M.3.C.4.b.ii", "M.3.C.4.b.iii"]},
+        "M.3.C.2.AG": {"sources": ["M.3.C.2.a.AG", "M.3.C.2.b.AG"]},
+        "3.C.2": {"sources": ["M.3.C.2.AG"]},
+        "3.C.3": {"sources": ["M.3.C.3.AG"]},
+        "3.C.4.a": {"sources": ["M.3.C.4.a.AG"]},
+        "M.3.C.4.b.AG": {
+            "sources": ["M.3.C.4.b.i.AG", "M.3.C.4.b.ii.AG", "M.3.C.4.b.iii.AG"]
+        },
+        "3.C.4.b": {"sources": ["M.3.C.4.b.AG"]},
+        "3.C.4.e": {"sources": ["M.3.C.4.e.AG"]},
+        "3.C.4.f": {"sources": ["M.3.C.4.f.AG"]},
+        "M.3.C.4.AG": {
+            "sources": [
+                "3.C.4.a.AG",
+                "3.C.4.b.AG",
+                "3.C.4.c",
+                "3.C.4.d",
+                "M.3.C.4.e.AG",
+                "M.3.C.4.f.AG",
+            ]
+        },
         "3.C.4": {
         "3.C.4": {
             "sources": [
             "sources": [
                 "3.C.4.a",
                 "3.C.4.a",
                 "3.C.4.b",
                 "3.C.4.b",
                 "3.C.4.c",
                 "3.C.4.c",
                 "3.C.4.d",
                 "3.C.4.d",
-                "M.3.C.4.e",
-                "M.3.C.4.f",
+                "3.C.4.e",
+                "3.C.4.f",
             ]
             ]
         },
         },
-        "M.3.C.5.AG": {"sources": ["M.3.C.5.AG.a", "M.3.C.5.AG.b"]},
+        "M.3.C.5.AG": {"sources": ["M.3.C.5.a.AG", "M.3.C.5.b.AG"]},
         "3.C.5": {"sources": ["M.3.C.5.AG", "M.3.C.5.LU"]},
         "3.C.5": {"sources": ["M.3.C.5.AG", "M.3.C.5.LU"]},
         "3.C": {"sources": ["3.C.1", "3.C.2", "3.C.3", "3.C.4", "3.C.5", "3.C.6"]},
         "3.C": {"sources": ["3.C.1", "3.C.2", "3.C.3", "3.C.4", "3.C.5", "3.C.6"]},
         "M.3.C.AG": {
         "M.3.C.AG": {
-            "sources": ["M.3.C.1.AG", "3.C.2", "3.C.3", "3.C.4", "M.3.C.5.AG", "3.C.6"]
+            "sources": [
+                "M.3.C.1.AG",
+                "M.3.C.2.AG",
+                "M.3.C.3.AG",
+                "M.3.C.4.AG",
+                "M.3.C.5.AG",
+                "3.C.6",
+            ]
         },
         },
         "M.3.C.LU": {"sources": ["M.3.C.5.LU"]},
         "M.3.C.LU": {"sources": ["M.3.C.5.LU"]},
         "M.3.D.LU": {"sources": ["3.D.1"]},
         "M.3.D.LU": {"sources": ["3.D.1"]},

+ 5 - 2
src/unfccc_ghg_data/unfccc_reader/United_States_of_America/config_usa_inv2024.py

@@ -138,7 +138,7 @@ inventory_files = {
                     "CH4": f"CH4 ({gwp_to_use})",
                     "CH4": f"CH4 ({gwp_to_use})",
                     "N2O": f"N2O ({gwp_to_use})",
                     "N2O": f"N2O ({gwp_to_use})",
                     "LULUCF Carbon Stock Changee": "CO2",
                     "LULUCF Carbon Stock Changee": "CO2",
-                    "LULUCF Sector Net Totalf": f"KYOTGHG ({gwp_to_use})",
+                    "LULUCF Sector Net Totalf": f"KYOTOGHG ({gwp_to_use})",
                 },
                 },
                 "category": {
                 "category": {
                     #'LULUCF Emissionsc': '',
                     #'LULUCF Emissionsc': '',
@@ -339,7 +339,10 @@ cat_conversion = {
         "4.B": {"sources": ["4.B.1", "4.B.2"]},
         "4.B": {"sources": ["4.B.1", "4.B.2"]},
         "4": {"sources": ["4.A", "4.B", "4.D"]},
         "4": {"sources": ["4.A", "4.B", "4.D"]},
         # consistency check
         # consistency check
-        "0": {"sources": ["1", "2", "3", "4"]},
+        "0": {
+            "sources": ["1", "2", "3", "4"],
+            "filter": {"entity": ["CH4", "N2O", "CO2", "NF3", "SF6", "HFCS", "PFCS"]},
+        },
         "M.0.EL": {"sources": ["1", "2", "M.AG", "4"]},
         "M.0.EL": {"sources": ["1", "2", "M.AG", "4"]},
     },
     },
 }
 }