From a41ab4d677d3a9fb911a4b4eda0fa5dbbe3aff6f Mon Sep 17 00:00:00 2001 From: Antoine-Lalechere <73108425+Antoine-Lalechere@users.noreply.github.com> Date: Thu, 30 May 2024 16:53:30 +0200 Subject: [PATCH] update weighting for the Aggregate score based on WEO2023 (#327) * update weighting for the Aggregate score based on WEO2023 * Anonymize path and point to azure location * Refactor * Update calculations and comment --------- Co-authored-by: Monika Furdyna --- data-raw/remaining_carbon_budgets.R | 55 +++++++++++++++++++++++----- data/remaining_carbon_budgets.rda | Bin 454 -> 496 bytes 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/data-raw/remaining_carbon_budgets.R b/data-raw/remaining_carbon_budgets.R index 54e602bb..654b0ec0 100644 --- a/data-raw/remaining_carbon_budgets.R +++ b/data-raw/remaining_carbon_budgets.R @@ -1,15 +1,50 @@ # styler: off -remaining_carbon_budgets <- tibble::tribble( - ~scenario_source, ~ald_sector, ~remaining_carbon_budget, ~unit, ~weighting_factor, - "GECO2021", "coal", 84934.79, "Mt CO2 (2019)", 0.25, - "GECO2021", "oil", 82987.79, "Mt CO2 (2019)", 0.24, - "GECO2021", "gas", 49094.21, "Mt CO2 (2019)", 0.14, - "GECO2021", "power", 91121.17, "Mt CO2 (2019)", 0.27, - "GECO2021", "steel", 10746.03, "Mt CO2 (2019)", 0.03, - "GECO2021", "automotive", 11338.9, "Mt CO2 (2019)", 0.03, - "GECO2021", "hdv", 7388.01, "Mt CO2 (2019)", 0.02, - "GECO2021", "aviation", 5963.32, "Mt CO2 (2019)", 0.02 +# The Extended file data for WEO 2023 is stored here: +# https://portal.azure.com/#view/Microsoft_Azure_FileStorage/FileShareMenuBlade/~/browse/storageAccountId/%2Fsubscriptions%2Ffeef729b-4584-44af-a0f9-4827075512f9%2FresourceGroups%2FRMI-SP-PACTA-PROD%2Fproviders%2FMicrosoft.Storage%2FstorageAccounts%2Fpactarawdata/path/scenario-sources/protocol/SMB +# The specific file is 'weo_2023-20240222/WEO2023 extended data/WEO2023_Extended_Data.xlsx' +# Please download the file and replace the dummy path in variable 'file_scenario_emissions_data' +# to the path on your computer before running the code. +file_scenario_emissions_data <- "PATH/TO/WEO2023/SCENARIO/EXTENDED/DATA" +carbon_emissions <- readxl::read_xlsx(file_scenario_emissions_data, + sheet = "World CO2 Emissions", + range = "J7:AP45") %>% + filter(!row_number() %in% c(12, 13, 14, 18, 19, 20)) %>% + rename( + sector = "...1", + emissions_2022 = "2022...25", + emissions_2030 = "2030...26", + emissions_2035 = "2035...27", + emissions_2040 = "2040...28", + emissions_2045 = "2045...29", + emissions_2050 = "2050...30", + ) %>% + select(c("sector", "2010", "2015", "2021", "emissions_2022", "emissions_2030", "emissions_2035", "emissions_2040", "emissions_2045", "emissions_2050")) %>% + filter(sector %in% c("Coal", "Oil", "Natural gas", "Electricity and heat sectors", "Iron and steel**", "Cement**", "Passenger cars", "Aviation")) %>% + mutate( + scenario_source = "WEO2023", + unit = "Mt CO2 (2022)" ) + +remaining_carbon_budgets <- carbon_emissions %>% + mutate( + # Remaining carbon budget for a sector is the sum of scenario emissions from 2022 until 2030. + # We interpolate the emissions linearly between points for which we have scenario values (2022 and 2030). + # The sum of 7 linearly interpolated points between x and y (including x and y) is equal to 4x + 5y: + # x + 7*x + ((1 + 2 + 3 + 4 + 5 + 6 + 7)/7)*(y-x) + y = 8x + 5y - 4x = 4x + 5y + remaining_carbon_budget = emissions_2022 * 4 + emissions_2030 * 5, + weighting_factor = remaining_carbon_budget/ sum(remaining_carbon_budget) + ) %>% + mutate(ald_sector = case_when( + sector == "Coal" ~ "coal", + sector == "Oil" ~ "oil", + sector == "Natural gas" ~ "gas", + sector == "Electricity and heat sectors" ~ "power", + sector == "Iron and steel**" ~ "steel", + sector == "Passenger cars" ~ "automotive", + sector == "Aviation" ~ "aviation", + sector == "Cement**" ~ "cement" + )) %>% + select("scenario_source", "unit", "remaining_carbon_budget", "weighting_factor", "ald_sector") # styler: on usethis::use_data(remaining_carbon_budgets, overwrite = TRUE) diff --git a/data/remaining_carbon_budgets.rda b/data/remaining_carbon_budgets.rda index 7749ab556321f668a69691330bd3cb823b58ef98..28013c30c73d718f28e93bb440634f206955ee09 100644 GIT binary patch literal 496 zcmVG0iXt=v>`)& zbs(t`tPvF-7>0_0zf{JbllCwY9#`z9qCr&sktL!Clu9InLZTCd)6UStM0w|()p{Z$ zufQFg3RM9q!2wVbI-^t?3aT+t1QI{CT&6~GIKEgQMeUcv17TYP2f(A57!5Z7S#vew zH~|(&3E+~pG^%dFCD>@LpD|7YhD<>4uau}C ziKt;M47RG4Lr(_SDI=ORAq6NQ2pIuSnDGRb7&}NR0|CcZJE0^CNh@0oa===Cp?ZKR>KHR%uM mLwq}3?t%3x#_Ch3>_{rT9WSrv!t99%{}*yaI8cyddIS2a4a7hI literal 454 zcmV;%0XhCcT4*^jL0KkKS=Qs2BLD$EfB*k;+`&R&cp~1)utdM-|CmAmgaHTv0K_E$ zV1yuy1w*g_a~Y6Ih?8o0JyX&jsxmTU27my>Jct0%gHumaYBYLBs5DI}>SIQT3FQg_QC)Ns+a=O9~Ewv2jQzgiJfeM0ZfW@Cc!=+FpVT> z0tNwYGIIlgnU~YB1q&eprS_(|2;$84PAww{2*6yL1RS7t+QR`(0yF?l0f2BB$@jqD zQ0z=P+ecgV=@LBY4>}zHI{>ZR1Hea(7`j060JO0c=h}(l0Kfa1Q4~S;e*IpR)rqNzFtCWtH)BM&!x~V+Ad*QfjEVmjaz!{$kk;dvBMxxJE&u=k