Skip to content

Commit

Permalink
Smaller fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Sep 20, 2024
1 parent 2cdbada commit 042c8b4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
4 changes: 4 additions & 0 deletions RawDataProcessing/Modules/Submodules/get_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from pybalmorel import Balmorel
from pybalmorel.utils import symbol_to_df
from Submodules.municipal_template import DataContainer
from clustering import convert_municipal_code_to_name

style = 'report'

Expand Down
50 changes: 26 additions & 24 deletions RawDataProcessing/Modules/energinet_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,29 @@
energinet_el.to_netcdf('Data/Timeseries/energinet_eldem.nc')

if __name__ == '__main__':
# Example on merging with other data
x = DataContainer()
x.muni = x.muni.merge(energinet_el)


for user in x.muni.electricity_demand_mwh.coords['user']:
fig, ax = plt.subplots()
x.get_polygons().plot(
column=x.muni.electricity_demand_mwh.sum(dim=['year', 'week', 'hour']).sel(user=user).data,
legend=True,
ax=ax
).set_title(str(user.data))


dataset = convert_coordname_elements(energinet_el,
'electricity_demand_mwh',
{'municipality' : 'R',
'user' : 'DEUSER',
'year' : 'Y',
'week' : 'S',
'hour' : 'T'},
{'user' : {'industry' : 'PII',
'public' : 'OTHER',
'residential' : 'RESE'}})
merge_example = False
if merge_example:
# Example on merging with other data
x = DataContainer()
x.muni = x.muni.merge(energinet_el)


for user in x.muni.electricity_demand_mwh.coords['user']:
fig, ax = plt.subplots()
x.get_polygons().plot(
column=x.muni.electricity_demand_mwh.sum(dim=['year', 'week', 'hour']).sel(user=user).data,
legend=True,
ax=ax
).set_title(str(user.data))


dataset = convert_coordname_elements(energinet_el,
'electricity_demand_mwh',
{'municipality' : 'R',
'user' : 'DEUSER',
'year' : 'Y',
'week' : 'S',
'hour' : 'T'},
{'user' : {'industry' : 'PII',
'public' : 'OTHER',
'residential' : 'RESE'}})

0 comments on commit 042c8b4

Please sign in to comment.