Skip to content

Commit

Permalink
Merge branch 'master' into fix-reserve-constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
fneum authored Apr 21, 2023
2 parents 1cd658c + 0c3868b commit 92895ec
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ sector:
solar_cf_correction: 0.788457 # = >>> 1/1.2683
marginal_cost_storage: 0. #1e-4
methanation: true
helmeth: true
helmeth: false
coal_cc: false
dac: true
co2_vent: false
Expand Down
13 changes: 8 additions & 5 deletions envs/environment.fixed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,14 @@ dependencies:
- qt-main=5.15.8
- rasterio=1.3.4
- readline=8.1.2
- requests=2.28.2
- reretry=0.11.8
- rtree=1.0.1
- scikit-learn=1.2.1
- scipy=1.10.0
- requests=2.28.1
- retry=0.9.2
- rich=12.5.1
- rioxarray=0.13.3
- rtree=1.0.0
- s2n=1.0.10
- scikit-learn=1.1.1
- scipy=1.8.1
- scotch=6.0.9
- seaborn=0.12.2
- seaborn-base=0.12.2
Expand Down
1 change: 1 addition & 0 deletions envs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies:
- pandas>=1.4
- geopandas>=0.11.0
- xarray
- rioxarray
- netcdf4
- networkx
- scipy
Expand Down
4 changes: 2 additions & 2 deletions rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ rule build_ship_raster:
],
),
output:
RESOURCES + "shipdensity_raster.nc",
RESOURCES + "shipdensity_raster.tif",
log:
LOGS + "build_ship_raster.log",
resources:
Expand Down Expand Up @@ -202,7 +202,7 @@ rule build_renewable_profiles:
)
),
ship_density=lambda w: (
RESOURCES + "shipdensity_raster.nc"
RESOURCES + "shipdensity_raster.tif"
if "ship_threshold" in config["renewable"][w.technology].keys()
else []
),
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_biomass_potentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def convert_nuts2_to_regions(bio_nuts2, regions):
)
overlay[adjust_cols] = overlay[adjust_cols].multiply(overlay["share"], axis=0)

bio_regions = overlay.groupby("name").sum()
bio_regions = overlay.dissolve("name", aggfunc="sum")

bio_regions.drop(["area_nuts2", "share"], axis=1, inplace=True)

Expand Down
6 changes: 3 additions & 3 deletions scripts/build_ship_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import os
import zipfile

import xarray as xr
import rioxarray
from _helpers import configure_logging
from build_natura_raster import determine_cutout_xXyY

Expand All @@ -64,10 +64,10 @@

with zipfile.ZipFile(snakemake.input.ship_density) as zip_f:
zip_f.extract("shipdensity_global.tif")
with xr.open_rasterio("shipdensity_global.tif") as ship_density:
with rioxarray.open_rasterio("shipdensity_global.tif") as ship_density:
ship_density = ship_density.drop(["band"]).sel(
x=slice(min(xs), max(Xs)), y=slice(max(Ys), min(ys))
)
ship_density.to_netcdf(snakemake.output[0])
ship_density.rio.to_raster(snakemake.output[0])

os.remove("shipdensity_global.tif")

0 comments on commit 92895ec

Please sign in to comment.