Skip to content

Commit

Permalink
Merge pull request #200 from NREL/develop
Browse files Browse the repository at this point in the history
emissions_profile function
  • Loading branch information
Bill-Becker authored Mar 18, 2023
2 parents bbde91b + ad7f643 commit 720d629
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ Classify the change according to the following categories:
### Deprecated
### Removed

## v0.28.1
### Added
- `emissions_profiles` function, exported for external use as an endpoint in REopt_API for the webtool/UI

## v0.28
## v0.28.0
### Changed
- Changed Financial **breakeven_cost_of_emissions_reduction_per_tonnes_CO2** to **breakeven_cost_of_emissions_reduction_per_tonne_CO2**
- Changed `CHP.size_class` to start at 0 instead of 1, consistent with the API, and 0 represents the average of all `size_class`s
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "REopt"
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
authors = ["Nick Laws", "Hallie Dunham <[email protected]>", "Bill Becker <[email protected]>", "Bhavesh Rathod <[email protected]>", "Alex Zolan <[email protected]>", "Amanda Farthing <[email protected]>"]
version = "0.28.0"
version = "0.28.1"

[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
Expand Down
3 changes: 2 additions & 1 deletion src/REopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export
get_chp_defaults_prime_mover_size_class,
get_steam_turbine_defaults_size_class,
simulated_load,
get_absorption_chiller_defaults
get_absorption_chiller_defaults,
emissions_profiles

import HTTP
import JSON
Expand Down
17 changes: 17 additions & 0 deletions src/core/electric_utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,21 @@ function region_name_to_abbr(region_name)
"Hawaii (Oahu)" => "HIOA"
)
return get(lookup, region_name, "")
end

#TODO: add docstring
function emissions_profiles(; latitude, longitude, time_steps_per_hour=1)
region_abbr, meters_to_region = region_abbreviation(latitude, longitude)
emissions_region = region_abbr_to_name(region_abbr)
response_dict = Dict{String, Any}(
"region_abbr" => region_abbr,
"region" => emissions_region,
"units" => "Pounds emissions per kWh",
"description" => "Regional hourly grid emissions factors for applicable EPA AVERT region.",
"meters_to_region" => meters_to_region
)
for ekey in ["CO2", "NOx", "SO2", "PM25"]
response_dict["emissions_factor_series_lb_"*ekey*"_per_kwh"] = emissions_series(ekey, region_abbr, time_steps_per_hour=time_steps_per_hour)
end
return response_dict
end

0 comments on commit 720d629

Please sign in to comment.