Skip to content

Commit 1956759

Browse files
committed
Merge branch 'release/v0.3' of github.com:openego/data_processing into release/v0.3
2 parents 30f4dd3 + f9de658 commit 1956759

9 files changed

Lines changed: 557 additions & 783 deletions

dataprocessing/sql_snippets/ego_dp_powerflow_lopf_data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ FROM (
9393
GROUP BY T2.generator_id
9494
) T3 WHERE T3.generator_id = Y.generator_id;
9595

96-
--DELETE * FROM model_draft.ego_grid_pf_hv_storage;
96+
DELETE FROM model_draft.ego_grid_pf_hv_storage WHERE scn_name IN ('Status Quo', 'NEP 2035', 'eGo 100') AND source = 16;
9797

9898
-- Insert battery storages to all substations (Status Quo)
9999
INSERT INTO model_draft.ego_grid_pf_hv_storage

dataprocessing/sql_snippets/ego_dp_powerflow_timeseries_generator.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ INSERT into model_draft.ego_grid_pf_hv_generator
244244
when source LIKE '%%uranium%%' THEN 5
245245
when source LIKE '%%biomass%%' THEN 6
246246
when source LIKE '%%hard_coal%%' THEN 8
247+
when source LIKE '%%reservoir%%' THEN 10
248+
when source LIKE '%%geothermal%%' THEN 14
249+
when source
247250
END AS source
248251
FROM calc_renpass_gis.renpass_gis_linear_transformer A join
249252
(
@@ -291,6 +294,8 @@ INSERT into model_draft.ego_grid_pf_hv_generator
291294
when source LIKE '%%uranium%%' THEN 5
292295
when source LIKE '%%biomass%%' THEN 6
293296
when source LIKE '%%hard_coal%%' THEN 8
297+
when source LIKE '%%reservoir%%' THEN 10
298+
when source LIKE '%%geothermal%%' THEN 14
294299
END AS source
295300
FROM calc_renpass_gis.renpass_gis_linear_transformer A join
296301
(
@@ -337,6 +342,8 @@ INSERT into model_draft.ego_grid_pf_hv_generator
337342
when source LIKE '%%uranium%%' THEN 5
338343
when source LIKE '%%biomass%%' THEN 6
339344
when source LIKE '%%hard_coal%%' THEN 8
345+
when source LIKE '%%reservoir%%' THEN 10
346+
when source LIKE '%%geothermal%%' THEN 14
340347
END AS source
341348
FROM calc_renpass_gis.renpass_gis_linear_transformer A join
342349
(
@@ -508,8 +515,10 @@ CREATE MATERIALIZED VIEW calc_renpass_gis.translate_to_pf AS
508515
WHEN A.source = 6 THEN 'biomass'
509516
WHEN A.source = 8 THEN 'hard_coal'
510517
WHEN A.source = 9 THEN 'run_of_river'
518+
WHEN A.source = 10 THEN 'reservoir'
511519
WHEN A.source = 12 THEN 'solar'
512520
WHEN A.source = 13 THEN 'wind'
521+
WHEN A.source = 14 THEN 'geothermal'
513522
END AS renpass_gis_source
514523
FROM model_draft.ego_grid_pf_hv_generator A join
515524
model_draft.ego_grid_hv_electrical_neighbours_bus B
@@ -562,8 +571,10 @@ CREATE MATERIALIZED VIEW calc_renpass_gis.translate_to_pf AS
562571
WHEN A.source = 6 THEN 'biomass'
563572
WHEN A.source = 8 THEN 'hard_coal'
564573
WHEN A.source = 9 THEN 'run_of_river'
574+
WHEN A.source = 10 THEN 'reservoir'
565575
WHEN A.source = 12 THEN 'solar'
566576
WHEN A.source = 13 THEN 'wind'
577+
WHEN A.source = 14 THEN 'geothermal'
567578
END AS renpass_gis_source
568579
FROM model_draft.ego_grid_pf_hv_generator A join
569580
model_draft.ego_grid_hv_electrical_neighbours_bus B
@@ -616,8 +627,10 @@ CREATE MATERIALIZED VIEW calc_renpass_gis.translate_to_pf AS
616627
WHEN A.source = 6 THEN 'biomass'
617628
WHEN A.source = 8 THEN 'hard_coal'
618629
WHEN A.source = 9 THEN 'run_of_river'
630+
WHEN A.source = 10 THEN 'reservoir'
619631
WHEN A.source = 12 THEN 'solar'
620632
WHEN A.source = 13 THEN 'wind'
633+
WHEN A.source = 14 THEN 'geothermal'
621634
END AS renpass_gis_source
622635
FROM model_draft.ego_grid_pf_hv_generator A join
623636
model_draft.ego_grid_hv_electrical_neighbours_bus B

dataprocessing/sql_snippets/ego_dp_versioning.sql

Lines changed: 84 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,50 @@ SELECT ego_scenario_log('v0.3.0','result','demand','ego_dp_loadarea','ego_dp_ver
151151
/* DELETE FROM supply.ego_dp_conv_powerplant
152152
WHERE version = 'v0.3.0'; */
153153

154-
INSERT INTO supply.ego_dp_conv_powerplant
154+
INSERT INTO supply.ego_dp_conv_powerplant
155155
SELECT 'v0.3.0',
156-
*
157-
FROM model_draft.ego_supply_conv_powerplant;
156+
id,
157+
bnetza_id,
158+
company,
159+
name,
160+
postcode,
161+
city,
162+
street,
163+
state,
164+
block,
165+
commissioned_original,
166+
commissioned,
167+
retrofit,
168+
shutdown,
169+
status,
170+
fuel,
171+
technology,
172+
type,
173+
eeg,
174+
chp,
175+
capacity,
176+
capacity_uba,
177+
chp_capacity_uba,
178+
efficiency_data,
179+
efficiency_estimate,
180+
network_node,
181+
voltage,
182+
network_operator,
183+
name_uba,
184+
lat,
185+
lon,
186+
comment,
187+
geom,
188+
voltage_level,
189+
subst_id,
190+
otg_id,
191+
un_id,
192+
preversion,
193+
la_id,
194+
scenario,
195+
flag,
196+
nuts
197+
FROM model_draft.ego_dp_supply_conv_powerplant;
158198

159199
-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
160200
SELECT ego_scenario_log('v0.3.0','result','supply','ego_dp_conv_powerplant','ego_dp_versioning.sql','versioning');
@@ -165,8 +205,47 @@ SELECT ego_scenario_log('v0.3.0','result','supply','ego_dp_conv_powerplant','ego
165205

166206
INSERT INTO supply.ego_dp_res_powerplant
167207
SELECT 'v0.3.0',
168-
*
169-
FROM model_draft.ego_supply_res_powerplant;
208+
id,
209+
start_up_date,
210+
electrical_capacity,
211+
generation_type,
212+
generation_subtype,
213+
thermal_capacity,
214+
city,
215+
postcode,
216+
address,
217+
lon,
218+
lat,
219+
gps_accuracy,
220+
validation,
221+
notification_reason,
222+
eeg_id,
223+
tso,
224+
tso_eic,
225+
dso_id,
226+
dso,
227+
voltage_level_var,
228+
network_node,
229+
power_plant_id,
230+
source,
231+
comment,
232+
geom,
233+
subst_id,
234+
otg_id,
235+
un_id,
236+
voltage_level,
237+
la_id,
238+
mvlv_subst_id,
239+
rea_sort,
240+
rea_flag,
241+
rea_geom_line,
242+
rea_geom_new,
243+
preversion,
244+
flag,
245+
scenario,
246+
nuts
247+
248+
FROM model_draft.ego_dp_supply_res_powerplant;
170249

171250
-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
172251
SELECT ego_scenario_log('v0.3.0','result','supply','ego_dp_res_powerplant','ego_dp_versioning.sql','versioning');

preprocessing/sql_snippets/ego_dp_conv_by_scenario.sql

Lines changed: 0 additions & 209 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ __author__ = "wolfbunke"
1313
Notes:
1414
------
1515
16-
Part I:
17-
Set up Status Quo data and create standardized table of all scenarios
1816
Part II:
1917
Power plants by NEP 2035 scenario data
2018
Part III:
@@ -30,213 +28,6 @@ Documentation:
3028
3129
*/
3230

33-
-- ego scenario log (version,io,schema_name,table_name,script_name,comment)
34-
SELECT ego_scenario_log('v0.3.0','input','supply','ego_dp_supply_conv_powerplant',' .sql','');
35-
36-
DROP TABLE IF EXISTS model_draft.ego_dp_supply_conv_powerplant CASCADE;
37-
CREATE TABLE model_draft.ego_dp_supply_conv_powerplant
38-
(
39-
preversion text NOT NULL,
40-
id integer NOT NULL,
41-
bnetza_id text,
42-
company text,
43-
name text,
44-
postcode text,
45-
city text,
46-
street text,
47-
state text,
48-
block text,
49-
commissioned_original text,
50-
commissioned double precision,
51-
retrofit double precision,
52-
shutdown double precision,
53-
status text,
54-
fuel text,
55-
technology text,
56-
type text,
57-
eeg text,
58-
chp text,
59-
capacity double precision,
60-
capacity_uba double precision,
61-
chp_capacity_uba double precision,
62-
efficiency_data double precision,
63-
efficiency_estimate double precision,
64-
network_node text,
65-
voltage text,
66-
network_operator text,
67-
name_uba text,
68-
lat double precision,
69-
lon double precision,
70-
comment text,
71-
geom geometry(Point,4326),
72-
voltage_level smallint,
73-
subst_id bigint,
74-
otg_id bigint,
75-
un_id bigint,
76-
la_id integer,
77-
scenario text,
78-
flag text,
79-
nuts varchar,
80-
CONSTRAINT ego_dp_supply_conv_powerplant_pkey PRIMARY KEY (preversion,id,scenario)
81-
)
82-
WITH (
83-
OIDS=FALSE
84-
);
85-
86-
ALTER TABLE model_draft.ego_dp_supply_conv_powerplant
87-
OWNER TO oeuser;
88-
89-
GRANT ALL ON TABLE model_draft.ego_dp_supply_conv_powerplant TO oeuser;
90-
91-
--DROP INDEX model_draft.ego_dp_supply_res_powerplant_idx;
92-
CREATE INDEX ego_dp_supply_conv_powerplant_idx
93-
ON model_draft.ego_dp_supply_conv_powerplant
94-
USING gist
95-
(geom);
96-
-- metadata description
97-
98-
COMMENT ON TABLE model_draft.ego_dp_supply_conv_powerplant
99-
IS
100-
'{
101-
"title": "eGo Conventional power plants in Germany by Scenario",
102-
"description": "This dataset contains an augmented and corrected power plant list based on the power plant list provided by the OPSD (BNetzA and UBA) and NEP Kraftwerksliste 2015 for the scenario B1-2035 and the ZNES scenario eGo 100 in 2050.",
103-
"language": [ "eng", "ger" ],
104-
"spatial":
105-
{"location": "Germany",
106-
"extent": "europe",
107-
"resolution": "100 m"},
108-
"temporal":
109-
{"reference_date": "2016-01-01",
110-
"start": "1900-01-01",
111-
"end": "2049-12-31",
112-
"resolution": ""},
113-
"sources": [
114-
{"name": "eGo data processing",
115-
"description": "Scripts with allocate Geometry by OpenStreetMap Objects or create future scenarios by high resolution geo-allocation",
116-
"url": "https://github.com/openego/data_processing",
117-
"license": "GNU Affero General Public License Version 3 (AGPL-3.0)",
118-
"copyright": "© ZNES Europa-Universität Flensburg"},
119-
120-
{"name": "Open Power System Data (OPSD)",
121-
"url": "http://data.open-power-system-data.org/conventional_power_plants/2016-02-08/",
122-
"license": "Creative Commons Attribution 4.0 International",
123-
"copyright": "© Open Power System Data. 2017"},
124-
125-
{"name": "Bundesnetzagentur (BNetzA)",
126-
"description": "The Federal Network Agency for Electricity, Gas, Telecommunications, Posts and Railway Data is in Germany data provider of power plant",
127-
"url": "https://www.bundesnetzagentur.de/DE/Sachgebiete/ElektrizitaetundGas/Unternehmen_Institutionen/ErneuerbareEnergien/Anlagenregister/Anlagenregister_Veroeffentlichung/Anlagenregister_Veroeffentlichungen_node.html",
128-
"license": "Creative Commons Namensnennung-Keine Bearbeitung 3.0 Deutschland Lizenz",
129-
"copyright": "© Bundesnetzagentur für Elektrizität, Gas, Telekommunikation, Post und Eisenbahnen; Pressestelle"}
130-
],
131-
"license": [
132-
{"id": "ODbL-1.0",
133-
"name": "Open Data Commons Open Database License 1.0",
134-
"version": "1.0",
135-
"url": "https://opendatacommons.org/licenses/odbl/1.0/",
136-
"instruction": "You are free: To Share, To Create, To Adapt; As long as you: Attribute, Share-Alike, Keep open!",
137-
"copyright": "© ZNES Europa-Universität Flensburg"} ],
138-
"contributors": [
139-
{"name": "wolfbunke", "email": " ", "date": "01.06.2017", "comment": "Create and restructure scripts and table"}],
140-
"resources": [
141-
{"name": "model_draft.ego_dp_supply_conv_powerplant",
142-
"format": "PostgreSQL",
143-
"fields": [
144-
{"name": "preversion", "description": "Preversion ID of data preprocessing", "unit": "" },
145-
{"name": "id", "description": "Unique identifier", "unit": "" },
146-
{"name": "bnetza_id", "description": "Bundesnetzagentur unit ID", "unit": " " },
147-
{"name": "company", "description": "Name of company", "unit": " " },
148-
{"name": "name", "description": "name of unit ", "unit": " " },
149-
{"name": "postcode", "description": "postcode ", "unit": " " },
150-
{"name": "city", "description": "Name of City", "unit": " " },
151-
{"name": "street", "description": "Street name, address", "unit": " " },
152-
{"name": "state", "description": "Name of federate state of location", "unit": " " },
153-
{"name": "block", "description": "Power plant block", "unit": " " },
154-
{"name": "commissioned_original", "description": "Year of commissioning (raw data)", "unit": " " },
155-
{"name": "commissioned", "description": "Year of commissioning", "unit": " " },
156-
{"name": "retrofit", "description": "Year of modernization according to UBA data", "unit": " " },
157-
{"name": "shutdown", "description": "Year of decommissioning", "unit": " " },
158-
{"name": "status", "description": "Power plant status", "unit": " " },
159-
{"name": "fuel", "description": "Used fuel or energy source", "unit": " " },
160-
{"name": "technology", "description": "Power plant technology or sort", "unit": " " },
161-
{"name": "type", "description": "Purpose of the produced power", "unit": " " },
162-
{"name": "eeg", "description": "Status of being entitled to a renumeration", "unit": " " },
163-
{"name": "chp", "description": "Status of being able to supply heat", "unit": " " },
164-
{"name": "capacity", "description": "Power capacity", "unit": " " },
165-
{"name": "capacity_uba", "description": "Power capacity according to UBA data", "unit": " " },
166-
{"name": "chp_capacity_uba", "description": "Heat capacity according to UBA data", "unit": " " },
167-
{"name": "efficiency_data", "description": "Proportion between power output and input", "unit": " " },
168-
{"name": "efficiency_estimate", "description": "Estimated proportion between power output and input", "unit": " " },
169-
{"name": "network_node", "description": "Connection point to the electricity grid", "unit": " " },
170-
{"name": "voltage", "description": "Grid or transformation level of the network node", "unit": " " },
171-
{"name": "network_operator", "description": "Network operator of the grid or transformation level", "unit": " " },
172-
{"name": "name_uba", "description": "Power plant name according to UBA data", "unit": " " },
173-
{"name": "lat", "description": "Precise geographic coordinates - latitude", "unit": " " },
174-
{"name": "lon", "description": "Precise geographic coordinates - longitude", "unit": " " },
175-
{"name": "comment", "description": "Further comments", "unit": " " },
176-
{"name": "geom", "description": "Geometry Point", "unit": " " },
177-
{"name": "voltage_level", "description": " ", "unit": " " },
178-
{"name": "subst_id", "description": "Unique identifier of related substation", "unit": "" },
179-
{"name": "otg_id", "description": "Unique identifier of related substation from osmTGmod", "unit": "" },
180-
{"name": "un_id", "description": "Unique identifier of RES and CONV power plants", "unit": "" },
181-
{"name": "la_id", "description": "Unique identifier of RES and CONV power plants", "unit": "" },
182-
{"name": "scenario", "description": "Name of scenario", "unit": "" },
183-
{"name": "flag", "description": "Flag of scenario changes of an power plant unit (repowering, decommission or commissioning).", "unit": "" },
184-
{"name": "nuts", "description": "NUTS ID).", "unit": ""} ] } ],
185-
"meta_version": "1.3" }';
186-
187-
-- select description
188-
SELECT obj_description('model_draft.ego_dp_supply_conv_powerplant'::regclass)::json;
189-
190-
--------------------------------------------------------------------------------
191-
-- Part I
192-
-- Insert conventional power plants Scenarios: Status-Quo
193-
--------------------------------------------------------------------------------
194-
195-
INSERT INTO model_draft.ego_dp_supply_conv_powerplant
196-
SELECT
197-
'v0.3.0'::text as preversion,
198-
gid as id,
199-
bnetza_id,
200-
company,
201-
name,
202-
postcode,
203-
city,
204-
street,
205-
state,
206-
block,
207-
commissioned_original,
208-
commissioned,
209-
retrofit,
210-
shutdown,
211-
status,
212-
fuel,
213-
technology,
214-
type,
215-
eeg,
216-
chp,
217-
capacity,
218-
capacity_uba,
219-
chp_capacity_uba,
220-
efficiency_data,
221-
efficiency_estimate,
222-
network_node,
223-
voltage,
224-
network_operator,
225-
name_uba,
226-
lat,
227-
lon,
228-
comment,
229-
geom,
230-
voltage_level,
231-
subst_id,
232-
otg_id,
233-
un_id,
234-
NULL::int as la_id,
235-
'Status Quo'::text as scenario,
236-
NULL::text as flag,
237-
NULL::text as nuts
238-
FROM
239-
model_draft.ego_supply_conv_powerplant;
24031

24132
--------------------------------------------------------------------------------
24233
-- Part II

0 commit comments

Comments
 (0)