Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
smuellr committed Nov 14, 2015
1 parent 7caedd2 commit 5f864d0
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions urbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,22 +1643,17 @@ def plot(prob, com, sit, timesteps=None, power_unit='MW', energy_unit='MWh'):

# sorting plot elements
# calculate standard deviation possibly normed by mean value, takes ~10-100ms
std = pd.DataFrame(np.zeros_like(created.tail(1)),
index=created.index[-1:]+1, columns=created.columns)
for col in std.columns:
std[col] = np.std(created[col])
# norming by mean value
std[col] = std[col] / np.mean(created[col])
# keep order and only place base load at bottom
#if std[i] < 0.01:
# std[i] = -1
#else:
# std[i] = i
#i = i+1
# sort created ascencing with std i.e. base load first
created = created.append(std)
new_columns = created.columns[created.ix[created.last_valid_index()].argsort()]
created = created[new_columns][:-1]
if len(created.columns) > 1:
std = pd.DataFrame(np.zeros_like(created.tail(1)),
index=created.index[-1:]+1, columns=created.columns)
for col in std.columns:
std[col] = np.std(created[col])
# norming by mean value
std[col] = std[col] / np.mean(created[col])
# sort created ascencing with std i.e. base load first
created = created.append(std)
new_columns = created.columns[created.ix[created.last_valid_index()].argsort()]
created = created[new_columns][:-1]

# PLOT CREATED
ax0 = plt.subplot(gs[0])
Expand Down

0 comments on commit 5f864d0

Please sign in to comment.