Skip to content

Commit

Permalink
Merge branch 'geothermal_data' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparm committed Aug 2, 2019
2 parents b6f56b2 + 2863f15 commit e0cb34a
Show file tree
Hide file tree
Showing 8 changed files with 305 additions and 181 deletions.
21 changes: 13 additions & 8 deletions powersimdata/input/change_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class ChangeTable(object):
grid as well as to the original demand, hydro, solar and wind profiles.
A pickle file enclosing the change table in form of a dictionary can be
created and transferred on the server. Keys are *'branch'*, *'demand'*,
*'hydro'*, *'solar'* and *'wind'*. If a key is missing in the
dictionary, then no changes will be applied. The data structure is
given below:
*'coal'*, *'dfo'*, *'geothermal'*, *'ng'*, *'nuclear'*, *'hydro'*,
*'solar'*, and *'wind'*. If a key is missing in the dictionary, then no
changes will be applied. The data structure is given below:
* *'branch'*:
value is a dictionary, which has branch id as key and a factor
Expand All @@ -23,10 +23,11 @@ class ChangeTable(object):
value is a dictionary, which has load zones as keys and a factor
indicating the desired increase/decrease of load in zone (1.2 would
correspond to a 20% increase while 0.95 would be a 5% decrease).
* *'coal'*, *'ng'*, *'nuclear'*, *'hydro'*, *'solar'* and *'wind'*:
value is a dictionary, which has the plant id as key and a factor
indicating the desired increase/decrease of capacity of the
*'hydro'*/*'solar'*/*'wind'* plant (1.2 would correspond to a 20%
* *'coal'*, *'dfo'*, *'geothermal'*, *'ng'*, *'nuclear'*, *'hydro'*,
*'solar'*, and *'wind'*:
value is a dictionary, which has plant ids and/or zone ids as keys
and a factor indicating the desired increase/decrease of capacity
of the given plant(s) (1.2 would correspond to a 20%
increase while 0.95 would be a 5% decrease).
:param list interconnect: interconnect name(s).
Expand All @@ -51,7 +52,9 @@ def _check_resource(resource):
:param str resource: type of generator.
:raises ValueError: if resource cannot be changed.
"""
possible = ['coal', 'ng', 'nuclear', 'hydro', 'solar', 'wind']
possible = [
'coal', 'dfo', 'geothermal', 'ng', 'nuclear',
'hydro', 'solar', 'wind']
if resource not in possible:
print("-----------------------")
print("Possible Generator type")
Expand Down Expand Up @@ -125,6 +128,8 @@ def scale_plant_capacity(self, resource, zone_name=None, plant_id=None):
else:
self.ct[resource]['zone_id'][
self.grid.zone2id[z]] = zone_name[z]
if len(self.ct[resource]['zone_id']) == 0:
self.ct.pop(resource)
if plant_id is not None:
plant_id_interconnect = set(self.grid.plant.groupby(
'type').get_group(resource).index)
Expand Down
42 changes: 42 additions & 0 deletions powersimdata/input/data/usa/genbus_case.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13418,3 +13418,45 @@
3008155 174.34 -21.3 81.36 -21.3 1 209.52 1 174.6 52.38 0 0 0 0 0 0 0 0 0 0 174.6 0.0000 0.0000 0.0000 0.0000
3008158 0 0 53.44 -11.65 1 126 0 105 31.5 0 0 0 0 0 0 0 0 0 0 105 0.0000 0.0000 0.0000 0.0000
3008158 0 0 49.98 -10.9 1 117.84 0 98.2 29.46 0 0 0 0 0 0 0 0 0 0 98.2 0.0000 0.0000 0.0000 0.0000
2020304 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020305 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020446 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020450 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020451 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020463 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020464 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020473 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2020486 0 0 0 0 1 100 1 80.84 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028823 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028827 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028858 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028902 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028948 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028981 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2028986 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2029050 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2029053 0 0 0 0 1 50 1 47.73 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2023298 0 0 0 0 1 50 1 35.07 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2023299 0 0 0 0 1 50 1 35.07 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2023332 0 0 0 0 1 50 1 35.07 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2023385 0 0 0 0 1 50 1 35.07 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2023259 0 0 0 0 1 30 1 24.71 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030303 0 0 0 0 1 20 1 13.92 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030287 0 0 0 0 1 25 1 18.87 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030445 0 0 0 0 1 25 1 20.44 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030309 0 0 0 0 1 25 1 19.66 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030268 0 0 0 0 1 15 1 10.22 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030270 0 0 0 0 1 30 1 20.83 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030459 0 0 0 0 1 5 1 4.40 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030360 0 0 0 0 1 20 1 17.69 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030363 0 0 0 0 1 100 1 75.48 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030272 0 0 0 0 1 50 1 38.92 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030278 0 0 0 0 1 20 1 18.55 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030426 0 0 0 0 1 20 1 18.16 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030310 0 0 0 0 1 5 1 1.57 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030311 0 0 0 0 1 15 1 10.54 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030312 0 0 0 0 1 15 1 10.54 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030398 0 0 0 0 1 20 1 11.48 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030334 0 0 0 0 1 50 1 37.11 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030290 0 0 0 0 1 30 1 25.16 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
2030435 0 0 0 0 1 15 1 9.28 0 0 0 0 0 0 0 0 0 0 0 0 0.0000 0.0000 0.0000 0.0000
42 changes: 42 additions & 0 deletions powersimdata/input/data/usa/gencost_case.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13418,3 +13418,45 @@ type startup shutdown n c2 c1 c0
2 0 0 3 0.002 18.671 802.56
2 0 0 3 0.002 18.73 757.5
2 0 0 3 0.002 18.693 747.3
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
2 0 0 3 0 0 0
42 changes: 42 additions & 0 deletions powersimdata/input/data/usa/gentype_case.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13417,3 +13417,45 @@
coal
ng
ng
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
geothermal
13 changes: 11 additions & 2 deletions powersimdata/input/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class Grid(object):
2: 'hydro',
3: 'ng',
4: 'nuclear',
5: 'coal'}
5: 'coal',
6: 'geothermal',
7: 'dfo'}

type2id = {v: k for k, v in id2type.items()}

Expand All @@ -23,7 +25,9 @@ class Grid(object):
'hydro': sns.xkcd_rgb["light blue"],
'ng': sns.xkcd_rgb["orchid"],
'nuclear': sns.xkcd_rgb["silver"],
'coal': sns.xkcd_rgb["light brown"]}
'coal': sns.xkcd_rgb["light brown"],
'geothermal': sns.xkcd_rgb["hot pink"],
'dfo': sns.xkcd_rgb["royal blue"]}

def __init__(self, interconnect):
"""Constructor.
Expand Down Expand Up @@ -210,6 +214,11 @@ def _read_plant(self):
['GenMWMax', 'GenMWMin']]], axis=1)
self.plant['type'] = plant_type

# Temporary fix
for i in self.plant.index[self.plant.type == 'geothermal'].tolist():
self.plant.loc[i, 'GenMWMin'] = self.plant.loc[i, 'Pmin']
self.plant.loc[i, 'GenMWMax'] = self.plant.loc[i, 'Pmax']

# Interconnect
self.plant['interconnect'] = 'Eastern'
self.plant.loc[self.plant.bus_id > 2000000, 'interconnect'] = 'Western'
Expand Down
10 changes: 7 additions & 3 deletions powersimdata/input/scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class Scaler(object):
:param dict scenario_info: scenario information.
:param paramiko.client.SSHClient ssh_client: session with an SSH server.
"""

_gen_types = [
'coal', 'dfo', 'geothermal', 'ng', 'nuclear', 'hydro', 'solar', 'wind']
_thermal_gen_types = ['coal', 'dfo', 'geothermal', 'ng', 'nuclear']

def __init__(self, scenario_info, ssh_client):
"""Constructor.
Expand Down Expand Up @@ -46,7 +50,7 @@ def get_grid(self):
"""
self._grid = copy.deepcopy(self._original_grid)
if bool(self.ct):
for r in ['coal', 'ng', 'nuclear', 'hydro', 'solar', 'wind']:
for r in self._gen_types:
if r in list(self.ct.keys()):
try:
for key, value in self.ct[r]['zone_id'].items():
Expand All @@ -56,7 +60,7 @@ def get_grid(self):
for i in plant_id:
self._grid.plant.loc[i, 'GenMWMax'] = \
self._grid.plant.loc[i, 'GenMWMax'] * value
if r in ['coal', 'ng', 'nuclear']:
if r in self._thermal_gen_types:
self._grid.plant.loc[i, 'Pmax'] = \
self._grid.plant.loc[i, 'Pmax'] * value
except KeyError:
Expand All @@ -65,7 +69,7 @@ def get_grid(self):
for key, value in self.ct[r]['plant_id'].items():
self._grid.plant.loc[key, 'GenMWMax'] = \
self._grid.plant.loc[key, 'GenMWMax'] * value
if r in ['coal', 'ng', 'nuclear']:
if r in self._thermal_gen_types:
self._grid.plant.loc[key, 'Pmax'] = \
self._grid.plant.loc[key, 'Pmax'] * value
except KeyError:
Expand Down
Loading

0 comments on commit e0cb34a

Please sign in to comment.