using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query normalised time series...
TRANSCRIPT
![Page 1: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/1.jpg)
1 | open energy modelling framework | [email protected]
Using the oemof cosmos to create feed-in time series – de 21 oemof – a community project to make energy modelling transparent and shareable
Uwe Krien
10. Mai 2017, oemof user meeting 2017
![Page 2: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/2.jpg)
2 | open energy modelling framework | [email protected]
de21– python as connector
pvlib
demandlib
weather data
csv-scenariooemof.solph
open power data
open energy db
demandlib
windpowerlib
![Page 3: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/3.jpg)
3 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
weatherdatabase
sql-query
Normalised time series PV/Wind
power plantscsv files
download / read
DataFrame DataFrame
DataFrame
region polygonscsv file
read
GeoDataFrame
Feedin perregion PV/Wind
DataFramesolph.Source
objects
![Page 4: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/4.jpg)
4 | open energy modelling framework | [email protected]
de21 – using python
● Database– SQLAlchemy– Psycopg
● Downloads– Requests
● GIS operations– Shapely– Postgis (see database)– GeoPandas– PyQGIS
● Input/output– pandas
![Page 5: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/5.jpg)
5 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
weatherdatabase
sql-query
Normalised time series PV/Wind
power plantscsv files
download / read
DataFrame DataFrame
DataFrame
region polygonscsv file
read
GeoDataFrame
Feedin perregion PV/Wind
DataFramesolph.Source
objects
![Page 6: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/6.jpg)
6 | open energy modelling framework | [email protected]
de21 – pandas.DataFrame
● CSV: read_csv, to_csv● JSON: read_json, to_json
● HTML: read_html, to_html● HDF5 : read_hdf, to_hdf ● Clipboard: read_clipboard, to_clipboard● MS Excel: read_excel, to_excel● Python Pickle:read_pickle, to_pickle
● SQL: read_sql, to_sql● Google Big Query: read_gbq, to_gbq
![Page 7: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/7.jpg)
7 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
weatherdatabase
sql-query
Normalised time series PV/Wind
power plantscsv files
download / read
DataFrame DataFrame
DataFrame
region polygonscsv file
read
GeoDataFrame
Feedin perregion PV/Wind
DataFramesolph.Source
objects
![Page 8: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/8.jpg)
8 | open energy modelling framework | [email protected]
de21 – feedinlin (windpowerlib, pvlib)
● pvlib – surface azimuth– surface tilt– module type
● windpowerlib– selection by average wind speed– type of turbine – hub height– diameter of rotor
![Page 9: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/9.jpg)
9 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
weatherdatabase
sql-query
Normalised time series PV/Wind
power plantscsv files
download / read
DataFrame DataFrame
DataFrame
region polygonscsv file
read
GeoDataFrame
Feedin perregion PV/Wind
DataFramesolph.Source
objects
![Page 11: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/11.jpg)
11 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
weatherdatabase
sql-query
Normalised time series PV/Wind
power plantscsv files
download / read
DataFrame DataFrame
DataFrame
region polygonscsv file
read
GeoDataFrame
Feedin perregion PV/Wind
DataFramesolph.Source
objects
![Page 12: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/12.jpg)
12 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types:
name = region + '_' + pp_type time_series = feedin[(pp_type, reg)]
capacity = capacities[(pp_type, reg)]
solph.Source(label=name, outputs={bus_elec: solph.Flow( actual_value=time_series, nominal_value=capacity, fixed=True)})
![Page 13: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/13.jpg)
13 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types:
name = region + '_' + pp_type time_series = feedin[(pp_type, reg)]
capacity = capacities[(pp_type, reg)]
solph.Source(label=name, outputs={bus_elec: solph.Flow( actual_value=time_series, nominal_value=capacity, fixed=True)})
![Page 15: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/15.jpg)
15 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types:
name = region + '_' + pp_type time_series = feedin[(pp_type, reg)]
capacity = capacities[(pp_type, reg)]
solph.Source(label=name, outputs={bus_elec: solph.Flow( actual_value=time_series, nominal_value=capacity, fixed=True)})
![Page 16: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/16.jpg)
16 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types:
name = region + '_' + pp_type time_series = feedin[(pp_type, reg)]
capacity = capacities[(pp_type, reg)]
solph.Source(label=name, outputs={bus_elec: solph.Flow( actual_value=time_series, nominal_value=capacity, fixed=True)})
![Page 17: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/17.jpg)
17 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types:
name = region + '_' + pp_type time_series = feedin[(pp_type, reg)]
capacity = capacities[(pp_type, reg)]
solph.Source(label=name, outputs={bus_elec: solph.Flow( actual_value=time_series, nominal_value=capacity, fixed=True)})
![Page 18: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/18.jpg)
18 | open energy modelling framework | [email protected]
de21 – solph.Source object from open data
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types:
name = region + '_' + pp_type time_series = feedin[(pp_type, reg)]
capacity = capacities[(pp_type, reg)]
solph.Source(label=name, outputs={bus_elec: solph.Flow( actual_value=time_series, nominal_value=capacity, fixed=True)})
![Page 19: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/19.jpg)
19 | open energy modelling framework | [email protected]
de21 – solph csv file from open data
de21 = solph.Scenario(path='scenarios', name='cool_scenario')de21.create_tables()
feedin = pandas.read_csv('feedin_de21.csv')capacity = pandas.read_csv('re_capacities_de21.csv')
regions = ['de01', 'de02', ...]pp_types = ['pv', 'wind']
for region in regions: for pp_type in pp_types: name = region + '_' + pp_type
time_series = feedin[(pp_type, reg)] capacity = capacities[(pp_type, reg)]
target = region + '_bus_el' idx = ('Source', name, name, target) cols = ['nominal_value', 'actual_value', 'fixed'] values = [capacity, 'seq', 1] de21.add_parameters(idx, cols, values)
idx = ['Source', name, name, target, 'actual_value'] de21.add_sequences(idx, time_series)de21.write_tables()
![Page 20: Using the oemof cosmos to create feed-in time …...2017/05/10 · sql-query Normalised time series PV/Wind power plants csv files download / read DataFrame DataFrame DataFrame region](https://reader033.vdocuments.mx/reader033/viewer/2022041820/5e5d1e93606f647dc14b0cfd/html5/thumbnails/20.jpg)
20 | open energy modelling framework | [email protected]
Using the oemof cosmos – de21
Any questions?
● pandas for i/o conversions● different python packages to fetch/process data● windpowerlib / pvlib / feedinlib● creating solph objects by looping DataFrames