build_*_profile(s): Move clip_p_min_pu into profile generation

This commit is contained in:
Jonas Hoersch 2018-12-21 13:44:59 +01:00
parent 6b29f34d51
commit 21b428d841
3 changed files with 16 additions and 7 deletions

View File

@ -72,12 +72,12 @@ renewable:
distance_grid_codes: [1, 2, 3, 4, 5, 6] distance_grid_codes: [1, 2, 3, 4, 5, 6]
natura: true natura: true
potential: conservative # or heuristic potential: conservative # or heuristic
clip_p_max_pu: 1.e-2
offwind-ac: offwind-ac:
cutout: europe-2013-era5 cutout: europe-2013-era5
resource: resource:
method: wind method: wind
turbine: NREL_ReferenceTurbine_5MW_offshore turbine: NREL_ReferenceTurbine_5MW_offshore
# ScholzPhd Tab 4.3.1: 10MW/km^2
capacity_per_sqkm: 3 capacity_per_sqkm: 3
# correction_factor: 0.93 # correction_factor: 0.93
corine: [44, 255] corine: [44, 255]
@ -85,6 +85,7 @@ renewable:
max_depth: 50 max_depth: 50
max_shore_distance: 80000 max_shore_distance: 80000
potential: conservative # or heuristic potential: conservative # or heuristic
clip_p_max_pu: 1.e-2
offwind-dc: offwind-dc:
cutout: europe-2013-era5 cutout: europe-2013-era5
resource: resource:
@ -98,6 +99,7 @@ renewable:
max_depth: 50 max_depth: 50
min_shore_distance: 80000 min_shore_distance: 80000
potential: conservative # or heuristic potential: conservative # or heuristic
clip_p_max_pu: 1.e-2
solar: solar:
cutout: europe-2013-sarah cutout: europe-2013-sarah
resource: resource:
@ -113,14 +115,14 @@ renewable:
14, 15, 16, 17, 18, 19, 20, 26, 31, 32] 14, 15, 16, 17, 18, 19, 20, 26, 31, 32]
natura: true natura: true
potential: conservative # or heuristic potential: conservative # or heuristic
clip_p_max_pu: 1.e-2
hydro: hydro:
cutout: europe-2013-era5 cutout: europe-2013-era5
carriers: [ror, PHS, hydro] carriers: [ror, PHS, hydro]
PHS_max_hours: 6 PHS_max_hours: 6
hydro_max_hours: "energy_capacity_totals_by_country" # one of energy_capacity_totals_by_country, hydro_max_hours: "energy_capacity_totals_by_country" # one of energy_capacity_totals_by_country,
# estimate_by_large_installations or a float # estimate_by_large_installations or a float
clip_min_inflow: 1.0
lines: lines:
types: types:
220.: "Al/St 240/40 2-bundle 220.0" 220.: "Al/St 240/40 2-bundle 220.0"
@ -166,7 +168,6 @@ costs:
solving: solving:
options: options:
formulation: kirchhoff formulation: kirchhoff
clip_p_max_pu: 1.e-2
load_shedding: true load_shedding: true
noisy_costs: true noisy_costs: true
min_iterations: 4 min_iterations: 4

View File

@ -9,7 +9,8 @@ import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(level=snakemake.config['logging_level']) logger.setLevel(level=snakemake.config['logging_level'])
cutout = atlite.Cutout(snakemake.config['renewable']['hydro']['cutout'], config = snakemake.config['renewable']['hydro']
cutout = atlite.Cutout(config['cutout'],
cutout_dir=os.path.dirname(snakemake.input.cutout)) cutout_dir=os.path.dirname(snakemake.input.cutout))
countries = snakemake.config['countries'] countries = snakemake.config['countries']
@ -22,4 +23,6 @@ inflow = cutout.runoff(shapes=country_shapes,
lower_threshold_quantile=True, lower_threshold_quantile=True,
normalize_using_yearly=eia_stats) normalize_using_yearly=eia_stats)
inflow.values[inflow.values < config.get('min_inflow', 1.)] = 0.
inflow.to_netcdf(snakemake.output[0]) inflow.to_netcdf(snakemake.output[0])

View File

@ -179,5 +179,10 @@ if __name__ == '__main__':
ds['underwater_fraction'] = xr.DataArray(underwater_fraction, [buses]) ds['underwater_fraction'] = xr.DataArray(underwater_fraction, [buses])
(ds.sel(bus=(ds['profile'].mean('time') > config.get('min_p_max_pu', 0.)) & (ds['p_nom_max'] > 0.)) # select only buses with some capacity and minimal capacity factor
.to_netcdf(snakemake.output.profile)) ds = ds.sel(bus=((ds['profile'].mean('time') > config.get('min_p_max_pu', 0.)) &
(ds['p_nom_max'] > config.get('min_p_nom_max', 0.))))
ds['profile'].values[ds['profile'].values < config.get('clip_p_max_pu')] = 0.
ds.to_netcdf(snakemake.output.profile)