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

Add 2016 historical capacity and generation data #167

Merged
merged 7 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
### Generation
#### 2016 Historical Generation in the Texas Interconnection
##### Source 1
* Name: Form EIA-923
* Author: Energy Information Administration (EIA)
* Description: Electric power data -- monthly and annually -- on electricity generation, fuel consumption, fossil fuel stocks, and receipts at the power plant and prime mover level for 2016
* Source: https://www.eia.gov
* Exact source location: https://www.eia.gov/electricity/data/eia923/

##### Source 2
* Name: 2016 State of the Grid Report
* Author: Electric Reliability Council of Texas (ERCOT)
* Description: 2016 report on the state of the electric grid managed by ERCOT. In particular, the 2016 Energy Use bar plot was exploited.
* Source: https://www.ercot.gov
* Exact source location: http://www.ercot.com/news/presentations/2016

##### Destination
* Modifications to source files(s): Aggregation were made in source \#1 to obtain the electricity generated by each generator type in each load zone of the Western interconnection.
* Location: ***postreise/data/2016_Historical_Texas_Generation_TWh.csv***

##### Legal Note
* Acknowledge EIA and ERCOT as the source


#### 2016 Historical Generation in the Western Interconnection
##### Source
* Name: Form EIA-923
* Author: EIA
* Description: Electric power data -- monthly and annually -- on electricity generation, fuel consumption, fossil fuel stocks, and receipts at the power plant and prime mover level for 2016
* Source: https://www.eia.gov
* Exact source location: https://www.eia.gov/electricity/data/eia923/

##### Destination
* Modifications to source files(s): Aggregation were made to obtain the electricity generated by each generator type in each load zone of the Western interconnection.
* Location: ***postreise/data/2016_Historical_Western_Generation_TWh.csv***

##### Legal Note
* Acknowledge EIA as the source


#### 2016 Historical Generation in the U.S. electric Grid
##### Source 1
* Name: Form EIA-923
* Author: EIA
* Description: Electric power data -- monthly and annually -- on electricity generation, fuel consumption, fossil fuel stocks, and receipts at the power plant and prime mover level for 2016
* Source: https://www.eia.gov
* Exact source location: https://www.eia.gov/electricity/data/eia923/

##### Source 2
* Name: 2016 State of the Grid Report
* Author: Electric Reliability Council of Texas (ERCOT)
* Description: 2016 report on the state of the electric grid managed by ERCOT. In particular, the 2016 Energy Use bar plot was exploited.
* Source: https://www.ercot.gov
* Exact source location: http://www.ercot.com/news/presentations/2016

##### Destination
* Modifications to source files(s): Aggregation were made in source \#1 to obtain the electricity generated by each generator type in each load zone of the Western interconnection.
* Location: ***postreise/data/2016_Historical_USA_TAMU_Generation_GWh.csv***

##### Legal Note
* Acknowledge EIA and ERCOT as the source


---
### Capacity
#### 2016 Generation Capacity
* Name: Form EIA-860
* Author: EIA
* Description: 2016 solar technology data for operable units (Schedule 3)
* Source: https://www.eia.gov
* Exact source location: https://www.eia.gov/electricity/data/eia860/

##### Destination
* Modifications to source file(s): Aggregation were made in source to obtain the generation capacity for each generator type in each load zone.
* Location:
* ***2016_Historical_Texas_Capacity_GW.csv***
* ***2016_Historical_Western_Capacity_GW.csv***
* ***2016_Historical_USA_TAMU_Capacity_MW.csv***

#### Legal Note
* Acknowledge EIA as the source


---
### NREL Scenarios Results
#### Open Energy Data Initiative (OEDI)
* Name: Standard Scenarios Results Viewer
* Author: NREL
* Description: Dashboard web application showcasing results from scenarios ran by NREL
* Source: https://openei.org
* Exact source location: https://openei.org/apps/reeds/#

##### Destination
* Modifications to source file(s): None
* Location:
* ***2016_NREL_Low_Demand_Western_Generation_TWh.csv***
* ***2016_NREL_Mid_Case_Western_Generation_TWh.csv***


#### Legal Note
* Recommended citation: Cole, Wesley, Nathaniel Gates, Trieu Mai, Daniel Greer, and Paritosh Das. 2019. 2019 Standard Scenarios Report: A U.S. Electricity Sector Outlook, Golden, CO: National Renewable Energy Laboratory. NREL/TP-6A20-74110. https://www.nrel.gov/docs/fy20osti/74110.pdf.
66 changes: 49 additions & 17 deletions postreise/analyze/generation/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

import numpy as np
import pandas as pd
from powersimdata.network.usa_tamu.constants.plants import label2type
from powersimdata.network.usa_tamu.constants.plants import type2label
from powersimdata.network.usa_tamu.constants.zones import (
abv2state,
interconnect2abv,
interconnect2loadzone,
loadzone2interconnect,
loadzone2state,
state2loadzone,
)
from powersimdata.scenario.analyze import Analyze
from powersimdata.scenario.scenario import Scenario

from postreise.analyze.check import _check_scenario_is_in_analyze_state
from postreise.analyze.check import (
_check_data_frame,
_check_resources_and_format,
_check_scenario_is_in_analyze_state,
)


def sum_generation_by_type_zone(scenario: Scenario) -> pd.DataFrame:
Expand Down Expand Up @@ -71,11 +77,12 @@ def _groupby_state(index: str) -> str:
"""Use state as a dict key if index is a smaller region (e.g. Texas East),
otherwise use the given index.

:param str index: either a state name or region within a state
:return: (*str*) the corresponding state name
:param str index: either a state name or region within a state.
:return: (*str*) -- the corresponding state name.
"""
for state in ("Texas", "New Mexico", "Montana"):
if state in index:
interconnect_spanning_states = ("Texas", "New Mexico", "Montana")
for state in interconnect_spanning_states:
if index in state2loadzone[state]:
return state
return index

Expand All @@ -84,19 +91,44 @@ def summarize_hist_gen(hist_gen_raw: pd.DataFrame, all_resources: list) -> pd.Da
"""Sum generation by state for the given resources from a scenario, adding
totals for interconnects and for all states.

:param pandas.DataFrame hist_gen_raw: historical generation data frame
:param list all_resources: list of resources from the scenario
:return: (*pandas.DataFrame*) historical generation per resource
:param pandas.DataFrame hist_gen_raw: historical generation data frame. Columns
are resources and indices are either state or load zone.
:param list all_resources: list of resources.
:return: (*pandas.DataFrame*) -- historical generation per resource.
"""
western = [abv2state[s] for s in interconnect2abv["Western"]]
eastern = [abv2state[s] for s in interconnect2abv["Eastern"]]
_check_data_frame(hist_gen_raw, "PG")
filtered_colnames = _check_resources_and_format(all_resources)

filtered_colnames = [k for k in label2type.keys() if label2type[k] in all_resources]
result = hist_gen_raw.copy()
result = result.loc[:, filtered_colnames]
result.rename(columns=label2type, inplace=True)

# Interconnection
eastern_areas = (
set([abv2state[s] for s in interconnect2abv["Eastern"]])
| interconnect2loadzone["Eastern"]
)
eastern = result.loc[result.index.isin(eastern_areas)].sum()

ercot_areas = interconnect2loadzone["Texas"]
ercot = result.loc[result.index.isin(ercot_areas)].sum()

western_areas = (
set([abv2state[s] for s in interconnect2abv["Western"]])
| interconnect2loadzone["Western"]
)
western = result.loc[result.index.isin(western_areas)].sum()

# State
result = result.groupby(by=_groupby_state).aggregate(np.sum)
result.loc["Western"] = result[result.index.isin(western)].sum()
result.loc["Eastern"] = result[result.index.isin(eastern)].sum()
result.loc["all"] = result[~result.index.isin(["Eastern", "Western"])].sum()

# Summary
all = result.sum()

result.loc["Eastern interconnection"] = eastern
result.loc["Western interconnection"] = western
result.loc["Texas interconnection"] = ercot
result.loc["All"] = all

result = result.loc[:, filtered_colnames]
result.rename(columns=type2label, inplace=True)

return result
24 changes: 19 additions & 5 deletions postreise/analyze/generation/tests/test_summarize.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pathlib
import unittest

Expand Down Expand Up @@ -71,9 +72,14 @@ def sim_gen_result():

@pytest.fixture
def hist_gen_raw():
raw_hist_gen_csv = "usa_hist_gen.csv"
path_to_csv = pathlib.Path(__file__).parent.joinpath(raw_hist_gen_csv)
hist_gen_raw = pd.read_csv(path_to_csv, index_col=0)
# raw_hist_gen_csv = "usa_hist_gen.csv"
# path_to_csv = pathlib.Path(__file__).parent.joinpath(raw_hist_gen_csv)

path_to_csv = pathlib.Path(__file__).parent.joinpath(
"..", "..", "..", "data", "2016_Historical_USA_TAMU_Generation_GWh.csv"
)

hist_gen_raw = pd.read_csv(path_to_csv, index_col=0).T
return hist_gen_raw


Expand All @@ -98,11 +104,19 @@ def test_sum_generation_by_state_values_scaled(sim_gen_result):
def test_summarize_hist_gen_include_areas(hist_gen_raw):
all_resources = ["wind", "hydro", "coal"]
actual_hist_gen = summarize_hist_gen(hist_gen_raw, all_resources)
for area in ("Western", "Eastern", "Texas", "Montana", "all"):
for area in (
"Western interconnection",
"Eastern interconnection",
"Texas interconnection",
"Montana",
"New Mexico",
"All",
):
assert area in actual_hist_gen.index


def test_summarize_hist_gen_shape(hist_gen_raw):
all_resources = ["wind", "hydro", "coal"]
actual_hist_gen = summarize_hist_gen(hist_gen_raw, all_resources)
assert (8, 3) == actual_hist_gen.shape
# 48 contiguous, 3 interconnections and total
assert (52, 3) == actual_hist_gen.shape
rouille marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 0 additions & 8 deletions postreise/analyze/generation/tests/usa_hist_gen.csv

This file was deleted.

10 changes: 10 additions & 0 deletions postreise/data/2016_Historical_USA_TAMU_Capacity_MW.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Resource Type,Arizona,California,Colorado,Idaho,Montana Western,Nevada,New Mexico Western,Oregon,Utah,Washington,Wyoming,El Paso,Coast,East,Far West,North,North Central,South,South Central,West,East Texas,Texas Panhandle,Alabama,Arkansas,Connecticut,Delaware,Florida,Georgia,Iowa,Illinois,Indiana,Kansas,Kentucky,Louisiana,Massachusetts,Maryland,Maine,Michigan,Minnesota,Missouri,Mississippi,Montana Eastern,North Carolina,North Dakota,Nebraska,New Hampshire,New Jersey,New Mexico Eastern,New York,Ohio,Oklahoma,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Virginia,Vermont,Wisconsin,West Virginia
coal,6245.000,63.000,5525.000,10.000,2434.000,1104.000,3741.000,642.000,4894.000,1460.000,7254.000,0.000,2737.000,8145.000,0.000,720.000,2858.000,1032.000,5318.000,0.000,1837.000,2215.800,6671.200,5487.000,400.000,445.500,11090.300,10109.700,6034.500,15662.700,17585.400,4946.700,15601.700,3170.200,1124.600,5126.800,0.000,10354.200,4655.700,12490.600,2010.300,54.000,11494.200,4350.100,3982.900,559.200,1343.300,0.000,1849.700,16273.800,5371.000,14155.000,0.000,5526.900,450.000,8126.500,4054.900,0.000,7744.700,13510.900
dfo,128.300,512.500,202.700,5.000,0.000,6.000,76.800,0.000,29.300,15.500,5.800,0.000,3.200,14.000,0.000,6.000,16.500,11.800,1.500,0.000,0.000,0.000,47.800,12.300,2816.800,121.600,5663.300,1072.600,1134.100,808.200,285.700,625.900,11.500,55.200,3331.500,1389.000,917.600,560.500,921.200,1316.600,48.000,0.000,490.800,68.500,360.700,110.000,258.400,0.000,3882.100,713.900,80.300,2093.100,16.400,704.200,282.400,47.600,2755.900,132.900,732.000,18.500
geothermal,0.000,1322.000,0.000,0.000,0.000,383.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000
hydro,2912.000,13801.000,1178.000,2543.000,2665.000,1052.000,82.000,8451.000,262.000,21437.000,303.000,0.000,60.000,0.000,0.000,102.000,46.000,41.000,258.000,121.000,81.000,0.000,3319.300,1348.900,149.500,0.000,55.700,3597.800,129.200,39.700,92.100,7.000,1016.600,192.000,1808.900,550.800,714.800,2340.400,215.300,1106.400,0.000,0.000,1985.400,614.000,332.300,424.800,467.700,0.000,5917.700,128.600,1068.500,2460.500,2.800,4054.400,1602.100,4213.000,3931.700,327.400,536.900,370.600
ng,16265.000,45228.000,7442.000,1275.000,260.000,8616.000,2304.000,4331.000,3229.000,4116.000,418.000,1540.000,21128.000,3194.000,2751.000,2257.000,14883.000,5731.000,9757.000,1257.000,9644.500,4167.800,15383.000,7229.400,3806.600,3016.200,43830.100,18652.300,3488.500,17599.000,8344.200,5197.100,7326.900,20853.700,6896.100,4316.900,1758.200,12031.000,5785.100,6905.600,14275.000,216.600,12610.400,458.500,2358.500,1814.500,13573.300,1459.600,23357.000,11282.400,15053.300,16833.200,1973.100,6974.700,1067.000,6453.000,12794.600,0.000,7621.000,1339.400
nuclear,3689.650,2154.657,0.000,0.000,0.000,0.000,0.000,0.000,0.000,1096.910,0.000,0.000,2469.752,0.000,0.000,0.000,2320.713,0.000,0.000,0.000,0.000,0.000,4547.111,1529.424,1888.898,0.000,3341.231,3929.323,535.903,11236.993,0.000,939.697,0.000,1954.576,617.001,1682.030,0.000,3595.548,1579.541,1074.638,672.037,0.000,4875.787,0.000,1065.568,1226.313,3405.635,0.000,4737.318,1916.464,0.000,9449.797,0.000,6361.771,0.000,3370.639,3388.167,0.000,1156.826,0.000
solar,1890.000,9862.000,419.000,120.000,0.000,1598.000,312.000,100.000,856.000,1.000,1.000,10.000,1.000,1.000,200.000,100.000,7.000,1.000,128.000,140.000,1.000,1.000,75.000,13.000,25.200,30.800,331.600,978.100,2.600,34.100,160.600,1.000,10.000,1.000,482.300,144.400,1.000,12.500,256.200,26.700,3.100,1.000,2431.400,1.000,6.300,1.000,613.900,165.000,110.300,48.800,2.500,53.700,10.200,19.300,1.000,72.600,139.000,66.000,3.100,1.000
wind,267.000,5671.000,3027.000,974.000,657.000,150.000,629.000,3161.000,388.000,3074.000,1487.000,1.000,1.000,1.000,3189.000,2516.000,1831.000,4206.000,1.000,5605.000,1.000,1247.600,1.000,1.000,5.000,2.000,3.000,2.000,6935.300,4008.500,1889.700,4469.800,1.000,1.000,96.400,190.000,898.800,1609.900,3517.000,660.400,1.000,30.000,209.000,2828.400,1318.900,185.300,9.000,483.600,1829.800,533.900,6654.800,1373.400,21.000,1.000,627.800,28.800,2.000,121.000,637.500,686.300
other,24.000,768.000,25.000,68.000,53.000,9.000,2.000,119.000,34.000,236.000,8.000,1.000,133.000,11.000,1.000,1.000,31.000,11.000,24.000,1.000,69.000,1.000,381.000,157.000,166.000,10.000,887.000,546.000,34.000,84.000,91.000,7.000,59.000,957.000,235.000,105.000,361.000,319.000,262.000,17.000,174.000,37.000,366.000,6.000,11.000,201.000,194.000,1.000,366.000,186.000,44.000,376.000,24.000,279.000,1.000,108.000,518.000,55.000,187.000,1.000
11 changes: 11 additions & 0 deletions postreise/data/2016_Historical_USA_TAMU_Generation_GWh.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Resource Type,Arizona,California,Colorado,Idaho,Montana Western,Nevada,New Mexico Western,Oregon,Utah,Washington,Wyoming,El Paso,Coast,East,Far West,North,North Central,South,South Central,West,East Texas,Texas Panhandle,Alabama,Arkansas,Connecticut,Delaware,Florida,Georgia,Iowa,Illinois,Indiana,Kansas,Kentucky,Louisiana,Massachusetts,Maryland,Maine,Michigan,Minnesota,Missouri,Mississippi,Montana Eastern,North Carolina,North Dakota,Nebraska,New Hampshire,New Jersey,New Mexico Eastern,New York,Ohio,Oklahoma,Pennsylvania,Rhode Island,South Carolina,South Dakota,Tennessee,Virginia,Vermont,Wisconsin,West Virginia
coal,30403.392,318.876,29948.675,29.188,14003.160,2166.831,18365.269,1898.202,25939.443,4601.726,40026.874,0.000,12244.469,41248.699,0.000,2485.825,13265.643,5468.957,26293.020,0.000,9555.977,10668.343,34258.405,23800.070,177.370,479.350,41477.954,37890.475,25198.347,59337.802,72533.080,23096.064,67952.425,12013.649,1874.932,13826.213,69.823,41225.684,23206.289,60321.889,5342.026,266.062,37435.780,26580.350,21897.715,422.017,1314.541,0.000,1770.238,68775.164,19158.044,54672.030,0.000,21002.913,2082.680,31167.634,16499.412,0.000,33362.841,71512.961
dfo,51.595,34.643,6.311,0.183,10.409,10.985,51.683,4.850,31.552,13.529,51.961,1.089,0.245,20.664,2.228,5.586,1.592,6.663,26.488,0.189,14.731,0.470,34.353,39.008,63.780,39.854,770.497,90.103,238.770,69.449,102.006,28.324,88.047,14.478,420.319,159.672,109.206,101.667,30.513,73.671,17.785,0.275,248.855,29.782,0.000,9.129,34.263,0.000,195.594,217.294,17.261,270.955,24.163,83.818,2.931,121.581,535.361,2.347,26.309,122.369
geothermal,0.000,11457.299,0.000,71.995,0.000,3353.399,14.218,183.700,485.094,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000
hydro,7401.466,30683.589,2444.138,9033.272,10082.529,1789.219,147.972,34549.366,759.542,78348.633,973.488,0.000,122.742,0.000,0.000,336.447,143.680,88.636,387.926,93.604,168.970,0.000,7462.945,3608.810,234.988,0.000,174.551,5173.998,916.789,132.834,426.265,30.538,3477.930,1103.023,2161.236,1392.187,2999.688,3446.973,1208.502,1982.838,0.000,0.000,4489.092,1912.005,1529.430,1145.386,537.035,0.000,27784.974,500.320,2664.281,4202.499,2.128,6160.029,4132.504,9532.675,4872.869,1077.517,2795.258,1638.247
ng,34182.808,98428.599,12679.439,3321.462,365.147,28922.354,4742.865,15306.661,8745.419,11383.838,1146.281,2819.393,72145.665,10298.875,5114.426,11700.879,38847.003,16841.778,24424.007,4601.084,34488.525,7208.370,57827.671,18171.187,17951.503,8064.946,158464.439,52862.465,2960.947,17684.592,22776.553,2027.207,8228.334,68151.525,21143.936,5445.748,3498.340,30927.074,8928.076,6031.568,50094.739,119.499,39251.102,1111.354,537.862,4744.436,44014.621,5214.688,56844.991,29663.392,36529.086,68536.271,6290.503,16366.854,900.452,11333.903,40904.843,1.965,15472.759,1249.218
nuclear,32377.477,18907.578,0.000,0.000,0.000,0.000,0.000,0.000,0.000,9625.622,0.000,0.000,21694.303,0.000,0.000,0.000,20385.142,0.000,0.000,0.000,0.000,0.000,39901.879,13421.022,16575.492,0.000,29320.022,34480.662,4702.665,98607.038,0.000,8246.042,0.000,17151.826,5414.318,14760.177,0.000,31551.710,13860.816,9430.179,5897.272,0.000,42786.087,0.000,9350.591,10761.163,29885.187,0.000,41570.990,16817.386,0.000,82924.011,0.000,55825.916,0.000,29578.086,29731.895,0.000,10151.394,0.000
solar,3737.659,19301.101,538.109,29.801,0.000,2565.749,679.286,40.936,1053.661,0.727,0.000,28.208,0.000,0.000,113.372,70.109,3.754,0.000,220.466,294.901,0.000,0.000,31.261,26.142,24.518,51.086,223.983,880.923,0.151,48.810,225.841,2.102,11.732,0.000,604.033,208.657,0.000,9.235,10.107,32.684,0.000,0.000,3410.123,0.000,3.981,0.000,821.673,83.057,139.611,65.558,5.436,73.045,14.663,4.971,0.364,78.617,20.908,59.031,2.671,0.000
wind,541.582,13442.864,9421.204,2578.415,2040.072,343.865,1727.741,7157.128,822.282,8041.847,4389.338,0.000,186.976,4137.723,8831.370,5569.974,4928.789,11362.885,1734.217,16544.881,0.000,4233.969,0.000,0.000,12.742,5.321,0.000,0.000,20076.023,10663.434,4899.474,14110.881,0.000,0.000,216.123,527.114,1667.103,4695.783,10491.209,1121.883,0.000,100.119,6.233,8171.922,3785.019,432.324,20.841,1877.680,3940.180,1245.337,20069.089,3476.246,26.532,0.000,2530.270,37.747,0.000,291.182,1515.261,1432.154
other,214.378,6745.818,216.356,596.621,469.388,76.292,18.092,1040.968,296.935,2075.802,68.688,0.000,1171.256,98.651,0.000,0.000,276.614,95.782,214.088,0.000,601.644,0.000,3346.726,1378.820,1461.422,90.704,7794.983,4796.136,302.838,740.920,795.840,58.833,515.033,8407.615,2064.047,923.451,3170.268,2797.932,2300.964,151.963,1529.473,326.868,3212.787,51.039,97.817,1768.038,1701.607,0.000,3211.927,1637.627,390.096,3299.508,206.896,2451.817,0.000,952.950,4553.572,479.165,1640.119,0.000

Loading