Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EASIUR years #376

Merged
merged 7 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## Develop - 2024-04-22
### Changed
- Updated `pop_year` and `income_year` used in call to EASIUR data (`get_EASIUR2005`) each to 2024, from 2020.
- Updated usd conversion used for EASIUR health cost calcs from USD_2010_to_2020 = 1.246 to USD_2010_to_2024 = 1.432

## v. 0.46.0
### Added
- In `src/core/absorption_chiller.jl` struct, added field **heating_load_input** to the AbsorptionChiller struct
Expand Down
19 changes: 10 additions & 9 deletions src/core/financial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function easiur_costs(latitude::Real, longitude::Real, grid_or_onsite::String)
end
EASIUR_data = nothing
try
EASIUR_data = get_EASIUR2005(type, pop_year=2020, income_year=2020, dollar_year=2010)
EASIUR_data = get_EASIUR2005(type, pop_year=2024, income_year=2024, dollar_year=2010)
catch e
@warn "Could not look up EASIUR health costs from point ($latitude,$longitude). {$e}"
return nothing
Expand All @@ -232,13 +232,13 @@ function easiur_costs(latitude::Real, longitude::Real, grid_or_onsite::String)
coords = g2l(longitude, latitude, datum="NAD83")
x = Int(round(coords[1]))
y = Int(round(coords[2]))
# Convert from 2010$ to 2020$ (source: https://www.in2013dollars.com/us/inflation/2010?amount=100)
USD_2010_to_2020 = 1.246
# Convert from 2010$ to 2024$ (source: https://www.in2013dollars.com/us/inflation/2010?amount=100)
USD_2010_to_2024 = 1.432
try
costs_per_tonne = Dict(
"NOx" => EASIUR_data["NOX_Annual"][x, y] .* USD_2010_to_2020,
"SO2" => EASIUR_data["SO2_Annual"][x, y] .* USD_2010_to_2020,
"PM25" => EASIUR_data["PEC_Annual"][x, y] .* USD_2010_to_2020
"NOx" => EASIUR_data["NOX_Annual"][x, y] .* USD_2010_to_2024,
"SO2" => EASIUR_data["SO2_Annual"][x, y] .* USD_2010_to_2024,
"PM25" => EASIUR_data["PEC_Annual"][x, y] .* USD_2010_to_2024
)
return costs_per_tonne
catch
Expand All @@ -248,6 +248,7 @@ function easiur_costs(latitude::Real, longitude::Real, grid_or_onsite::String)
end

function easiur_escalation_rates(latitude::Real, longitude::Real, inflation::Real)
# Calculate escalation rate as nominal compound annual growth rate in marginal emissions costs between 2020 and 2024 for this location.
EASIUR_150m_yr2020 = nothing
EASIUR_150m_yr2024 = nothing
try
Expand Down Expand Up @@ -284,7 +285,7 @@ Adapted to Julia from example Python code for EASIUR found at https://barney.ce.
"""
get_EASIUR2005(
stack::String, # area, p150, or p300
pop_year::Int64=2005, # population year
pop_year::Int64=2005, # population year (2000 to 2050)
income_year::Int64=2005, # income level (1990 to 2024)
dollar_year::Int64=2010 # dollar year (1980 to 2010)
)
Expand Down Expand Up @@ -388,7 +389,7 @@ function get_EASIUR2005(stack::String; pop_year::Int64=2005, income_year::Int64=
setindex!(ret_map, v .* adj, k)
end
catch
throw(@error("income year is $(income_year) but must be between 1990 to 2024"))
throw(@error("EASIUR income year is $(income_year) but must be between 1990 to 2024"))
hdunham marked this conversation as resolved.
Show resolved Hide resolved
return nothing
end
end
Expand All @@ -399,7 +400,7 @@ function get_EASIUR2005(stack::String; pop_year::Int64=2005, income_year::Int64=
setindex!(ret_map, v .* adj, k)
end
catch e
throw(@error("Dollar year must be between 1980 to 2010"))
throw(@error("EASIUR dollar year must be between 1980 to 2010"))
return nothing
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ else # run HiGHS tests
d["Site"]["latitude"] = 30.2672
d["Site"]["longitude"] = -97.7431
scen = Scenario(d)
@test scen.financial.NOx_grid_cost_per_tonne ≈ 4534.032470 atol=0.1
@test scen.financial.NOx_grid_cost_per_tonne ≈ 5510.61 atol=0.1
end

@testset "Wind" begin
Expand Down
2 changes: 1 addition & 1 deletion test/test_with_xpress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ end
d["Site"]["latitude"] = 30.2672
d["Site"]["longitude"] = -97.7431
scen = Scenario(d)
@test scen.financial.NOx_grid_cost_per_tonne ≈ 4534.032470 atol=0.1
@test scen.financial.NOx_grid_cost_per_tonne ≈ 5510.61 atol=0.1
end

@testset "Wind" begin
Expand Down