definitions.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import os
  2. from pathlib import Path
  3. def get_root_path() -> Path:
  4. """ get the root_path from an environment variable """
  5. root_path_env = os.getenv('UNFCCC_GHG_ROOT_PATH', None)
  6. if root_path_env is None:
  7. raise ValueError('UNFCCC_GHG_ROOT_PATH environment variable needs to be set')
  8. else:
  9. root_path = Path(root_path_env).resolve()
  10. return root_path
  11. root_path = get_root_path()
  12. code_path = root_path / "UNFCCC_GHG_data"
  13. log_path = root_path / "log"
  14. extracted_data_path = root_path / "extracted_data"
  15. extracted_data_path_UNFCCC = extracted_data_path / "UNFCCC"
  16. downloaded_data_path = root_path / "downloaded_data"
  17. downloaded_data_path_UNFCCC = downloaded_data_path / "UNFCCC"
  18. legacy_data_path = root_path / "legacy_data"
  19. dataset_path = root_path / "datasets"
  20. dataset_path_UNFCCC = dataset_path / "UNFCCC"
  21. custom_country_mapping = {
  22. "EUA": "European Union",
  23. "EUC": "European Union",
  24. "FRK": "France",
  25. "DKE": "Denmark",
  26. "DNM": "Denmark",
  27. "GBK": "United Kingdom of Great Britain and Northern Ireland",
  28. }
  29. custom_folders = {
  30. 'Venezeula_(Bolivarian_Republic_of)': 'VEN',
  31. 'Venezuela_(Bolivarian_Republic_of)': 'VEN',
  32. 'Micronesia_(Federated_State_of)': 'FSM',
  33. 'Micronesia_(Federated_States_of)': 'FSM',
  34. 'The_Republic_of_North_Macedonia': 'MKD',
  35. 'Republic_of_Korea': 'KOR',
  36. 'Bolivia_(Plurinational_State_of)': 'BOL',
  37. 'Türkiye': 'TUR',
  38. 'Iran_(Islamic_Republic_of)': 'IRN',
  39. 'Côte_d’Ivoire': 'CIV',
  40. 'Democratic_Republic_of_the_Congo': "COD",
  41. 'European_Union': 'EUA',
  42. 'Taiwan': 'TWN',
  43. }
  44. GWP_factors = {
  45. 'SARGWP100_to_AR4GWP100': {
  46. 'HFCS': 1.1,
  47. 'PFCS': 1.1,
  48. 'UnspMixOfHFCs': 1.1,
  49. 'PFCS': 1.1,
  50. },
  51. 'SARGWP100_to_AR5GWP100': {
  52. 'HFCS': 1.2,
  53. 'PFCS': 1.2,
  54. 'UnspMixOfHFCs': 1.2,
  55. 'UnspMixOfPFCs': 1.2,
  56. },
  57. 'SARGWP100_to_AR6GWP100': {
  58. 'HFCS': 1.4,
  59. 'PFCS': 1.3,
  60. 'UnspMixOfHFCs': 1.4,
  61. 'UnspMixOfPFCs': 1.3,
  62. },
  63. 'AR4GWP100_to_SARGWP100': {
  64. 'HFCS': 0.91,
  65. 'PFCS': 0.91,
  66. 'UnspMixOfHFCs': 0.91,
  67. 'UnspMixOfPFCs': 0.91,
  68. },
  69. 'AR4GWP100_to_AR5GWP100': {
  70. 'HFCS': 1.1,
  71. 'PFCS': 1.1,
  72. 'UnspMixOfHFCs': 1.1,
  73. 'UnspMixOfPFCs': 1.1,
  74. },
  75. 'AR4GWP100_to_AR6GWP100': {
  76. 'HFCS': 1.27,
  77. 'PFCS': 1.18,
  78. 'UnspMixOfHFCs': 1.27,
  79. 'UnspMixOfPFCs': 1.18,
  80. },
  81. }