updated Snakefile and build_line_rating.py
This commit is contained in:
parent
ba767c630d
commit
7e628f66c5
@ -215,13 +215,13 @@ if 'hydro' in config['renewable'].keys():
|
||||
resources: mem=5000
|
||||
script: 'scripts/build_hydro_profile.py'
|
||||
|
||||
if config['lines'].get('dynamic_line_rating', True):
|
||||
if config['lines'].get('line_rating', False):
|
||||
rule build_line_rating:
|
||||
input:
|
||||
base_network="networks/base.nc",
|
||||
cutout="cutouts/" + config["renewable"]['onwind']['cutout'] + ".nc"
|
||||
cutout="cutouts/" + config["lines"]['cutout'] + ".nc"
|
||||
output:
|
||||
output="networks/base_line_rating.nc"
|
||||
output="networks/base_lr.nc"
|
||||
log: "logs/build_line_rating.log"
|
||||
benchmark: "benchmarks/build_line_rating"
|
||||
threads: 1
|
||||
@ -230,7 +230,7 @@ if config['lines'].get('dynamic_line_rating', True):
|
||||
|
||||
rule add_electricity:
|
||||
input:
|
||||
base_network = rules.build_line_rating.output[0] if config['lines'].get('dynamic_line_rating', True) else rules.base_network.output[0],
|
||||
base_network = "networks/base_lr.nc" if config['lines'].get('line_rating', False) else "networks/base.nc",
|
||||
tech_costs=COSTS,
|
||||
regions="resources/regions_onshore.geojson",
|
||||
powerplants='resources/powerplants.csv',
|
||||
|
@ -66,7 +66,6 @@ def add_line_rating(n):
|
||||
shapes = [Line([Point(x[b0], y[b0]), Point(x[b1], y[b1])]) for (b0, b1) in buses]
|
||||
shapes = gpd.GeoSeries(shapes, index=n.lines.index)
|
||||
cutout = atlite.Cutout(snakemake.input.cutout)
|
||||
cutout.prepare(features=['temperature', "wnd100m", "height", "wnd_azimuth"])
|
||||
s = np.sqrt(3) * cutout.line_rating(shapes, n.lines.r/n.lines.length) * 1e3 # in MW
|
||||
n.lines_t.s_max_pu=s.to_pandas().transpose()/n.lines.s_nom
|
||||
n.lines_t.s_max_pu.replace(np.inf, 1.0, inplace=True)
|
||||
|
Loading…
Reference in New Issue
Block a user