From 32248724bdcfa3dada40d669488d9fef37887fa5 Mon Sep 17 00:00:00 2001 From: Jan Frederick Date: Fri, 3 Apr 2020 12:02:25 +0200 Subject: [PATCH 1/4] add if statements for "keep all availble areas" Add possibility to keep all availble areas for the potential area generation. --- scripts/build_renewable_profiles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index f8e83205..7b1719b3 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -289,7 +289,8 @@ if __name__ == '__main__': potentials = config['capacity_per_sqkm'] * vlanduse._cutout_cell_areas(cutout) potmatrix = matrix * spdiag(potentials.ravel()) - potmatrix.data[potmatrix.data < 1.] = 0 # ignore weather cells where only less than 1 MW can be installed + if config.get('keep_all_available_areas', False) != True: + potmatrix.data[potmatrix.data < 1.] = 0 # ignore weather cells where only less than 1 MW can be installed potmatrix.eliminate_zeros() resource = config['resource'] From b707578bfb07b23743f5113b5ed128d7fbac7788 Mon Sep 17 00:00:00 2001 From: Jan Frederick Date: Fri, 3 Apr 2020 12:09:17 +0200 Subject: [PATCH 2/4] Update build_renewable_profiles.py --- scripts/build_renewable_profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index 7b1719b3..7c00e4f0 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -289,7 +289,7 @@ if __name__ == '__main__': potentials = config['capacity_per_sqkm'] * vlanduse._cutout_cell_areas(cutout) potmatrix = matrix * spdiag(potentials.ravel()) - if config.get('keep_all_available_areas', False) != True: + if config.get('keep_all_available_areas', False) != True: # check config file if user wants to use all availbe areas for renewable potentials potmatrix.data[potmatrix.data < 1.] = 0 # ignore weather cells where only less than 1 MW can be installed potmatrix.eliminate_zeros() From b4c502f90162c30112056a5e0243772066866bb3 Mon Sep 17 00:00:00 2001 From: Jan Frederick Date: Fri, 3 Apr 2020 12:12:27 +0200 Subject: [PATCH 3/4] Updated description --- scripts/build_renewable_profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index 7c00e4f0..d694114b 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -289,7 +289,7 @@ if __name__ == '__main__': potentials = config['capacity_per_sqkm'] * vlanduse._cutout_cell_areas(cutout) potmatrix = matrix * spdiag(potentials.ravel()) - if config.get('keep_all_available_areas', False) != True: # check config file if user wants to use all availbe areas for renewable potentials + if config.get('keep_all_available_areas', False) != True: # check config file whether user wants to use all availbe weather cells for renewable profile and potential generation potmatrix.data[potmatrix.data < 1.] = 0 # ignore weather cells where only less than 1 MW can be installed potmatrix.eliminate_zeros() From 0adaf2c1b605e6b9ca3bc8b20075f0ed6a73f11a Mon Sep 17 00:00:00 2001 From: Jan Frederick Date: Mon, 6 Apr 2020 16:38:54 +0200 Subject: [PATCH 4/4] cleaned code for better understanding --- scripts/build_renewable_profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index d694114b..54976502 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -289,7 +289,7 @@ if __name__ == '__main__': potentials = config['capacity_per_sqkm'] * vlanduse._cutout_cell_areas(cutout) potmatrix = matrix * spdiag(potentials.ravel()) - if config.get('keep_all_available_areas', False) != True: # check config file whether user wants to use all availbe weather cells for renewable profile and potential generation + if not config.get('keep_all_available_areas', False): # check config file whether user wants to use all availbe weather cells for renewable profile and potential generation potmatrix.data[potmatrix.data < 1.] = 0 # ignore weather cells where only less than 1 MW can be installed potmatrix.eliminate_zeros()