Skip to content

Commit

Permalink
Julia is 1 indexed so don't subtract 1
Browse files Browse the repository at this point in the history
  • Loading branch information
adfarth committed Aug 23, 2023
1 parent cd5a800 commit b840391
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/core/financial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ function easiur_costs(latitude::Real, longitude::Real, grid_or_onsite::String)
EASIUR_data = nothing
try
EASIUR_data = get_EASIUR2005(type, pop_year=2020, income_year=2020, dollar_year=2010)
if type == "p150"
print("\nEASIUR_data['NOX_Annual']: ", EASIUR_data["NOX_Annual"][10,10], "\n")
end
catch e
@warn "Could not look up EASIUR health costs from point ($latitude,$longitude). {$e}"
return nothing
Expand All @@ -264,9 +267,9 @@ function easiur_costs(latitude::Real, longitude::Real, grid_or_onsite::String)
USD_2010_to_2020 = 1.246
try
costs_per_tonne = Dict(
"NOx" => EASIUR_data["NOX_Annual"][x - 1, y - 1] .* USD_2010_to_2020,
"SO2" => EASIUR_data["SO2_Annual"][x - 1, y - 1] .* USD_2010_to_2020,
"PM25" => EASIUR_data["PEC_Annual"][x - 1, y - 1] .* USD_2010_to_2020
"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
)
return costs_per_tonne
catch
Expand Down Expand Up @@ -506,3 +509,5 @@ function easiur_data(; latitude::Real, longitude::Real, inflation::Real)
end
return response_dict
end

print("\nTEST!!!: ", easiur_data(;latitude=30.2672,longitude=-97.7431,inflation=0.025)["NOx_grid_cost_per_tonne"])

0 comments on commit b840391

Please sign in to comment.