fix land eligibility calculation for UA and MD

This commit is contained in:
Fabian Neumann 2023-03-31 12:06:10 +02:00
parent eddde8fb3a
commit 55d111e7af
2 changed files with 7 additions and 16 deletions

View File

@ -412,6 +412,7 @@ rule build_renewable_profiles:
+ CDIR + CDIR
+ config["renewable"][w.technology]["cutout"] + config["renewable"][w.technology]["cutout"]
+ ".nc", + ".nc",
**opt
output: output:
profile="resources/" + RDIR + "profile_{technology}.nc", profile="resources/" + RDIR + "profile_{technology}.nc",
log: log:

View File

@ -1,19 +1,14 @@
#!/usr/bin/env python # -*- coding: utf-8 -*-
# coding: utf-8 # SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
# In[ ]:
import progressbar as pgb
import geopandas as gpd import geopandas as gpd
import xarray as xr
import numpy as np import numpy as np
import functools import functools
import atlite import atlite
import logging import logging
import time import time
import matplotlib.pyplot as plt
from _helpers import mock_snakemake
from _helpers import configure_logging from _helpers import configure_logging
@ -27,13 +22,12 @@ if __name__ == "__main__":
"determine_availability_matrix_MD_UA", technology="solar" "determine_availability_matrix_MD_UA", technology="solar"
) )
configure_logging(snakemake) configure_logging(snakemake)
pgb.streams.wrap_stderr()
nprocesses = snakemake.config["atlite"].get("nprocesses") nprocesses = snakemake.config["atlite"].get("nprocesses")
noprogress = not snakemake.config["atlite"].get("show_progress", True) noprogress = not snakemake.config["atlite"].get("show_progress", True)
config = snakemake.config["renewable"][snakemake.wildcards.technology] config = snakemake.config["renewable"][snakemake.wildcards.technology]
cutout = atlite.Cutout(snakemake.input["cutout"]) cutout = atlite.Cutout(snakemake.input.cutout)
regions = ( regions = (
gpd.read_file(snakemake.input.regions).set_index("name").rename_axis("bus") gpd.read_file(snakemake.input.regions).set_index("name").rename_axis("bus")
) )
@ -120,8 +114,4 @@ if __name__ == "__main__":
availability = availability.sel(bus=buses) availability = availability.sel(bus=buses)
# Save and plot for verification # Save and plot for verification
availability.to_netcdf(snakemake.output["availability_matrix"]) availability.to_netcdf(snakemake.output.availability_matrix)
# availability.sum(dim="bus").plot()
# plt.title(technology)
# plt.show()