Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable residential cooling #1275

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,15 @@ rule build_heat_demand:
heat_demand_total="resources/"
+ SECDIR
+ "demand/heat/heat_demand_total_elec_s{simpl}_{clusters}_{planning_horizons}.nc",
cooling_demand_urban="resources/"
+ SECDIR
+ "demand/heat/cooling_demand_urban_elec_s{simpl}_{clusters}_{planning_horizons}.nc",
cooling_demand_rural="resources/"
+ SECDIR
+ "demand/heat/cooling_demand_rural_elec_s{simpl}_{clusters}_{planning_horizons}.nc",
cooling_demand_total="resources/"
+ SECDIR
+ "demand/heat/cooling_demand_total_elec_s{simpl}_{clusters}_{planning_horizons}.nc",
resources:
mem_mb=20000,
benchmark:
Expand Down
322 changes: 161 additions & 161 deletions configs/bundle_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,55 +88,55 @@ databundles:
output:
- data/hydrobasins/hybas_world.shp

# tutorial bundle specific for Nigeria and Benin only
bundle_cutouts_tutorial_NGBJ:
countries: [NG, BJ]
tutorial: true
category: cutouts
destination: "cutouts"
urls:
zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_cutouts_tutorial_NGBJ.zip?download=1
gdrive: https://drive.google.com/file/d/1xnomHdXf_c5STrf7jtDiuRlN2zW0FSVC/view?usp=drive_link
output: [cutouts/cutout-2013-era5-tutorial.nc]
disable_by_opt:
build_cutout: [all]

# tutorial bundle specific for Botswana only
bundle_cutouts_tutorial_BW:
countries: [BW]
tutorial: true
category: cutouts
destination: "cutouts"
urls:
zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_cutouts_tutorial_BW.zip?download=1
gdrive: https://drive.google.com/file/d/1DDQAtnIDM0FNC3vCldfHeH__IpTbyIJt/view?usp=drive_link
output: [cutouts/cutout-2013-era5-tutorial.nc]
disable_by_opt:
build_cutout: [all]

# tutorial bundle specific for Morocco only
bundle_cutouts_tutorial_MA:
countries: [MA]
tutorial: true
category: cutouts
destination: "cutouts"
urls:
zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_cutouts_tutorial_MA.zip?download=1
gdrive: https://drive.google.com/file/d/1j5v2f4E756jmDMa707QvdNJq3xM4bYUk/view?usp=drive_link
output: [cutouts/cutout-2013-era5-tutorial.nc]
disable_by_opt:
build_cutout: [all]

# Cutout of Kazakhstan for CI test of pypsa-kz-data repo, only 5 MB
bundle_cutouts_test_KZ:
countries: [KZ]
category: cutouts
destination: "cutouts"
urls:
zenodo: https://sandbox.zenodo.org/records/69756/files/bundle_tutorial_cutouts_KZ.zip?download=1
output: [cutouts/cutout-2013-era5-tutorial.nc]
disable_by_opt:
build_cutout: [all]
# # tutorial bundle specific for Nigeria and Benin only
# bundle_cutouts_tutorial_NGBJ:
# countries: [NG, BJ]
# tutorial: true
# category: cutouts
# destination: "cutouts"
# urls:
# zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_cutouts_tutorial_NGBJ.zip?download=1
# gdrive: https://drive.google.com/file/d/1xnomHdXf_c5STrf7jtDiuRlN2zW0FSVC/view?usp=drive_link
# output: [cutouts/cutout-2013-era5-tutorial.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # tutorial bundle specific for Botswana only
# bundle_cutouts_tutorial_BW:
# countries: [BW]
# tutorial: true
# category: cutouts
# destination: "cutouts"
# urls:
# zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_cutouts_tutorial_BW.zip?download=1
# gdrive: https://drive.google.com/file/d/1DDQAtnIDM0FNC3vCldfHeH__IpTbyIJt/view?usp=drive_link
# output: [cutouts/cutout-2013-era5-tutorial.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # tutorial bundle specific for Morocco only
# bundle_cutouts_tutorial_MA:
# countries: [MA]
# tutorial: true
# category: cutouts
# destination: "cutouts"
# urls:
# zenodo: https://sandbox.zenodo.org/records/3853/files/bundle_cutouts_tutorial_MA.zip?download=1
# gdrive: https://drive.google.com/file/d/1j5v2f4E756jmDMa707QvdNJq3xM4bYUk/view?usp=drive_link
# output: [cutouts/cutout-2013-era5-tutorial.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # Cutout of Kazakhstan for CI test of pypsa-kz-data repo, only 5 MB
# bundle_cutouts_test_KZ:
# countries: [KZ]
# category: cutouts
# destination: "cutouts"
# urls:
# zenodo: https://sandbox.zenodo.org/records/69756/files/bundle_tutorial_cutouts_KZ.zip?download=1
# output: [cutouts/cutout-2013-era5-tutorial.nc]
# disable_by_opt:
# build_cutout: [all]

# tutorial bundle for all African countries
bundle_tutorial_data_common:
Expand Down Expand Up @@ -235,18 +235,18 @@ databundles:
# agree: 1
# output: [data/gebco/GEBCO_2021_TID.nc]

# cutouts bundle of the cutouts folder for the mainland African continent
# Note: some offshore countries e.g. CV or SC are not covered. Size: about 10GB (zipped)
bundle_cutouts_mainland_africa:
countries: [Africa]
category: cutouts
destination: "cutouts"
urls:
zenodo: https://sandbox.zenodo.org/records/13539/files/bundle_cutouts_africa.zip?download=1
gdrive: https://drive.google.com/file/d/1WHv5Dm1GtrDZj-AxJZd3T-NMIBXty3eV/view?usp=drive_link
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]
# # cutouts bundle of the cutouts folder for the mainland African continent
# # Note: some offshore countries e.g. CV or SC are not covered. Size: about 10GB (zipped)
# bundle_cutouts_mainland_africa:
# countries: [Africa]
# category: cutouts
# destination: "cutouts"
# urls:
# zenodo: https://sandbox.zenodo.org/records/13539/files/bundle_cutouts_africa.zip?download=1
# gdrive: https://drive.google.com/file/d/1WHv5Dm1GtrDZj-AxJZd3T-NMIBXty3eV/view?usp=drive_link
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]

# # cutouts bundle of the cutouts folder for the whole African continent,
# # including UN countries offshore mainland Africa. Size about 20GB (zipped)
Expand All @@ -261,106 +261,106 @@ databundles:
# disable_by_opt:
# build_cutout: [all]

# cutouts bundle of the cutouts folder for the North American continent
# Coordinate bounds: [long -172 to -47, lat 1.5-74]
# Size about 25 GB (zipped)
bundle_cutouts_northamerica:
countries: [NorthAmerica]
category: cutouts
destination: "cutouts"
urls:
gdrive: https://drive.google.com/file/d/1W0rEa7SrAUjqREycKSbl1dkylj_-xmpT/view?usp=drive_link
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]

# cutouts bundle of the cutouts folder for the European continent
# Coordinate bounds: [long -32 to 60, lat 1.5-74]
# Size about 17 GB (zipped)
bundle_cutouts_europe:
countries: [Europe]
category: cutouts
destination: "cutouts"
urls:
gdrive: https://drive.google.com/file/d/17QS7qkuCiyj95Pr-ZQRl3qgp5CQE6HTy/view?usp=drive_link
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]

# cutouts bundle of the cutouts folder for Oceania continent
# Coordinate bounds: [min_x = 80, max_x = 180.0, min_y = -50, max_y = 20.]
# Size about 19 GB (zipped)
bundle_cutouts_oceania:
countries: [Oceania]
category: cutouts
destination: "cutouts"
urls:
gdrive: https://drive.google.com/file/d/1R8ELkXmW8jBBUFWRY0sbf-T14SJl4EUY/view?usp=sharing
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]

# cutouts bundle of the cutouts folder for the northern hemisphere
# Note: this includes nearly the entire northern emisphere [long +-180, lat 1-85]. Size about 81GB (zipped)
#bundle_cutouts_northern_hemisphere:
# countries: [NorthAmerica, Europe]
# category: cutouts
# destination: "cutouts"
# urls:
# gdrive: https://drive.google.com/file/d/1Ew7rQT0VNBqJW1AUrOrOP2IJKSJS7Uoy/view?usp=sharing
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]

# cutouts bundle of the cutouts folder for the Asian continent, except Russia
# Size about 30GB (zipped)
bundle_cutouts_asia:
countries: ["KVR", "WAS", "FEAR", "SEAR", "CASR", "SASR", "ASEAN", "MEAR"]
category: cutouts
destination: "cutouts"
urls:
# zenodo:
gdrive: https://drive.google.com/file/d/11-Ax9tVks7oPjrZwG5v3C0x4OmMT_Pv8/view?usp=sharing
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]

# # cutouts bundle of the cutouts folder for the entire globe [long +-180, lat +-89.9]
# # commented by default to avoid downloading by mistake. Size about 170GB (zipped)
# bundle_cutouts_earth:
# countries: [Earth]
# category: cutouts
# destination: "cutouts"
# urls:
# # zenodo:
# gdrive: https://drive.google.com/file/d/1C9Q5qU_Wu_gj78H5G3TT2thGA-hKheVf/view?usp=drive_link
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]

# Cutout for South America, approx 18 GB
bundle_cutouts_southamerica:
countries: [SouthAmerica]
category: cutouts
destination: "cutouts"
urls:
# zenodo:
gdrive: https://drive.google.com/file/d/1Jeu2Vzoq4mNDUKSvIviN8HqSFx5gl61b/view?usp=sharing
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]

# cutouts bundle of the cutouts folder for Western Asia
# Size about 3.8 GB (zipped)
bundle_cutouts_westernasia:
countries: [WAS]
category: cutouts
destination: "cutouts"
urls:
gdrive: https://drive.google.com/file/d/1as-fZS4Z70CfDf3bR4i9t9S5-5pBqURP/view?usp=sharing
output: [cutouts/cutout-2013-era5.nc]
disable_by_opt:
build_cutout: [all]
# # cutouts bundle of the cutouts folder for the North American continent
# # Coordinate bounds: [long -172 to -47, lat 1.5-74]
# # Size about 25 GB (zipped)
# bundle_cutouts_northamerica:
# countries: [NorthAmerica]
# category: cutouts
# destination: "cutouts"
# urls:
# gdrive: https://drive.google.com/file/d/1W0rEa7SrAUjqREycKSbl1dkylj_-xmpT/view?usp=drive_link
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # cutouts bundle of the cutouts folder for the European continent
# # Coordinate bounds: [long -32 to 60, lat 1.5-74]
# # Size about 17 GB (zipped)
# bundle_cutouts_europe:
# countries: [Europe]
# category: cutouts
# destination: "cutouts"
# urls:
# gdrive: https://drive.google.com/file/d/17QS7qkuCiyj95Pr-ZQRl3qgp5CQE6HTy/view?usp=drive_link
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # cutouts bundle of the cutouts folder for Oceania continent
# # Coordinate bounds: [min_x = 80, max_x = 180.0, min_y = -50, max_y = 20.]
# # Size about 19 GB (zipped)
# bundle_cutouts_oceania:
# countries: [Oceania]
# category: cutouts
# destination: "cutouts"
# urls:
# gdrive: https://drive.google.com/file/d/1R8ELkXmW8jBBUFWRY0sbf-T14SJl4EUY/view?usp=sharing
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # cutouts bundle of the cutouts folder for the northern hemisphere
# # Note: this includes nearly the entire northern emisphere [long +-180, lat 1-85]. Size about 81GB (zipped)
# #bundle_cutouts_northern_hemisphere:
# # countries: [NorthAmerica, Europe]
# # category: cutouts
# # destination: "cutouts"
# # urls:
# # gdrive: https://drive.google.com/file/d/1Ew7rQT0VNBqJW1AUrOrOP2IJKSJS7Uoy/view?usp=sharing
# # output: [cutouts/cutout-2013-era5.nc]
# # disable_by_opt:
# # build_cutout: [all]
#
# # cutouts bundle of the cutouts folder for the Asian continent, except Russia
# # Size about 30GB (zipped)
# bundle_cutouts_asia:
# countries: ["KVR", "WAS", "FEAR", "SEAR", "CASR", "SASR", "ASEAN", "MEAR"]
# category: cutouts
# destination: "cutouts"
# urls:
# # zenodo:
# gdrive: https://drive.google.com/file/d/11-Ax9tVks7oPjrZwG5v3C0x4OmMT_Pv8/view?usp=sharing
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # # cutouts bundle of the cutouts folder for the entire globe [long +-180, lat +-89.9]
# # # commented by default to avoid downloading by mistake. Size about 170GB (zipped)
# # bundle_cutouts_earth:
# # countries: [Earth]
# # category: cutouts
# # destination: "cutouts"
# # urls:
# # # zenodo:
# # gdrive: https://drive.google.com/file/d/1C9Q5qU_Wu_gj78H5G3TT2thGA-hKheVf/view?usp=drive_link
# # output: [cutouts/cutout-2013-era5.nc]
# # disable_by_opt:
# # build_cutout: [all]
#
# # Cutout for South America, approx 18 GB
# bundle_cutouts_southamerica:
# countries: [SouthAmerica]
# category: cutouts
# destination: "cutouts"
# urls:
# # zenodo:
# gdrive: https://drive.google.com/file/d/1Jeu2Vzoq4mNDUKSvIviN8HqSFx5gl61b/view?usp=sharing
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]
#
# # cutouts bundle of the cutouts folder for Western Asia
# # Size about 3.8 GB (zipped)
# bundle_cutouts_westernasia:
# countries: [WAS]
# category: cutouts
# destination: "cutouts"
# urls:
# gdrive: https://drive.google.com/file/d/1as-fZS4Z70CfDf3bR4i9t9S5-5pBqURP/view?usp=sharing
# output: [cutouts/cutout-2013-era5.nc]
# disable_by_opt:
# build_cutout: [all]

# data bundle containing the protected data for the whole world
bundle_landcover_earth:
Expand Down
3 changes: 2 additions & 1 deletion envs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
# need to move back to conda once the issues will be resolved
- powerplantmatching>=0.5.19
- earth-osm>=2.3.post1
- atlite>=0.3
#- atlite>=0.3

# Dependencies of the workflow itself
- xlrd
Expand Down Expand Up @@ -85,6 +85,7 @@ dependencies:

- pip:
- git+https://github.com/davide-f/google-drive-downloader@master # google drive with fix for virus scan
- git+https://github.com/open-energy-transition/atlite@master # until the next release after will be out after v0.3.0
- tsam>=1.1.0
- chaospy # lastest version only available on pip
- fake_useragent
9 changes: 8 additions & 1 deletion scripts/build_heat_demand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from _helpers import mock_snakemake

snakemake = mock_snakemake("build_heat_demand", simpl="", clusters="4")
snakemake = mock_snakemake(
"build_heat_demand", simpl="", clusters="10", planning_horizons="2030"
)

time = pd.date_range(freq="h", **snakemake.params.snapshots)
cutout_config = snakemake.input.cutout
Expand All @@ -39,6 +42,10 @@
stacked_pop = pop_layout.stack(spatial=("y", "x"))
M = I.T.dot(np.diag(I.dot(stacked_pop)))

heat_demand = cutout.heat_demand(matrix=M.T, index=clustered_regions.index)
cooling_demand = cutout.cooling_demand(
matrix=M.T, index=clustered_regions.index
)
cooling_demand.to_netcdf(snakemake.output[f"cooling_demand_{area}"])

heat_demand = cutout.heat_demand(matrix=M.T, index=clustered_regions.index)
heat_demand.to_netcdf(snakemake.output[f"heat_demand_{area}"])
Loading