From e1318280ea1b7fe0c652f6ed3086a6c063ed98cc Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 15:43:19 +0200 Subject: [PATCH 001/114] Add setting for node --- message_ix_buildings/chilled/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/config.py b/message_ix_buildings/chilled/config.py index f14ef46..437cdf1 100644 --- a/message_ix_buildings/chilled/config.py +++ b/message_ix_buildings/chilled/config.py @@ -1,6 +1,7 @@ import datetime import os from dataclasses import dataclass +from typing import Literal import numpy as np @@ -188,8 +189,8 @@ class Config: # #: - "message": :mod:`message_ix` parameter data. # format: Literal["iamc", "message"] = "message" - # #: Spatial resolution - # node: Literal["R11", "R12", "R20"] = "R12" + #: Spatial resolution + node: Literal["R11", "R12", "R20"] = "R11" # #: Projection method; one of: # #: From 9059a77af30084be25ef512a105820f3ddc9c508 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 15:43:29 +0200 Subject: [PATCH 002/114] Add user for UniCC --- message_ix_buildings/chilled/user_settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/message_ix_buildings/chilled/user_settings.py b/message_ix_buildings/chilled/user_settings.py index ff0a1fe..1974abc 100644 --- a/message_ix_buildings/chilled/user_settings.py +++ b/message_ix_buildings/chilled/user_settings.py @@ -20,6 +20,7 @@ "MEAS": { "chunk_size": 125, "sys_path": "/Users/meas/iiasagit/cc_ene_dem", + "chilled_data_path": "/Users/meas/Library/CloudStorage/OneDrive-SharedLibraries-IIASA/DLE - Analysis/Climate impacts and space conditioning/Data/chilled", "dle_path": "/Users/meas/Library/CloudStorage/OneDrive-SharedLibraries-IIASA/DLE - Analysis/Climate impacts and space conditioning/Data", "isimip_bias_adj_path": "/Volumes/mengm.pdrv/watxene/ISIMIP/ISIMIP3b/InputData/climate_updated/bias-adjusted", "isimip_ewembi_path": "/Volumes/mengm.pdrv/watxene/ISIMIP/ISIMIP2a_hist/input/EWEMBI", @@ -35,4 +36,13 @@ "message_region_map_file": "P:\\ene.model\\data\\powerplants\\MESSAGE data\\MESSAGEix_country_region_map.xlsx", "ar6_snapshot_file": "D:\\mengm\\IIASA\\DLE - Data\\input_data\\AR6_Scenarios_Database_World\\AR6_Scenarios_Database_World_v1.1.csv", }, + "MEAS_UNICC": { + "chunk_size": 450, + "sys_path": "/home/mengm/repo/message-ix-buildings", + "dle_path": "/projects/chilled", + "isimip_bias_adj_path": "/pdrive/projects/watxene/ISIMIP/ISIMIP3b/InputData/climate_updated/bias-adjusted", + "isimip_ewembi_path": "/pdrive/projects/watxene/ISIMIP/ISIMIP2a_hist/input/EWEMBI", + "message_region_map_file": "/pdrive/projects/ene.model3/data/powerplants/MESSAGE data/MESSAGEix_country_region_map.xlsx", + "ar6_snapshot_file": "/projects/chilled/data/ar6/1668008312256-AR6_Scenarios_Database_World_v1.1.csv/AR6_Scenarios_Database_World_v1.1.csv", + }, } From 3b156f8a85e4aeff78cb4507ed5cebbce0961ffe Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 15:57:33 +0200 Subject: [PATCH 003/114] Add script to preprocess and create MESSAGE regions raster --- .../chilled/preprocess/message_raster.py | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 message_ix_buildings/chilled/preprocess/message_raster.py diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py new file mode 100644 index 0000000..03f648c --- /dev/null +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -0,0 +1,107 @@ +""" +Create raster of MESSAGE regions for CHILLED with specified nodes +""" + +import datetime +import os + +import pandas as pd +import xarray as xr + +from ..config import Config + + +def create_archetype_template_map(config: "Config"): + input_path = os.path.join(config.dle_path, "data") + output_path = os.path.join(config.dle_path, "out", "raster") + + if config.node == "R11": + msgregions = pd.read_excel( + config.message_region_file, + sheet_name="regional definition", + ) + + # Country raster + country_ras = xr.open_dataarray( + os.path.join(input_path, "gaul_lvl0_hybrid_05_3.nc") + ) + + ISO_attrs = pd.DataFrame([country_ras.attrs]).T.rename(columns={0: "ISO"}) + + # Region raster + reg_ras = xr.Dataset({"MESSAGE11": country_ras.copy(deep=True)}) + reg_ras["ISO"] = country_ras.copy(deep=True) + + for row in ISO_attrs.itertuples(): + code = row.ISO # get country ISO code + regval = msgregions.loc[msgregions.iso_code == code, "RegNum"] + if regval.values.size != 0: + reg_ras.MESSAGE11.values[country_ras.values == float(row.Index)] = ( + regval + ) + else: + print(row.Index) + print() + + # % manual post process for pixels with the fill value + # Latin america + tarr = reg_ras.MESSAGE11.sel(lat=slice(25.25, -55.25), lon=slice(-180, -21)) + tarr.values[tarr.values < -10] = 5 + reg_ras.MESSAGE11.sel( + lat=slice(25.25, -55.25), lon=slice(-180, -21) + ).values = tarr + + # Svalbard etc + tarr = reg_ras.MESSAGE11.sel(lat=slice(84, 55), lon=slice(-30, 45)) + tarr.values[tarr.values < -10] = 11 + reg_ras.MESSAGE11.sel(lat=slice(84, 55), lon=slice(-30, 45)).values = tarr + + # SSA etc + tarr = reg_ras.MESSAGE11.sel(lat=slice(24, -55), lon=slice(-30, 75)) + tarr.values[tarr.values < -10] = 1 + reg_ras.MESSAGE11.sel(lat=slice(24, -55), lon=slice(-30, 75)).values = tarr + + # other pacific Asia + tarr = reg_ras.MESSAGE11.sel(lat=slice(25, -55), lon=slice(90, 180)) + tarr.values[tarr.values < -10] = 9 + reg_ras.MESSAGE11.sel(lat=slice(25, -55), lon=slice(90, 180)).values = tarr + + # british Indian Ocean territory to South ASIA + tarr = reg_ras.MESSAGE11.sel(lat=slice(0, -10), lon=slice(65, 75)) + tarr.values[tarr.values < -10] = 10 + reg_ras.MESSAGE11.sel(lat=slice(0, -10), lon=slice(65, 75)).values = tarr + + # St Miquelon island in Canada? + tarr = reg_ras.MESSAGE11.sel(lat=slice(48, 44), lon=slice(-60, -50)) + tarr.values[tarr.values < -10] = 10 + reg_ras.MESSAGE11.sel(lat=slice(48, 44), lon=slice(-60, -50)).values = tarr + + # Midway atoll + tarr = reg_ras.MESSAGE11.sel(lat=slice(80, 20), lon=slice(-180, -150)) + tarr.values[tarr.values < -10] = 10 + reg_ras.MESSAGE11.sel(lat=slice(80, 20), lon=slice(-180, -150)).values = tarr + + reg_ras.MESSAGE11.plot() + + # reg_ras.MESSAGE11.where(reg_ras.MESSAGE11 < -1).plot() # Check if worked.. + + map_reg = reg_ras.MESSAGE11.copy(deep=True) + + # Write out to netcdf + map_reg.attrs = { + "title": "Map MESSAGE R11 regions", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + } + + map_reg.to_netcdf(os.path.join(output_path, "map_reg_MESSAGE_R11.nc")) + + print( + "Saved MESSAGE and raster map data to " + + os.path.join(output_path, "map_reg_MESSAGE_R11.nc") + ) + + else: + print("Only R11 is supported at the moment.") From b0a876db2379b363e703cfa97ee902ad1a0fe956 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:02:59 +0200 Subject: [PATCH 004/114] Add script to run preprocessing --- message_ix_buildings/chilled/run_preprocess.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 message_ix_buildings/chilled/run_preprocess.py diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py new file mode 100644 index 0000000..cd878ca --- /dev/null +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -0,0 +1,6 @@ +from config import Config +from preprocess.message_raster import create_archetype_template_map + +cfg = Config() + +create_archetype_template_map(cfg) From d5e2a3bdd1ccfa433b170b1166da7753efbf4ee3 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:04:09 +0200 Subject: [PATCH 005/114] Change to using relative paths --- message_ix_buildings/chilled/config.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/message_ix_buildings/chilled/config.py b/message_ix_buildings/chilled/config.py index 437cdf1..472de85 100644 --- a/message_ix_buildings/chilled/config.py +++ b/message_ix_buildings/chilled/config.py @@ -5,11 +5,8 @@ import numpy as np -from message_ix_buildings.chilled.user_settings import DICT_USER_SETTINGS -from message_ix_buildings.chilled.vdd_functions import ( - load_all_scenarios_data, - load_parametric_analysis_data, -) +from .user_settings import DICT_USER_SETTINGS +from .vdd_functions import load_all_scenarios_data, load_parametric_analysis_data @dataclass From 86f22b54cf7b9d74b26a4bb0432545f7bef0087d Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:07:48 +0200 Subject: [PATCH 006/114] Add `__init__.py` for `preprocess` subpackage --- message_ix_buildings/chilled/preprocess/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 message_ix_buildings/chilled/preprocess/__init__.py diff --git a/message_ix_buildings/chilled/preprocess/__init__.py b/message_ix_buildings/chilled/preprocess/__init__.py new file mode 100644 index 0000000..e69de29 From 5891015e5b45a1b1f09eb5685b6a143d5672e7eb Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:21:06 +0200 Subject: [PATCH 007/114] Restructure and reorganize to be like package --- .../__init__.py} | 0 .../chilled/{ => analysis}/aggregate.py | 0 .../chilled/{ => analysis}/check_pop.py | 2 +- message_ix_buildings/chilled/config.py | 7 ++++-- .../chilled/functions/__init__.py | 0 .../{ => functions}/buildings_funcs_grid.py | 0 .../chilled/{ => functions}/regression.py | 0 .../chilled/{ => functions}/setup.py | 0 .../chilled/{ => functions}/user_settings.py | 0 .../chilled/{ => functions}/variable_dicts.py | 0 .../chilled/{ => functions}/vdd_functions.py | 4 +-- .../chilled/preprocess/message_raster.py | 2 +- .../chilled/{ => preprocess}/preprocess.py | 25 ++----------------- .../chilled/run_preprocess.py | 6 +++-- .../chilled/z1_VDD_ene_calcs.py | 8 +++--- .../life_coupling/__init__.py | 0 message_ix_buildings/sturm/__init__.py | 0 17 files changed, 19 insertions(+), 35 deletions(-) rename message_ix_buildings/chilled/{run_chilled2023.py => analysis/__init__.py} (100%) rename message_ix_buildings/chilled/{ => analysis}/aggregate.py (100%) rename message_ix_buildings/chilled/{ => analysis}/check_pop.py (99%) create mode 100644 message_ix_buildings/chilled/functions/__init__.py rename message_ix_buildings/chilled/{ => functions}/buildings_funcs_grid.py (100%) rename message_ix_buildings/chilled/{ => functions}/regression.py (100%) rename message_ix_buildings/chilled/{ => functions}/setup.py (100%) rename message_ix_buildings/chilled/{ => functions}/user_settings.py (100%) rename message_ix_buildings/chilled/{ => functions}/variable_dicts.py (100%) rename message_ix_buildings/chilled/{ => functions}/vdd_functions.py (99%) rename message_ix_buildings/chilled/{ => preprocess}/preprocess.py (99%) create mode 100644 message_ix_buildings/life_coupling/__init__.py create mode 100644 message_ix_buildings/sturm/__init__.py diff --git a/message_ix_buildings/chilled/run_chilled2023.py b/message_ix_buildings/chilled/analysis/__init__.py similarity index 100% rename from message_ix_buildings/chilled/run_chilled2023.py rename to message_ix_buildings/chilled/analysis/__init__.py diff --git a/message_ix_buildings/chilled/aggregate.py b/message_ix_buildings/chilled/analysis/aggregate.py similarity index 100% rename from message_ix_buildings/chilled/aggregate.py rename to message_ix_buildings/chilled/analysis/aggregate.py diff --git a/message_ix_buildings/chilled/check_pop.py b/message_ix_buildings/chilled/analysis/check_pop.py similarity index 99% rename from message_ix_buildings/chilled/check_pop.py rename to message_ix_buildings/chilled/analysis/check_pop.py index 74945d9..c8da1ed 100644 --- a/message_ix_buildings/chilled/check_pop.py +++ b/message_ix_buildings/chilled/analysis/check_pop.py @@ -5,7 +5,7 @@ import xarray as xr from message_ix_buildings.chilled.config import Config -from message_ix_buildings.chilled.variable_dicts import ( +from message_ix_buildings.chilled.functions.variable_dicts import ( VARDICT_COOL, VARDICT_HEAT, VARUNDICT_COOL, diff --git a/message_ix_buildings/chilled/config.py b/message_ix_buildings/chilled/config.py index 472de85..84f5840 100644 --- a/message_ix_buildings/chilled/config.py +++ b/message_ix_buildings/chilled/config.py @@ -5,8 +5,11 @@ import numpy as np -from .user_settings import DICT_USER_SETTINGS -from .vdd_functions import load_all_scenarios_data, load_parametric_analysis_data +from .functions.user_settings import DICT_USER_SETTINGS +from .functions.vdd_functions import ( + load_all_scenarios_data, + load_parametric_analysis_data, +) @dataclass diff --git a/message_ix_buildings/chilled/functions/__init__.py b/message_ix_buildings/chilled/functions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/message_ix_buildings/chilled/buildings_funcs_grid.py b/message_ix_buildings/chilled/functions/buildings_funcs_grid.py similarity index 100% rename from message_ix_buildings/chilled/buildings_funcs_grid.py rename to message_ix_buildings/chilled/functions/buildings_funcs_grid.py diff --git a/message_ix_buildings/chilled/regression.py b/message_ix_buildings/chilled/functions/regression.py similarity index 100% rename from message_ix_buildings/chilled/regression.py rename to message_ix_buildings/chilled/functions/regression.py diff --git a/message_ix_buildings/chilled/setup.py b/message_ix_buildings/chilled/functions/setup.py similarity index 100% rename from message_ix_buildings/chilled/setup.py rename to message_ix_buildings/chilled/functions/setup.py diff --git a/message_ix_buildings/chilled/user_settings.py b/message_ix_buildings/chilled/functions/user_settings.py similarity index 100% rename from message_ix_buildings/chilled/user_settings.py rename to message_ix_buildings/chilled/functions/user_settings.py diff --git a/message_ix_buildings/chilled/variable_dicts.py b/message_ix_buildings/chilled/functions/variable_dicts.py similarity index 100% rename from message_ix_buildings/chilled/variable_dicts.py rename to message_ix_buildings/chilled/functions/variable_dicts.py diff --git a/message_ix_buildings/chilled/vdd_functions.py b/message_ix_buildings/chilled/functions/vdd_functions.py similarity index 99% rename from message_ix_buildings/chilled/vdd_functions.py rename to message_ix_buildings/chilled/functions/vdd_functions.py index 5d63270..8fdb46a 100644 --- a/message_ix_buildings/chilled/vdd_functions.py +++ b/message_ix_buildings/chilled/functions/vdd_functions.py @@ -12,7 +12,7 @@ import xarray as xr from dask.diagnostics import ProgressBar -from message_ix_buildings.chilled.buildings_funcs_grid import ( +from message_ix_buildings.chilled.functions.buildings_funcs_grid import ( P_f, Q_c_tmax, Q_h, @@ -35,7 +35,7 @@ calc_vdd_h, calc_vdd_tmax_c, ) -from message_ix_buildings.chilled.variable_dicts import ( +from message_ix_buildings.chilled.functions.variable_dicts import ( VARDICT_COOL, VARDICT_HEAT, VARS_ARCHETYPES, diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 03f648c..74ed444 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -8,7 +8,7 @@ import pandas as pd import xarray as xr -from ..config import Config +from message_ix_buildings.chilled.config import Config def create_archetype_template_map(config: "Config"): diff --git a/message_ix_buildings/chilled/preprocess.py b/message_ix_buildings/chilled/preprocess/preprocess.py similarity index 99% rename from message_ix_buildings/chilled/preprocess.py rename to message_ix_buildings/chilled/preprocess/preprocess.py index 08318fa..a7bba8f 100644 --- a/message_ix_buildings/chilled/preprocess.py +++ b/message_ix_buildings/chilled/preprocess/preprocess.py @@ -7,7 +7,8 @@ import xarray as xr from dask.diagnostics import ProgressBar -from message_ix_buildings.chilled.buildings_funcs_grid import ( +from message_ix_buildings.chilled.config import Config +from message_ix_buildings.chilled.functions.buildings_funcs_grid import ( P_f, Q_c_tmax, Q_h, @@ -30,28 +31,6 @@ calc_vdd_h, calc_vdd_tmax_c, ) -from message_ix_buildings.chilled.config import Config -from message_ix_buildings.chilled.variable_dicts import ( - VARS_ARCHETYPES, - YEARS_BASELINE, - YEARS_OTHERS, -) - -# print(clims + " + " + archs + " + " + parset_name_run + " + " + urts) - - -def create_archetype_template_map( - dle_path, - version_name, - gcm, - rcp_scenario, - message_region_file, - archs_specified, - arch_setting, - urts, - comp, -): - output_path_arch = os.path.join( dle_path, f"output_data_{version_name}", gcm, diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index cd878ca..1e1ca85 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,5 +1,7 @@ -from config import Config -from preprocess.message_raster import create_archetype_template_map +from message_ix_buildings.chilled.config import Config +from message_ix_buildings.chilled.preprocess.message_raster import ( + create_archetype_template_map, +) cfg = Config() diff --git a/message_ix_buildings/chilled/z1_VDD_ene_calcs.py b/message_ix_buildings/chilled/z1_VDD_ene_calcs.py index d960f5a..f8fa419 100644 --- a/message_ix_buildings/chilled/z1_VDD_ene_calcs.py +++ b/message_ix_buildings/chilled/z1_VDD_ene_calcs.py @@ -2,13 +2,13 @@ import numpy as np -from message_ix_buildings.chilled.aggregate import ( +from message_ix_buildings.chilled.analysis.aggregate import ( aggregate_ISO_tables_to_regions, create_prereg_data, ) -from message_ix_buildings.chilled.regression import apply_regression -from message_ix_buildings.chilled.user_settings import DICT_USER_SETTINGS -from message_ix_buildings.chilled.vdd_functions import ( +from message_ix_buildings.chilled.functions.regression import apply_regression +from message_ix_buildings.chilled.functions.user_settings import DICT_USER_SETTINGS +from message_ix_buildings.chilled.functions.vdd_functions import ( aggregate_urban_rural_files, calculate_cumulative_carbon_emissions, create_archetype_template_map, diff --git a/message_ix_buildings/life_coupling/__init__.py b/message_ix_buildings/life_coupling/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/message_ix_buildings/sturm/__init__.py b/message_ix_buildings/sturm/__init__.py new file mode 100644 index 0000000..e69de29 From 6880f02ae7933cccb235301dc5f27273bd9d4072 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:22:29 +0200 Subject: [PATCH 008/114] Change to relative import paths --- message_ix_buildings/chilled/run_preprocess.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 1e1ca85..2f0fd8a 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,7 +1,5 @@ -from message_ix_buildings.chilled.config import Config -from message_ix_buildings.chilled.preprocess.message_raster import ( - create_archetype_template_map, -) +from .config import Config +from .preprocess.message_raster import create_archetype_template_map cfg = Config() From 584c19868fdb378aefc52fff46f2616fded1a03e Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:34:47 +0200 Subject: [PATCH 009/114] Edit relative imports and move `config.py` --- message_ix_buildings/chilled/analysis/check_pop.py | 5 +---- message_ix_buildings/chilled/functions/vdd_functions.py | 4 ++-- message_ix_buildings/chilled/postprocess.py | 2 +- message_ix_buildings/chilled/preprocess/message_raster.py | 3 +-- message_ix_buildings/chilled/preprocess/preprocess.py | 2 +- message_ix_buildings/chilled/run_preprocess.py | 4 ++-- message_ix_buildings/chilled/utils/__init__.py | 0 message_ix_buildings/chilled/{ => utils}/config.py | 7 +++---- 8 files changed, 11 insertions(+), 16 deletions(-) create mode 100644 message_ix_buildings/chilled/utils/__init__.py rename message_ix_buildings/chilled/{ => utils}/config.py (97%) diff --git a/message_ix_buildings/chilled/analysis/check_pop.py b/message_ix_buildings/chilled/analysis/check_pop.py index c8da1ed..fea6029 100644 --- a/message_ix_buildings/chilled/analysis/check_pop.py +++ b/message_ix_buildings/chilled/analysis/check_pop.py @@ -4,17 +4,14 @@ import pandas as pd # type: ignore import xarray as xr -from message_ix_buildings.chilled.config import Config from message_ix_buildings.chilled.functions.variable_dicts import ( VARDICT_COOL, VARDICT_HEAT, VARUNDICT_COOL, VARUNDICT_HEAT, ) +from message_ix_buildings.chilled.utils.config import Config -cfg = Config() - -dle_path = cfg.dle_path vstr = cfg.vstr vstrcntry = cfg.vstrcntry gcm = cfg.gcm diff --git a/message_ix_buildings/chilled/functions/vdd_functions.py b/message_ix_buildings/chilled/functions/vdd_functions.py index 8fdb46a..eccdd89 100644 --- a/message_ix_buildings/chilled/functions/vdd_functions.py +++ b/message_ix_buildings/chilled/functions/vdd_functions.py @@ -12,7 +12,7 @@ import xarray as xr from dask.diagnostics import ProgressBar -from message_ix_buildings.chilled.functions.buildings_funcs_grid import ( +from .buildings_funcs_grid import ( P_f, Q_c_tmax, Q_h, @@ -35,7 +35,7 @@ calc_vdd_h, calc_vdd_tmax_c, ) -from message_ix_buildings.chilled.functions.variable_dicts import ( +from .variable_dicts import ( VARDICT_COOL, VARDICT_HEAT, VARS_ARCHETYPES, diff --git a/message_ix_buildings/chilled/postprocess.py b/message_ix_buildings/chilled/postprocess.py index 0a8c1b4..e99f089 100644 --- a/message_ix_buildings/chilled/postprocess.py +++ b/message_ix_buildings/chilled/postprocess.py @@ -2,7 +2,7 @@ import pandas as pd # type: ignore -from message_ix_buildings.chilled.config import Config +from message_ix_buildings.chilled.utils.config import Config cfg = Config() diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 74ed444..ce986e8 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -7,8 +7,7 @@ import pandas as pd import xarray as xr - -from message_ix_buildings.chilled.config import Config +from utils.config import Config def create_archetype_template_map(config: "Config"): diff --git a/message_ix_buildings/chilled/preprocess/preprocess.py b/message_ix_buildings/chilled/preprocess/preprocess.py index a7bba8f..6fce54d 100644 --- a/message_ix_buildings/chilled/preprocess/preprocess.py +++ b/message_ix_buildings/chilled/preprocess/preprocess.py @@ -7,7 +7,7 @@ import xarray as xr from dask.diagnostics import ProgressBar -from message_ix_buildings.chilled.config import Config +from message_ix_buildings.chilled.utils.config import Config from message_ix_buildings.chilled.functions.buildings_funcs_grid import ( P_f, Q_c_tmax, diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 2f0fd8a..aafdfaf 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,5 +1,5 @@ -from .config import Config -from .preprocess.message_raster import create_archetype_template_map +from preprocess.message_raster import create_archetype_template_map +from utils.config import Config cfg = Config() diff --git a/message_ix_buildings/chilled/utils/__init__.py b/message_ix_buildings/chilled/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/message_ix_buildings/chilled/config.py b/message_ix_buildings/chilled/utils/config.py similarity index 97% rename from message_ix_buildings/chilled/config.py rename to message_ix_buildings/chilled/utils/config.py index 84f5840..ced6c6a 100644 --- a/message_ix_buildings/chilled/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -4,9 +4,8 @@ from typing import Literal import numpy as np - -from .functions.user_settings import DICT_USER_SETTINGS -from .functions.vdd_functions import ( +from functions.user_settings import DICT_USER_SETTINGS +from functions.vdd_functions import ( load_all_scenarios_data, load_parametric_analysis_data, ) @@ -17,7 +16,7 @@ class Config: """Configuration for :mod:`.message_ix_buildings.chilled`.""" # SPECIFY USER - user = "MEAS" # options: ALE, ED, MEAS + user: Literal["ALE", "ED", "MEAS", "MEAS_EBRO", "MEAS_UNICC"] = "MEAS_UNICC" # print(f"USER: {user}") dle_path = DICT_USER_SETTINGS[user]["dle_path"] From 238d10d8d1be759eb499f94e55d3ba2d4841c345 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 16:57:24 +0200 Subject: [PATCH 010/114] Add `type: ignore` --- message_ix_buildings/chilled/preprocess/message_raster.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index ce986e8..2d32132 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -5,9 +5,9 @@ import datetime import os -import pandas as pd -import xarray as xr -from utils.config import Config +import pandas as pd # type: ignore +import xarray as xr # type: ignore +from utils.config import Config # type: ignore def create_archetype_template_map(config: "Config"): From 611a588ad441321bbb5bcd5f8c1506d6abddc29e Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:03:34 +0200 Subject: [PATCH 011/114] Add `config.node` to filename --- message_ix_buildings/chilled/preprocess/message_raster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 2d32132..0c878d1 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -95,11 +95,11 @@ def create_archetype_template_map(config: "Config"): "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", } - map_reg.to_netcdf(os.path.join(output_path, "map_reg_MESSAGE_R11.nc")) + map_reg.to_netcdf(os.path.join(output_path, "map_reg_MESSAGE_{config.node}.nc")) print( "Saved MESSAGE and raster map data to " - + os.path.join(output_path, "map_reg_MESSAGE_R11.nc") + + os.path.join(output_path, "map_reg_MESSAGE_{config.node}.nc") ) else: From 49f6d72b59bce097a2141f7d3bde76cc8f9bdc0c Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:03:48 +0200 Subject: [PATCH 012/114] Change project name --- message_ix_buildings/chilled/utils/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index ced6c6a..01669a5 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -38,7 +38,7 @@ class Config: testing_mode = 0 # 1= selects only two years for testing; 0= select all years (full calculation) # VERSION SETTINGS - vstr = "v19_ALPS2023" # version input data + vstr = "ALPS2023" # version input data vstrcntry = "v4" # version string for country data and floor surface gcm = "MRI-ESM2-0" # options: GFDL-ESM4, IPSL-CM6A-LR, MPI-ESM1-2-HR, MRI-ESM2-0, and UKESM1-0-LL From ad6d921326ad91e1757ae3163a2664bc9af58f54 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:04:06 +0200 Subject: [PATCH 013/114] Add check for .nc file --- message_ix_buildings/chilled/run_preprocess.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index aafdfaf..fa454fe 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,6 +1,16 @@ -from preprocess.message_raster import create_archetype_template_map -from utils.config import Config +import os + +from preprocess.message_raster import create_archetype_template_map # type: ignore +from utils.config import Config # type: ignore +from utils.config import Config # type: ignore cfg = Config() -create_archetype_template_map(cfg) +# check to see if "map_reg_MESSAGE_{config.node}.nc" exists +# if not, create the file +if not os.path.exists( + os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_{cfg.node}.nc") +): + create_archetype_template_map(cfg) +else: + print(f"map_reg_MESSAGE_{cfg.node}.nc already exists") From 9bcb955534ba1832898d63b6955ea19a44eae90d Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:17:58 +0200 Subject: [PATCH 014/114] Edit filename --- message_ix_buildings/chilled/preprocess/message_raster.py | 6 ++++-- message_ix_buildings/chilled/run_preprocess.py | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 0c878d1..5e7a71b 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -95,11 +95,13 @@ def create_archetype_template_map(config: "Config"): "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", } - map_reg.to_netcdf(os.path.join(output_path, "map_reg_MESSAGE_{config.node}.nc")) + filename = "map_reg_MESSAGE_" + config.node + ".nc" + + map_reg.to_netcdf(os.path.join(output_path, filename)) print( "Saved MESSAGE and raster map data to " - + os.path.join(output_path, "map_reg_MESSAGE_{config.node}.nc") + + os.path.join(output_path, filename) ) else: diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index fa454fe..92f0df0 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -2,14 +2,13 @@ from preprocess.message_raster import create_archetype_template_map # type: ignore from utils.config import Config # type: ignore -from utils.config import Config # type: ignore cfg = Config() # check to see if "map_reg_MESSAGE_{config.node}.nc" exists # if not, create the file if not os.path.exists( - os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_{cfg.node}.nc") + os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_" + cfg.node + ".nc") ): create_archetype_template_map(cfg) else: From 9c5317dcf625245b4e688ca4708d66391c855cf9 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:24:44 +0200 Subject: [PATCH 015/114] Edit printing message --- message_ix_buildings/chilled/run_preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 92f0df0..3ad7c8d 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -12,4 +12,4 @@ ): create_archetype_template_map(cfg) else: - print(f"map_reg_MESSAGE_{cfg.node}.nc already exists") + print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") From 5318e811e3008d7fec6c8a02c5696f589e1c7062 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:37:19 +0200 Subject: [PATCH 016/114] Add input data for CHILLED, using ALPS2023 version --- .../chilled/versions/ALPS2023/arch_input.csv | 45 +++++++++++++++++++ .../versions/ALPS2023/arch_regions.csv | 12 +++++ .../chilled/versions/ALPS2023/par_var.csv | 4 ++ .../data/chilled/versions/ALPS2023/runs.csv | 11 +++++ 4 files changed, 72 insertions(+) create mode 100644 message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv create mode 100644 message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv create mode 100755 message_ix_buildings/data/chilled/versions/ALPS2023/par_var.csv create mode 100755 message_ix_buildings/data/chilled/versions/ALPS2023/runs.csv diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv new file mode 100644 index 0000000..a140e91 --- /dev/null +++ b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv @@ -0,0 +1,45 @@ +id,name,urt,arch,permanent,area_env,gl_perc,vol,fl_cnd,u_val,ach_cl,ach_op,gn_int,gl_g,gl_sh,roof_area,roof_abs,u_roof +0,AFR_r_new,rur,new,1,3.7,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,1,0.6,2.7 +1,AFR_u_new,urb,new,1,1.52,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,0.25,0.6,2.7 +2,CPA_r_new,rur,new,1,3.7,0.125,3,1,1.525,0.5,1.5,2.14,0.85,0.8,1,0.6,0.7 +3,CPA_u_new,urb,new,1,1.52,0.125,3,1,1.525,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.7 +4,EEU_r_new,rur,new,1,3.7,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,1,0.6,0.23 +5,EEU_u_new,urb,new,1,1.52,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.23 +6,FSU_r_new,rur,new,1,3.7,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,1,0.6,0.23 +7,FSU_u_new,urb,new,1,1.52,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.23 +8,LAC_r_new,rur,new,1,3.7,0.125,3,1,2.65,0.5,1.5,2.14,0.85,0.8,1,0.6,1.6 +9,LAC_u_new,urb,new,1,1.52,0.125,3,1,2.65,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1.6 +10,MEA_r_new,rur,new,1,3.7,0.125,3,1,2.5,0.5,1.5,2.14,0.85,0.8,1,0.6,1 +11,MEA_r_new,urb,new,1,1.52,0.125,3,1,2.5,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1 +12,NAM_r_new,rur,new,1,3.7,0.125,3,1,1.39,0.5,1.5,2.14,0.85,0.8,1,0.6,0.34 +13,NAM_u_new,urb,new,1,1.52,0.125,3,1,1.39,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.34 +14,PAO_r_new,rur,new,1,3.7,0.125,3,1,0.940,0.5,1.5,2.14,0.85,0.8,1,0.6,0.35 +15,PAO_u_new,urb,new,1,1.52,0.125,3,1,0.940,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.35 +16,PAS_r_new,rur,new,1,3.7,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,1,0.6,2.7 +17,PAS_u_new,urb,new,1,1.52,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,0.25,0.6,2.7 +18,SAS_r_new,rur,new,1,3.7,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,1,0.6,2.7 +19,SAS_u_new,urb,new,1,1.52,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,0.25,0.6,2.7 +20,WEU_r_new,rur,new,1,3.7,0.125,3,1,0.57875,0.5,1.5,2.14,0.85,0.8,1,0.6,0.2 +21,WEU_u_new,urb,new,1,1.52,0.125,3,1,0.57875,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.2 +22,AFR_r_new,rur,exist,1,3.7,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,1,0.6,3.300 +23,AFR_u_new,urb,exist,1,1.52,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,0.25,0.6,3.300 +24,CPA_r_new,rur,exist,1,3.7,0.125,3,1,1.925,0.5,1.5,2.14,0.85,0.8,1,0.6,0.900 +25,CPA_u_new,urb,exist,1,1.52,0.125,3,1,1.925,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.900 +26,EEU_r_new,rur,exist,1,3.7,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,1,0.6,0.800 +27,EEU_u_new,urb,exist,1,1.52,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.800 +28,FSU_r_new,rur,exist,1,3.7,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,1,0.6,0.800 +29,FSU_u_new,urb,exist,1,1.52,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.800 +30,LAC_r_new,rur,exist,1,3.7,0.125,3,1,2.763,0.5,1.5,2.14,0.85,0.8,1,0.6,1.750 +31,LAC_u_new,urb,exist,1,1.52,0.125,3,1,2.763,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1.750 +32,MEA_r_new,rur,exist,1,3.7,0.125,3,1,2.863,0.5,1.5,2.14,0.85,0.8,1,0.6,1.750 +33,MEA_r_new,urb,exist,1,1.52,0.125,3,1,2.863,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1.750 +34,NAM_r_new,rur,exist,1,3.7,0.125,3,1,1.560,0.5,1.5,2.14,0.85,0.8,1,0.6,0.369 +35,NAM_u_new,urb,exist,1,1.52,0.125,3,1,1.560,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.369 +36,PAO_r_new,rur,exist,1,3.7,0.125,3,1,1.330,0.5,1.5,2.14,0.85,0.8,1,0.6,0.700 +37,PAO_u_new,urb,exist,1,1.52,0.125,3,1,1.330,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.700 +38,PAS_r_new,rur,exist,1,3.7,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,1,0.6,3.300 +39,PAS_u_new,urb,exist,1,1.52,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,0.25,0.6,3.300 +40,SAS_r_new,rur,exist,1,3.7,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,1,0.6,3.300 +41,SAS_u_new,urb,exist,1,1.52,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,0.25,0.6,3.300 +42,WEU_r_new,rur,exist,1,3.7,0.125,3,1,1.103,0.5,1.5,2.14,0.85,0.8,1,0.6,0.697 +43,WEU_u_new,urb,exist,1,1.52,0.125,3,1,1.103,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.697 \ No newline at end of file diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv new file mode 100644 index 0000000..0814a26 --- /dev/null +++ b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv @@ -0,0 +1,12 @@ +REGION_GEA,RegNum,arch,rural,urban +AFR,1,new,0,1 +CPA,2,new,2,3 +EEU,3,new,4,5 +FSU,4,new,6,7 +LAC,5,new,8,9 +MEA,6,new,10,11 +NAM,7,new,12,13 +PAO,8,new,14,15 +PAS,9,new,16,17 +SAS,10,new,18,19 +WEU,11,new,20,21 \ No newline at end of file diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/par_var.csv b/message_ix_buildings/data/chilled/versions/ALPS2023/par_var.csv new file mode 100755 index 0000000..adb40a3 --- /dev/null +++ b/message_ix_buildings/data/chilled/versions/ALPS2023/par_var.csv @@ -0,0 +1,4 @@ +id_run,name_run,cop,eff,t_sp_c,t_sp_c_max,t_sp_h,f_c,f_f,f_h +0,tm23ts23,1,1,23,23,21,0.333,0.333,1 +1,tm28ts26,1,1,26,28,20,0.333,0.333,1 +2,tm26ts26,1,1,26,26,20,0.333,0.333,1 diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/runs.csv b/message_ix_buildings/data/chilled/versions/ALPS2023/runs.csv new file mode 100755 index 0000000..813cc1e --- /dev/null +++ b/message_ix_buildings/data/chilled/versions/ALPS2023/runs.csv @@ -0,0 +1,11 @@ +id,scen,year,clim +1,ssp2,2015,2015 +2,ssp2,2020,2020 +3,ssp2,2030,2030 +4,ssp2,2040,2040 +5,ssp2,2050,2050 +6,ssp2,2060,2060 +7,ssp2,2070,2070 +8,ssp2,2080,2080 +9,ssp2,2090,2090 +10,ssp2,2100,2100 From 5a9e376b01a7fd4cefc744bfe770a44c433b214f Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:37:28 +0200 Subject: [PATCH 017/114] Add country data for CHILLED --- .../data/chilled/country/v1.csv | 197 ++++++++++++++++++ .../data/chilled/country/v2.csv | 197 ++++++++++++++++++ .../data/chilled/country/v3.csv | 197 ++++++++++++++++++ .../data/chilled/country/v4.csv | 197 ++++++++++++++++++ 4 files changed, 788 insertions(+) create mode 100755 message_ix_buildings/data/chilled/country/v1.csv create mode 100755 message_ix_buildings/data/chilled/country/v2.csv create mode 100755 message_ix_buildings/data/chilled/country/v3.csv create mode 100755 message_ix_buildings/data/chilled/country/v4.csv diff --git a/message_ix_buildings/data/chilled/country/v1.csv b/message_ix_buildings/data/chilled/country/v1.csv new file mode 100755 index 0000000..9f37fb9 --- /dev/null +++ b/message_ix_buildings/data/chilled/country/v1.csv @@ -0,0 +1,197 @@ +REGNUM,ISO,NAME,GLOBAL_SOUTH,REGION_GEA,CDD (Popwtd),GDPpercap2015,AC_penetr,access_elec,slum_pop +106,LSO,Lesotho,1,AFR,121,2708.148539,0.007057831,0.279232388,0.508 +94,KGZ,Kyrgyzstan,1,FSU,135,3237.602937,0.008611505,0.999065552, +152,RWA,Rwanda,1,AFR,337,1715.887074,0.011418056,0.228,0.532 +4,ALB,Albania,0,EEU,309,10971.29252,0.081731497,1, +13,BDI,Burundi,1,AFR,721,748.4152713,0.013895491,0.072520895,0.579 +58,ETH,Ethiopia,1,AFR,704,1533.107632,0.016496607,0.334185905,0.739 +30,CAF,Central African Republic,1,AFR,2308,626.4108725,0.017696637,0.133844233,0.933 +8,ARM,Armenia,0,FSU,160,8195.93365,0.029312546,1,0.144 +2,AFG,Afghanistan,1,SAS,725,1809.016488,0.017816148,0.715,0.627 +10,AUS,Australia,0,PAO,563,43719.50216,0.667499136,1, +11,AUT,Austria,0,WEU,113,44353.87521,0.231362438,1, +12,AZE,Azerbaijan,0,FSU,640,16698.86365,0.322075479,1, +37,COD,Dem. Rep. of the Congo,1,AFR,1921,750.0885772,0.017965046,0.164191647,0.748 +14,BEL,Belgium,0,WEU,86,41722.92186,0.191360952,1, +101,LBR,Liberia,1,AFR,2624,785.2468867,0.018468046,0.138400917,0.657 +113,MDG,Madagascar,1,AFR,1046,1377.168213,0.018475825,0.190350609,0.772 +125,MWI,Malawi,1,AFR,1456,1088.701805,0.018713486,0.108,0.667 +18,BGR,Bulgaria,0,EEU,217,17000.16725,0.17248546,1, +129,NER,Niger,1,AFR,3719,904.5797813,0.01910457,0.166,0.701 +122,MOZ,Mozambique,1,AFR,1981,1118.219536,0.019625672,0.24,0.803 +21,BIH,Bosnia and Herzegovina,0,EEU,133,10932.04871,0.045100697,1, +22,BLR,Belarus,0,FSU,84,17229.55519,0.091236349,1, +174,TJK,Tajikistan,1,FSU,603,2640.58952,0.01979512,0.999973526, +158,SLE,Sierra Leone,1,AFR,2926,1315.973533,0.020955048,0.164683762, +40,COM,Comoros,1,AFR,2018,1413.059277,0.021049141,0.753807144,0.696 +172,TGO,Togo,1,AFR,3244,1349.371568,0.021155963,0.450285454,0.512 +196,ZWE,Zimbabwe,1,AFR,1106,1912.280264,0.021257751,0.337,0.251 +183,UGA,Uganda,1,AFR,1475,1665.949905,0.021444084,0.185,0.536 +68,GNB,Guinea-Bissau,1,AFR,3065,1446.468649,0.021618789,0.140046701,0.823 +67,GMB,Gambia,1,AFR,3115,1568.022914,0.022242681,0.464866638,0.348 +31,CAN,Canada,0,NAM,137,43149.47584,0.264869388,1, +32,CHE,Switzerland,0,WEU,66,57264.1574,0.161173086,1, +16,BFA,Burkina Faso,1,AFR,3658,1596.334538,0.022429188,0.184700813,0.658 +79,HTI,Haiti,1,LAC,2361,1651.228445,0.02247832,0.382211266,0.744 +66,GIN,Guinea,1,AFR,2609,1753.063116,0.023113801,1,0.433 +162,SSD,South Sudan,1,MEA,3577,1808.161714,0.0235528,0.079354277,0.956 +176,TLS,East Timor,1,PAS,2459,1920.150472,0.023968314,0.672815339, +117,MLI,Mali,1,AFR,3702,1919.228421,0.024171765,0.376,0.563 +15,BEN,Benin,1,AFR,3470,1987.167146,0.024541993,0.400334778,0.615 +157,SLB,Solomon Islands,1,PAS,2647,2053.438806,0.024789029,0.551, +134,NPL,Nepal,1,SAS,1442,2314.274881,0.024809729,0.87213623,0.543 +171,TCD,Chad,1,AFR,3424,2047.637179,0.024884187,0.077,0.882 +93,KEN,Kenya,1,AFR,1016,2835.643662,0.025645389,0.416,0.56 +44,CYP,Cyprus,0,WEU,1107,30549.10097,0.841881769,1, +45,CZE,Czech Republic,0,EEU,91,30605.42052,0.190910576,1, +46,DEU,Germany,0,WEU,103,43937.94713,0.216847485,1, +182,TZA,United Republic of Tanzania,1,AFR,1469,2490.957101,0.025928367,0.185,0.507 +193,YEM,Yemen,1,MEA,1286,2641.045829,0.026130823,0.702139053,0.608 +49,DNK,Denmark,0,WEU,24,45458.69715,0.092526348,1, +155,SEN,Senegal,1,AFR,3053,2293.853539,0.026298485,0.605,0.394 +191,VUT,Vanuatu,1,PAS,2036,2806.789686,0.029064691,0.446696129, +121,MNG,Mongolia,1,CPA,61,11411.94211,0.029190579,0.811916275,0.427 +184,UKR,Ukraine,1,FSU,212,7464.939834,0.030552468,1, +17,BGD,Bangladesh,1,SAS,2625,3132.56754,0.031773208,0.682046814,0.551 +47,DJI,Djibouti,1,AFR,3302,3139.273535,0.031983323,0.520257759,0.656 +56,ESP,Spain,0,WEU,448,32291.1552,0.572128521,1, +57,EST,Estonia,0,EEU,31,27549.58137,0.095579082,1, +35,CIV,Cote d'Ivoire,1,AFR,2936,3241.612056,0.032679101,0.640861969,0.56 +59,FIN,Finland,0,WEU,23,38941.7636,0.090387402,1, +36,CMR,Cameroon,1,AFR,2239,3289.064546,0.032688124,0.588651009,0.378 +61,FRA,France,0,WEU,167,37765.75087,0.303053112,1, +195,ZMB,Zambia,1,AFR,1333,3627.202041,0.033022576,0.311,0.54 +63,GBR,United Kingdom,0,WEU,21,38839.16696,0.086989036,1, +64,GEO,Georgia,0,FSU,226,9025.133143,0.044554696,0.999934998, +95,KHM,Cambodia,1,CPA,3300,3290.952454,0.033114883,0.475657387,0.551 +147,PSE,Occupied Palestinian Terr.,1,MEA,959,4339.103693,0.035487757,1, +123,MRT,Mauritania,1,AFR,3732,3601.61435,0.035594033,0.395,0.799 +141,PNG,Papua New Guinea,1,PAS,2092,3866.513529,0.037128157,0.221889343, +65,GHA,Ghana,1,AFR,3261,3929.681044,0.038313522,0.757152786,0.379 +70,GRC,Greece,0,WEU,508,24170.30184,0.524533442,1, +77,HND,Honduras,1,LAC,1696,4311.176397,0.040209805,0.8998171,0.275 +72,GRL,Greenland,0,WEU,,,,1, +154,SDN,Sudan,1,MEA,3683,4290.372249,0.04163877,0.380091553,0.916 +137,PAK,Pakistan,1,SAS,2436,4695.699879,0.045233807,0.935,0.455 +187,UZB,Uzbekistan,1,FSU,906,5700.236028,0.047281906,1, +76,HKG,"China, Hong Kong SAR",0,CPA,1907,53595.24481,0.972987112,1, +131,NIC,Nicaragua,1,LAC,2430,4960.912412,0.048020442,0.811631393,0.455 +78,HRV,Croatia,0,EEU,244,20759.04815,0.272323808,1, +119,MMR,Myanmar,1,PAS,2719,5056.859041,0.049278927,0.605,0.41 +80,HUN,Hungary,0,EEU,225,25034.45073,0.322592051,1, +38,COG,Congo,1,AFR,2448,5542.892982,0.054748212,0.604,0.469 +190,VNM,Viet Nam,1,CPA,2641,5554.858056,0.055058876,1,0.272 +83,IRL,Ireland,0,WEU,4,61543.20777,0.058070329,1, +192,WSM,Samoa,1,PAS,3205,5558.791879,0.055353219,0.999382782, +130,NGA,Nigeria,1,AFR,3087,5670.639443,0.056722283,0.525,0.502 +86,ISL,Iceland,0,WEU,,,,1, +87,ISR,Israel,0,MEA,984,32024.35277,0.822851001,1, +88,ITA,Italy,0,WEU,363,34302.0374,0.509111902,1, +99,LAO,Lao People's Dem. Republic,1,CPA,2136,5755.059505,0.056959904,0.897,0.314 +82,IND,India,1,SAS,2761,5754.064597,0.057645582,0.88,0.24 +91,JPN,Japan,0,PAO,550,37882.98062,0.655437567,1, +92,KAZ,Kazakhstan,0,FSU,416,23522.29052,0.454510614,1, +3,AGO,Angola,1,AFR,1203,6231.067992,0.05800138,0.42,0.555 +111,MAR,Morocco,1,MEA,707,7296.934401,0.060854693,0.995860138,0.131 +24,BOL,Bolivia,1,LAC,1461,6531.519398,0.064625161,0.91522822,0.435 +73,GTM,Guatemala,1,LAC,1053,7292.719104,0.070607826,0.905062943,0.345 +97,KOR,Republic of Korea,0,PAS,538,34177.65447,0.640633059,1, +140,PHL,Philippines,1,PAS,2715,6874.582566,0.073840673,0.8908,0.383 +168,SWZ,Swaziland,1,AFR,996,7758.495563,0.076765288,0.62994545,0.327 +75,GUY,Guyana,1,LAC,2963,7074.207137,0.077310978,0.835683517,0.331 +28,BTN,Bhutan,1,SAS,1032,7743.337996,0.077375656,0.984235229, +90,JOR,Jordan,1,MEA,990,8491.050311,0.089612077,0.999983215,0.129 +159,SLV,El Salvador,1,LAC,2258,7845.157575,0.090453154,0.954,0.289 +23,BLZ,Belize,1,LAC,2547,8061.331831,0.095309455,0.918,0.108 +89,JAM,Jamaica,1,LAC,2264,8095.261867,0.095457224,0.972788849, +25,BRA,Brazil,1,LAC,1665,14666.01817,0.1,0.99710902,0.223 +107,LTU,Lithuania,0,EEU,58,27045.71302,0.134479719,1, +108,LUX,Luxembourg,0,WEU,97,94088.59223,0.208429615,1, +109,LVA,Latvia,0,EEU,42,23018.81611,0.096479666,1, +110,MAC,Macau,0,CPA,,,,1, +33,CHL,Chile,1,LAC,48,22536.61769,0.10155158,0.99714844,0.09 +112,MDA,Republic of Moldova,0,FSU,251,4746.784911,0.018788538,1, +60,FJI,Fiji,1,PAS,2001,8477.644733,0.102643431,0.971194916, +146,PRY,Paraguay,1,LAC,1659,8639.28685,0.104026635,0.99331532, +127,NAM,Namibia,1,AFR,1362,9964.222994,0.132384246,0.507034302,0.332 +116,MKD,TFYR Macedonia,0,EEU,138,12759.8166,0.065256978,1, +53,EGY,Egypt,1,MEA,1428,10095.61017,0.1372239,1,0.106 +118,MLT,Malta,0,WEU,,,,1, +179,TUN,Tunisia,1,MEA,1116,10749.85917,0.147675839,1,0.08 +120,MNE,Montenegro,0,EEU,98,15289.7174,0.077856069,0.999991608, +81,IDN,Indonesia,1,PAS,3012,10367.6953,0.154611223,0.975373674,0.218 +188,VCT,Saint Vincent and the Grenadines,1,LAC,3307,10447.52839,0.157325928,0.994550629, +52,ECU,Ecuador,1,LAC,2086,10749.12887,0.164147412,0.98825883,0.36 +194,ZAF,South Africa,1,AFR,678,12362.58381,0.166792615,0.855,0.23 +139,PER,Peru,1,LAC,971,11767.52174,0.172277415,0.93852179,0.342 +100,LBN,Lebanon,1,MEA,522,13352.71339,0.174377333,1,0.531 +105,LKA,Sri Lanka,1,SAS,2848,11061.84358,0.17712201,0.938899002, +51,DZA,Algeria,1,MEA,900,13724.72385,0.23820818,0.993367081, +39,COL,Colombia,1,LAC,1491,12985.38313,0.239690176,0.98186898,0.131 +50,DOM,Dominican Republic,1,LAC,2073,13371.52499,0.266951881,0.98560364,0.121 +114,MDV,Maldives,1,SAS,3518,13705.00532,0.287866737,0.999940109, +132,NLD,Netherlands,0,WEU,61,46494.36426,0.153146979,1, +133,NOR,Norway,0,WEU,14,64008.28683,0.075521182,1, +175,TKM,Turkmenistan,1,FSU,1207,14992.32314,0.319394584,1, +135,NZL,New Zealand,0,PAO,59,34646.31361,0.147586095,1, +42,CRI,Costa Rica,1,LAC,1871,14914.20675,0.340334716,0.99409804,0.055 +164,SUR,Suriname,1,LAC,3138,14766.79918,0.341559247,0.877446747,0.073 +85,IRQ,Iraq,1,MEA,2278,14928.8864,0.346473364,0.998621826,0.472 +29,BWA,Botswana,1,AFR,1512,15356.45762,0.353570326,0.585287514, +173,THA,Thailand,1,PAS,3116,15236.70646,0.366948938,0.996,0.25 +84,IRN,Iran (Islamic Republic of),1,MEA,1014,16500.90051,0.377280787,0.999750519, +142,POL,Poland,0,EEU,96,25299.97435,0.178685557,1, +185,URY,Uruguay,1,LAC,570,19831.44589,0.426562626,0.9970948, +7,ARG,Argentina,1,LAC,748,19101.29739,0.453799748,0.999952087,0.167 +145,PRT,Portugal,0,WEU,346,26607.83312,0.450801361,1, +62,GAB,Gabon,1,AFR,2600,16836.60591,0.456282675,0.903074722,0.37 +34,CHN,China,1,CPA,879,13569.89153,0.5,1,0.252 +124,MUS,Mauritius,1,AFR,1798,18864.10566,0.559986158,0.987412567, +138,PAN,Panama,1,LAC,2499,20674.29973,0.672683416,0.925548401,0.258 +150,ROU,Romania,0,EEU,209,20545.07714,0.240575252,1, +151,RUS,Russian Federation,0,FSU,170,24516.54995,0.259934235,1, +20,BHS,Bahamas,1,LAC,2401,21081.1124,0.691906054,1, +115,MEX,Mexico,1,LAC,968,16671.91198,0.7,0.99,0.111 +126,MYS,Malaysia,1,PAS,2686,25001.61267,0.849534752,0.999985886, +69,GNQ,Equatorial Guinea,1,AFR,2097,27572.58751,0.898284629,0.674737473,0.662 +156,SGP,Singapore,0,PAS,,,,1, +177,TON,Tonga,1,PAS,2949,31283.45801,0.959427292,0.961754532, +143,PRI,Puerto Rico,1,NAM,2233,35291.80356,0.971034039,1, +136,OMN,Oman,1,MEA,2536,40138.95172,0.987090344,1, +153,SAU,Saudi Arabia,1,MEA,2584,50723.71265,0.992057358,1,0.18 +161,SRB,Serbia,0,EEU,216,13277.80012,0.098156716,0.999827423, +27,BRN,Brunei Darussalam,1,PAS,3006,74600.1643,0.996563081,1, +98,KWT,Kuwait,1,MEA,3008,68476.32504,0.996571565,1, +6,ARE,United Arab Emirates,1,MEA,3052,65975.37555,0.996837326,1, +165,SVK,Slovakia,0,EEU,99,28308.87977,0.196176717,1, +166,SVN,Slovenia,0,EEU,114,29037.74168,0.218919312,1, +167,SWE,Sweden,0,WEU,23,45679.278,0.090836423,1, +149,QAT,Qatar,1,MEA,3226,119749.4285,0.997723159,1, +1,ABW,Aruba,1,LAC,,,,0.952381821, +5,AND,Andorra,,,,,,1, +9,ATG,Antigua & Barbuda,,,,,,0.968262939, +19,BHR,Bahrain,1,MEA,,,,1, +26,BRB,Barbados,1,LAC,,,,1, +41,CPV,Cape Verde,1,AFR,,,,0.902439041, +43,CUB,Cuba,1,LAC,,,,1, +48,DMA,Dominica,,,,,,0.999029694, +54,ERI,Eritrea,1,AFR,,,,0.455133209, +55,ESH,Western Sahara,1,AFR,,,,0, +71,GRD,Granada,,,,,,0.918716888,0.06 +180,TUR,Turkey,0,WEU,403,23388.4813,0.443093808,1,0.119 +74,GUF,French Guiana,1,LAC,,,,0, +96,KNA,Saint Kitts,,,,,,0.999300156, +102,LBY,Libyan Arab Jamahiriya,1,MEA,,,,0.985287628, +103,LCA,St. Lucia,1,LAC,,,,0.971630783,0.119 +104,LIE,Liechtenstein,,,,,,1, +186,USA,United States of America,0,NAM,710,53029.29336,0.74826754,1, +128,NCL,New Caledonia,1,PAS,,,,1, +144,PRK,North Korea,1,CPA,,,,0.374463196, +148,PYF,French Polynesia,1,PAS,,,,1, +160,SOM,Somalia,1,AFR,,,,0.282924042,0.736 +163,STP,Sao Tome and Principe,1,LAC,,,,0.645101471,0.866 +169,SYC,Seichelles,,,,,,0.996783218, +170,SYR,Syrian Arab Republic,1,MEA,,,,0.996365204,0.193 +178,TTO,Trinidad and Tobago,1,LAC,,,,1,0.247 +181,TWN,Taiwan,1,PAS,,,,0, +189,VEN,Venezuela,1,LAC,,,,0.994607391, diff --git a/message_ix_buildings/data/chilled/country/v2.csv b/message_ix_buildings/data/chilled/country/v2.csv new file mode 100755 index 0000000..619619d --- /dev/null +++ b/message_ix_buildings/data/chilled/country/v2.csv @@ -0,0 +1,197 @@ +REGNUM,ISO,NAME,GLOBAL_SOUTH,REGION_GEA,CDD (Popwtd),GDPpercap2015,AC_penetr,access_elec,slum_pop, +106,LSO,Lesotho,1,AFR,121,2708.148539,0.007057831,0.279232388,0.508, +94,KGZ,Kyrgyzstan,0,FSU,135,3237.602937,0.008611505,0.999065552,, +152,RWA,Rwanda,1,AFR,337,1715.887074,0.011418056,0.228,0.532, +4,ALB,Albania,0,EEU,309,10971.29252,0.081731497,1,, +13,BDI,Burundi,1,AFR,721,748.4152713,0.013895491,0.072520895,0.579, +58,ETH,Ethiopia,1,AFR,704,1533.107632,0.016496607,0.334185905,0.739, +30,CAF,Central African Republic,1,AFR,2308,626.4108725,0.017696637,0.133844233,0.933, +8,ARM,Armenia,0,FSU,160,8195.93365,0.029312546,1,0.144, +2,AFG,Afghanistan,1,SAS,725,1809.016488,0.017816148,0.715,0.627, +10,AUS,Australia,0,PAO,563,43719.50216,0.667499136,1,, +11,AUT,Austria,0,WEU,113,44353.87521,0.231362438,1,, +12,AZE,Azerbaijan,0,FSU,640,16698.86365,0.322075479,1,, +37,COD,Dem. Rep. of the Congo,1,AFR,1921,750.0885772,0.017965046,0.164191647,0.748, +14,BEL,Belgium,0,WEU,86,41722.92186,0.191360952,1,, +101,LBR,Liberia,1,AFR,2624,785.2468867,0.018468046,0.138400917,0.657, +113,MDG,Madagascar,1,AFR,1046,1377.168213,0.018475825,0.190350609,0.772, +125,MWI,Malawi,1,AFR,1456,1088.701805,0.018713486,0.108,0.667, +18,BGR,Bulgaria,0,EEU,217,17000.16725,0.17248546,1,, +129,NER,Niger,1,AFR,3719,904.5797813,0.01910457,0.166,0.701, +122,MOZ,Mozambique,1,AFR,1981,1118.219536,0.019625672,0.24,0.803, +21,BIH,Bosnia and Herzegovina,0,EEU,133,10932.04871,0.045100697,1,, +22,BLR,Belarus,0,FSU,84,17229.55519,0.091236349,1,, +174,TJK,Tajikistan,0,FSU,603,2640.58952,0.01979512,0.999973526,, +158,SLE,Sierra Leone,1,AFR,2926,1315.973533,0.020955048,0.164683762,0.559, +40,COM,Comoros,1,AFR,2018,1413.059277,0.021049141,0.753807144,0.696, +172,TGO,Togo,1,AFR,3244,1349.371568,0.021155963,0.450285454,0.512, +196,ZWE,Zimbabwe,1,AFR,1106,1912.280264,0.021257751,0.337,0.251, +183,UGA,Uganda,1,AFR,1475,1665.949905,0.021444084,0.185,0.536, +68,GNB,Guinea-Bissau,1,AFR,3065,1446.468649,0.021618789,0.140046701,0.823, +67,GMB,Gambia,1,AFR,3115,1568.022914,0.022242681,0.464866638,0.348, +31,CAN,Canada,0,NAM,137,43149.47584,0.264869388,1,, +32,CHE,Switzerland,0,WEU,66,57264.1574,0.161173086,1,, +16,BFA,Burkina Faso,1,AFR,3658,1596.334538,0.022429188,0.184700813,0.658, +79,HTI,Haiti,1,LAC,2361,1651.228445,0.02247832,0.382211266,0.744, +66,GIN,Guinea,1,AFR,2609,1753.063116,0.023113801,1,0.433, +162,SSD,South Sudan,1,MEA,3577,1808.161714,0.0235528,0.079354277,0.956, +176,TLS,East Timor,1,PAS,2459,1920.150472,0.023968314,0.672815339,0.284, +117,MLI,Mali,1,AFR,3702,1919.228421,0.024171765,0.376,0.563, +15,BEN,Benin,1,AFR,3470,1987.167146,0.024541993,0.400334778,0.615, +157,SLB,Solomon Islands,1,PAS,2647,2053.438806,0.024789029,0.551,0.284, +134,NPL,Nepal,1,SAS,1442,2314.274881,0.024809729,0.87213623,0.543, +171,TCD,Chad,1,AFR,3424,2047.637179,0.024884187,0.077,0.882, +93,KEN,Kenya,1,AFR,1016,2835.643662,0.025645389,0.416,0.56, +44,CYP,Cyprus,0,WEU,1107,30549.10097,0.841881769,1,, +45,CZE,Czech Republic,0,EEU,91,30605.42052,0.190910576,1,, +46,DEU,Germany,0,WEU,103,43937.94713,0.216847485,1,, +182,TZA,United Republic of Tanzania,1,AFR,1469,2490.957101,0.025928367,0.185,0.507, +193,YEM,Yemen,1,MEA,1286,2641.045829,0.026130823,0.702139053,0.608, +49,DNK,Denmark,0,WEU,24,45458.69715,0.092526348,1,, +155,SEN,Senegal,1,AFR,3053,2293.853539,0.026298485,0.605,0.394, +191,VUT,Vanuatu,1,PAS,2036,2806.789686,0.029064691,0.446696129,0.284, +121,MNG,Mongolia,1,CPA,61,11411.94211,0.029190579,0.811916275,0.427, +184,UKR,Ukraine,0,FSU,212,7464.939834,0.030552468,1,, +17,BGD,Bangladesh,1,SAS,2625,3132.56754,0.031773208,0.682046814,0.551, +47,DJI,Djibouti,1,AFR,3302,3139.273535,0.031983323,0.520257759,0.656, +56,ESP,Spain,0,WEU,448,32291.1552,0.572128521,1,, +57,EST,Estonia,0,EEU,31,27549.58137,0.095579082,1,, +35,CIV,Cote d'Ivoire,1,AFR,2936,3241.612056,0.032679101,0.640861969,0.56, +59,FIN,Finland,0,WEU,23,38941.7636,0.090387402,1,, +36,CMR,Cameroon,1,AFR,2239,3289.064546,0.032688124,0.588651009,0.378, +61,FRA,France,0,WEU,167,37765.75087,0.303053112,1,, +195,ZMB,Zambia,1,AFR,1333,3627.202041,0.033022576,0.311,0.54, +63,GBR,United Kingdom,0,WEU,21,38839.16696,0.086989036,1,, +64,GEO,Georgia,0,FSU,226,9025.133143,0.044554696,0.999934998,, +95,KHM,Cambodia,1,CPA,3300,3290.952454,0.033114883,0.475657387,0.551, +147,PSE,Occupied Palestinian Terr.,1,MEA,959,4339.103693,0.035487757,1,0.249, +123,MRT,Mauritania,1,AFR,3732,3601.61435,0.035594033,0.395,0.799, +141,PNG,Papua New Guinea,1,PAS,2092,3866.513529,0.037128157,0.221889343,0.284, +65,GHA,Ghana,1,AFR,3261,3929.681044,0.038313522,0.757152786,0.379, +70,GRC,Greece,0,WEU,508,24170.30184,0.524533442,1,, +77,HND,Honduras,1,LAC,1696,4311.176397,0.040209805,0.8998171,0.275, +1,ABW,Aruba,1,LAC,,,,0.952381821,0.211, +154,SDN,Sudan,1,MEA,3683,4290.372249,0.04163877,0.380091553,0.916, +137,PAK,Pakistan,1,SAS,2436,4695.699879,0.045233807,0.935,0.455, +187,UZB,Uzbekistan,0,FSU,906,5700.236028,0.047281906,1,, +76,HKG,"China, Hong Kong SAR",1,CPA,1907,53595.24481,0.972987112,1,0.262, +131,NIC,Nicaragua,1,LAC,2430,4960.912412,0.048020442,0.811631393,0.455, +78,HRV,Croatia,0,EEU,244,20759.04815,0.272323808,1,, +119,MMR,Myanmar,1,PAS,2719,5056.859041,0.049278927,0.605,0.41, +80,HUN,Hungary,0,EEU,225,25034.45073,0.322592051,1,, +38,COG,Congo,1,AFR,2448,5542.892982,0.054748212,0.604,0.469, +190,VNM,Viet Nam,1,CPA,2641,5554.858056,0.055058876,1,0.272, +83,IRL,Ireland,0,WEU,4,61543.20777,0.058070329,1,, +192,WSM,Samoa,1,PAS,3205,5558.791879,0.055353219,0.999382782,0.284, +130,NGA,Nigeria,1,AFR,3087,5670.639443,0.056722283,0.525,0.502, +5,AND,Andorra,0,WEU,,,,1,, +87,ISR,Israel,1,MEA,984,32024.35277,0.822851001,1,0.249, +88,ITA,Italy,0,WEU,363,34302.0374,0.509111902,1,, +99,LAO,Lao People's Dem. Republic,1,CPA,2136,5755.059505,0.056959904,0.897,0.314, +82,IND,India,1,SAS,2761,5754.064597,0.057645582,0.88,0.24, +91,JPN,Japan,0,PAO,550,37882.98062,0.655437567,1,, +92,KAZ,Kazakhstan,0,FSU,416,23522.29052,0.454510614,1,, +3,AGO,Angola,1,AFR,1203,6231.067992,0.05800138,0.42,0.555, +111,MAR,Morocco,1,MEA,707,7296.934401,0.060854693,0.995860138,0.131, +24,BOL,Bolivia,1,LAC,1461,6531.519398,0.064625161,0.91522822,0.435, +73,GTM,Guatemala,1,LAC,1053,7292.719104,0.070607826,0.905062943,0.345, +97,KOR,Republic of Korea,1,PAS,538,34177.65447,0.640633059,1,0.284, +140,PHL,Philippines,1,PAS,2715,6874.582566,0.073840673,0.8908,0.383, +168,SWZ,Swaziland,1,AFR,996,7758.495563,0.076765288,0.62994545,0.327, +75,GUY,Guyana,1,LAC,2963,7074.207137,0.077310978,0.835683517,0.331, +28,BTN,Bhutan,1,SAS,1032,7743.337996,0.077375656,0.984235229,0.313, +90,JOR,Jordan,1,MEA,990,8491.050311,0.089612077,0.999983215,0.129, +159,SLV,El Salvador,1,LAC,2258,7845.157575,0.090453154,0.954,0.289, +23,BLZ,Belize,1,LAC,2547,8061.331831,0.095309455,0.918,0.108, +89,JAM,Jamaica,1,LAC,2264,8095.261867,0.095457224,0.972788849,0.211, +25,BRA,Brazil,1,LAC,1665,14666.01817,0.1,0.99710902,0.223, +107,LTU,Lithuania,0,EEU,58,27045.71302,0.134479719,1,, +108,LUX,Luxembourg,0,WEU,97,94088.59223,0.208429615,1,, +109,LVA,Latvia,0,EEU,42,23018.81611,0.096479666,1,, +9,ATG,Antigua & Barbuda,1,LAC,,20154.94749,,0.968262939,0.211, +33,CHL,Chile,1,LAC,48,22536.61769,0.10155158,0.99714844,0.09, +112,MDA,Republic of Moldova,0,FSU,251,4746.784911,0.018788538,1,, +60,FJI,Fiji,1,PAS,2001,8477.644733,0.102643431,0.971194916,0.284, +146,PRY,Paraguay,1,LAC,1659,8639.28685,0.104026635,0.99331532,0.211, +127,NAM,Namibia,1,AFR,1362,9964.222994,0.132384246,0.507034302,0.332, +116,MKD,TFYR Macedonia,0,EEU,138,12759.8166,0.065256978,1,, +53,EGY,Egypt,1,MEA,1428,10095.61017,0.1372239,1,0.106, +19,BHR,Bahrain,1,MEA,,43926.47404,,1,0.249, +179,TUN,Tunisia,1,MEA,1116,10749.85917,0.147675839,1,0.08, +120,MNE,Montenegro,0,EEU,98,15289.7174,0.077856069,0.999991608,, +81,IDN,Indonesia,1,PAS,3012,10367.6953,0.154611223,0.975373674,0.218, +188,VCT,Saint Vincent and the Grenadines,1,LAC,3307,10447.52839,0.157325928,0.994550629,0.211, +52,ECU,Ecuador,1,LAC,2086,10749.12887,0.164147412,0.98825883,0.36, +194,ZAF,South Africa,1,AFR,678,12362.58381,0.166792615,0.855,0.23, +139,PER,Peru,1,LAC,971,11767.52174,0.172277415,0.93852179,0.342, +100,LBN,Lebanon,1,MEA,522,13352.71339,0.174377333,1,0.531, +105,LKA,Sri Lanka,1,SAS,2848,11061.84358,0.17712201,0.938899002,0.313, +51,DZA,Algeria,1,MEA,900,13724.72385,0.23820818,0.993367081,0.119, +39,COL,Colombia,1,LAC,1491,12985.38313,0.239690176,0.98186898,0.131, +50,DOM,Dominican Republic,1,LAC,2073,13371.52499,0.266951881,0.98560364,0.121, +114,MDV,Maldives,1,SAS,3518,13705.00532,0.287866737,0.999940109,0.313, +132,NLD,Netherlands,0,WEU,61,46494.36426,0.153146979,1,, +133,NOR,Norway,0,WEU,14,64008.28683,0.075521182,1,, +175,TKM,Turkmenistan,0,FSU,1207,14992.32314,0.319394584,1,, +135,NZL,New Zealand,0,PAO,59,34646.31361,0.147586095,1,, +42,CRI,Costa Rica,1,LAC,1871,14914.20675,0.340334716,0.99409804,0.055, +164,SUR,Suriname,1,LAC,3138,14766.79918,0.341559247,0.877446747,0.073, +85,IRQ,Iraq,1,MEA,2278,14928.8864,0.346473364,0.998621826,0.472, +29,BWA,Botswana,1,AFR,1512,15356.45762,0.353570326,0.585287514,0.559, +173,THA,Thailand,1,PAS,3116,15236.70646,0.366948938,0.996,0.25, +84,IRN,Iran (Islamic Republic of),1,MEA,1014,16500.90051,0.377280787,0.999750519,0.249, +142,POL,Poland,0,EEU,96,25299.97435,0.178685557,1,, +185,URY,Uruguay,1,LAC,570,19831.44589,0.426562626,0.9970948,0.211, +7,ARG,Argentina,1,LAC,748,19101.29739,0.453799748,0.999952087,0.167, +145,PRT,Portugal,0,WEU,346,26607.83312,0.450801361,1,, +62,GAB,Gabon,1,AFR,2600,16836.60591,0.456282675,0.903074722,0.37, +34,CHN,China,1,CPA,879,13569.89153,0.5,1,0.252, +124,MUS,Mauritius,1,AFR,1798,18864.10566,0.559986158,0.987412567,0.559, +138,PAN,Panama,1,LAC,2499,20674.29973,0.672683416,0.925548401,0.258, +150,ROU,Romania,0,EEU,209,20545.07714,0.240575252,1,, +151,RUS,Russian Federation,0,FSU,170,24516.54995,0.259934235,1,, +20,BHS,Bahamas,1,LAC,2401,21081.1124,0.691906054,1,0.211, +115,MEX,Mexico,1,LAC,968,16671.91198,0.7,0.99,0.111, +126,MYS,Malaysia,1,PAS,2686,25001.61267,0.849534752,0.999985886,0.284, +69,GNQ,Equatorial Guinea,1,AFR,2097,27572.58751,0.674737473,0.674737473,0.662, +26,BRB,Barbados,1,LAC,,,,1,0.211, +177,TON,Tonga,1,PAS,2949,31283.45801,0.959427292,0.961754532,0.284, +143,PRI,Puerto Rico,0,NAM,2233,35291.80356,0.971034039,1,, +136,OMN,Oman,1,MEA,2536,40138.95172,0.987090344,1,0.249, +153,SAU,Saudi Arabia,1,MEA,2584,50723.71265,0.992057358,1,0.18, +161,SRB,Serbia,0,EEU,216,13277.80012,0.098156716,0.999827423,, +27,BRN,Brunei Darussalam,1,PAS,3006,74600.1643,0.996563081,1,0.284, +98,KWT,Kuwait,1,MEA,3008,68476.32504,0.996571565,1,0.249, +6,ARE,United Arab Emirates,1,MEA,3052,65975.37555,0.996837326,1,0.249, +165,SVK,Slovakia,0,EEU,99,28308.87977,0.196176717,1,, +166,SVN,Slovenia,0,EEU,114,29037.74168,0.218919312,1,, +167,SWE,Sweden,0,WEU,23,45679.278,0.090836423,1,, +149,QAT,Qatar,1,MEA,3226,119749.4285,0.997723159,1,0.249, +41,CPV,Cape Verde,1,AFR,,5915.122633,,0.902439041,0.559, +43,CUB,Cuba,1,LAC,2531,,,1,0.211, +48,DMA,Dominica,1,LAC,,9941.894925,,0.999029694,0.211, +54,ERI,Eritrea,1,AFR,1888,1510.458929,0.021397846,0.455133209,0.559, +55,ESH,Western Sahara,1,AFR,1769,,,0,0.559, +71,GRD,Grenada,1,LAC,,12757.96625,,0.918716888,0.06, +72,GRL,Greenland,0,WEU,,,,1,, +74,GUF,French Guiana,1,LAC,2716,,,0,0.211, +86,ISL,Iceland,0,WEU,,43048.12515,,1,, +96,KNA,Saint Kitts,1,LAC,,24169.85992,,0.999300156,0.211, +102,LBY,Libyan Arab Jamahiriya,1,MEA,1487,14847.19705,0.32637951,0.985287628,0.119, +180,TUR,Turkey,0,WEU,403,23388.4813,0.443093808,1,0.119, +103,LCA,St. Lucia,1,LAC,,12522.04023,,0.971630783,0.119, +104,LIE,Liechtenstein,0,WEU,,,,1,, +110,MAC,Macau,1,CPA,,100444.5936,,1,0.262, +118,MLT,Malta,0,WEU,,34087.08151,,1,, +128,NCL,New Caledonia,1,PAS,1321,,,1,0.284, +186,USA,United States of America,0,NAM,710,53029.29336,0.74826754,1,, +144,PRK,North Korea,1,CPA,350,,,0.374463196,0.262, +148,PYF,French Polynesia,1,PAS,1221,,,1,0.284, +156,SGP,Singapore,1,PAS,,81741.09694,,1,0.284, +160,SOM,Somalia,1,AFR,3200,,,0.282924042,0.736, +163,STP,Sao Tome and Principe,1,LAC,,2947.510971,,0.645101471,0.866, +169,SYC,Seichelles,1,AFR,,24856.5599,,0.996783218,0.559, +170,SYR,Syrian Arab Republic,1,MEA,1180,,,0.996365204,0.193, +178,TTO,Trinidad and Tobago,1,LAC,2949,31524.58862,0.961397362,1,0.247, +181,TWN,Taiwan,1,PAS,1229,,,1,0.284, +189,VEN,Venezuela,1,LAC,2419,16745.02198,0.449592952,0.994607391,0.211, diff --git a/message_ix_buildings/data/chilled/country/v3.csv b/message_ix_buildings/data/chilled/country/v3.csv new file mode 100755 index 0000000..ee06b2c --- /dev/null +++ b/message_ix_buildings/data/chilled/country/v3.csv @@ -0,0 +1,197 @@ +REGNUM,ISO,NAME,GLOBAL_SOUTH,REGION_GEA,CDD (Popwtd),GDPpercap2015,AC_penetr,access_elec,slum_pop,AC_penetr_R,AC_penetr_U +106,LSO,Lesotho,1,AFR,121,2708.148539,0.007057831,0.279232388,0.508,0.007057831,0.007057831 +94,KGZ,Kyrgyzstan,0,FSU,135,3237.602937,0.008611505,0.999065552,,0.008611505,0.008611505 +152,RWA,Rwanda,1,AFR,337,1715.887074,0.011418056,0.228,0.532,0.011418056,0.011418056 +4,ALB,Albania,0,EEU,309,10971.29252,0.081731497,1,,0.081731497,0.081731497 +13,BDI,Burundi,1,AFR,721,748.4152713,0.013895491,0.072520895,0.579,0.013895491,0.013895491 +58,ETH,Ethiopia,1,AFR,704,1533.107632,0.016496607,0.334185905,0.739,0.016496607,0.016496607 +30,CAF,Central African Republic,1,AFR,2308,626.4108725,0.017696637,0.133844233,0.933,0.017696637,0.017696637 +8,ARM,Armenia,0,FSU,160,8195.93365,0.029312546,1,0.144,0.029312546,0.029312546 +2,AFG,Afghanistan,1,SAS,725,1809.016488,0.017816148,0.715,0.627,0.017816148,0.017816148 +10,AUS,Australia,0,PAO,563,43719.50216,0.667499136,1,,0.667499136,0.667499136 +11,AUT,Austria,0,WEU,113,44353.87521,0.231362438,1,,0.231362438,0.231362438 +12,AZE,Azerbaijan,0,FSU,640,16698.86365,0.322075479,1,,0.322075479,0.322075479 +37,COD,Dem. Rep. of the Congo,1,AFR,1921,750.0885772,0.017965046,0.164191647,0.748,0.017965046,0.017965046 +14,BEL,Belgium,0,WEU,86,41722.92186,0.191360952,1,,0.191360952,0.191360952 +101,LBR,Liberia,1,AFR,2624,785.2468867,0.018468046,0.138400917,0.657,0.018468046,0.018468046 +113,MDG,Madagascar,1,AFR,1046,1377.168213,0.018475825,0.190350609,0.772,0.018475825,0.018475825 +125,MWI,Malawi,1,AFR,1456,1088.701805,0.018713486,0.108,0.667,0.018713486,0.018713486 +18,BGR,Bulgaria,0,EEU,217,17000.16725,0.17248546,1,,0.17248546,0.17248546 +129,NER,Niger,1,AFR,3719,904.5797813,0.01910457,0.166,0.701,0.01910457,0.01910457 +122,MOZ,Mozambique,1,AFR,1981,1118.219536,0.019625672,0.24,0.803,0.019625672,0.019625672 +21,BIH,Bosnia and Herzegovina,0,EEU,133,10932.04871,0.045100697,1,,0.045100697,0.045100697 +22,BLR,Belarus,0,FSU,84,17229.55519,0.091236349,1,,0.091236349,0.091236349 +174,TJK,Tajikistan,0,FSU,603,2640.58952,0.01979512,0.999973526,,0.01979512,0.01979512 +158,SLE,Sierra Leone,1,AFR,2926,1315.973533,0.020955048,0.164683762,0.559,0.020955048,0.020955048 +40,COM,Comoros,1,AFR,2018,1413.059277,0.021049141,0.753807144,0.696,0.021049141,0.021049141 +172,TGO,Togo,1,AFR,3244,1349.371568,0.021155963,0.450285454,0.512,0.021155963,0.021155963 +196,ZWE,Zimbabwe,1,AFR,1106,1912.280264,0.021257751,0.337,0.251,0.021257751,0.021257751 +183,UGA,Uganda,1,AFR,1475,1665.949905,0.021444084,0.185,0.536,0.021444084,0.021444084 +68,GNB,Guinea-Bissau,1,AFR,3065,1446.468649,0.021618789,0.140046701,0.823,0.021618789,0.021618789 +67,GMB,Gambia,1,AFR,3115,1568.022914,0.022242681,0.464866638,0.348,0.022242681,0.022242681 +31,CAN,Canada,0,NAM,137,43149.47584,0.264869388,1,,0.264869388,0.264869388 +32,CHE,Switzerland,0,WEU,66,57264.1574,0.161173086,1,,0.161173086,0.161173086 +16,BFA,Burkina Faso,1,AFR,3658,1596.334538,0.022429188,0.184700813,0.658,0.022429188,0.022429188 +79,HTI,Haiti,1,LAC,2361,1651.228445,0.02247832,0.382211266,0.744,0.02247832,0.02247832 +66,GIN,Guinea,1,AFR,2609,1753.063116,0.023113801,1,0.433,0.023113801,0.023113801 +162,SSD,South Sudan,1,MEA,3577,1808.161714,0.0235528,0.079354277,0.956,0.0235528,0.0235528 +176,TLS,East Timor,1,PAS,2459,1920.150472,0.023968314,0.672815339,0.284,0.023968314,0.023968314 +117,MLI,Mali,1,AFR,3702,1919.228421,0.024171765,0.376,0.563,0.024171765,0.024171765 +15,BEN,Benin,1,AFR,3470,1987.167146,0.024541993,0.400334778,0.615,0.024541993,0.024541993 +157,SLB,Solomon Islands,1,PAS,2647,2053.438806,0.024789029,0.551,0.284,0.024789029,0.024789029 +134,NPL,Nepal,1,SAS,1442,2314.274881,0.024809729,0.87213623,0.543,0.024809729,0.024809729 +171,TCD,Chad,1,AFR,3424,2047.637179,0.024884187,0.077,0.882,0.024884187,0.024884187 +93,KEN,Kenya,1,AFR,1016,2835.643662,0.025645389,0.416,0.56,0.025645389,0.025645389 +44,CYP,Cyprus,0,WEU,1107,30549.10097,0.841881769,1,,0.841881769,0.841881769 +45,CZE,Czech Republic,0,EEU,91,30605.42052,0.190910576,1,,0.190910576,0.190910576 +46,DEU,Germany,0,WEU,103,43937.94713,0.216847485,1,,0.216847485,0.216847485 +182,TZA,United Republic of Tanzania,1,AFR,1469,2490.957101,0.025928367,0.185,0.507,0.025928367,0.025928367 +193,YEM,Yemen,1,MEA,1286,2641.045829,0.026130823,0.702139053,0.608,0.026130823,0.026130823 +49,DNK,Denmark,0,WEU,24,45458.69715,0.092526348,1,,0.092526348,0.092526348 +155,SEN,Senegal,1,AFR,3053,2293.853539,0.026298485,0.605,0.394,0.026298485,0.026298485 +191,VUT,Vanuatu,1,PAS,2036,2806.789686,0.029064691,0.446696129,0.284,0.029064691,0.029064691 +121,MNG,Mongolia,1,CPA,61,11411.94211,0.029190579,0.811916275,0.427,0.029190579,0.029190579 +184,UKR,Ukraine,0,FSU,212,7464.939834,0.030552468,1,,0.030552468,0.030552468 +17,BGD,Bangladesh,1,SAS,2625,3132.56754,0.031773208,0.682046814,0.551,0.031773208,0.031773208 +47,DJI,Djibouti,1,AFR,3302,3139.273535,0.031983323,0.520257759,0.656,0.031983323,0.031983323 +56,ESP,Spain,0,WEU,448,32291.1552,0.572128521,1,,0.572128521,0.572128521 +57,EST,Estonia,0,EEU,31,27549.58137,0.095579082,1,,0.095579082,0.095579082 +35,CIV,Cote d'Ivoire,1,AFR,2936,3241.612056,0.032679101,0.640861969,0.56,0.032679101,0.032679101 +59,FIN,Finland,0,WEU,23,38941.7636,0.090387402,1,,0.090387402,0.090387402 +36,CMR,Cameroon,1,AFR,2239,3289.064546,0.032688124,0.588651009,0.378,0.032688124,0.032688124 +61,FRA,France,0,WEU,167,37765.75087,0.303053112,1,,0.303053112,0.303053112 +195,ZMB,Zambia,1,AFR,1333,3627.202041,0.033022576,0.311,0.54,0.033022576,0.033022576 +63,GBR,United Kingdom,0,WEU,21,38839.16696,0.086989036,1,,0.086989036,0.086989036 +64,GEO,Georgia,0,FSU,226,9025.133143,0.044554696,0.999934998,,0.044554696,0.044554696 +95,KHM,Cambodia,1,CPA,3300,3290.952454,0.033114883,0.475657387,0.551,0.033114883,0.033114883 +147,PSE,Occupied Palestinian Terr.,1,MEA,959,4339.103693,0.035487757,1,0.249,0.035487757,0.035487757 +123,MRT,Mauritania,1,AFR,3732,3601.61435,0.035594033,0.395,0.799,0.035594033,0.035594033 +141,PNG,Papua New Guinea,1,PAS,2092,3866.513529,0.037128157,0.221889343,0.284,0.037128157,0.037128157 +65,GHA,Ghana,1,AFR,3261,3929.681044,0.038313522,0.757152786,0.379,0.038313522,0.038313522 +70,GRC,Greece,0,WEU,508,24170.30184,0.524533442,1,,0.524533442,0.524533442 +77,HND,Honduras,1,LAC,1696,4311.176397,0.040209805,0.8998171,0.275,0.040209805,0.040209805 +1,ABW,Aruba,1,LAC,,,,0.952381821,0.211,, +154,SDN,Sudan,1,MEA,3683,4290.372249,0.04163877,0.380091553,0.916,0.04163877,0.04163877 +137,PAK,Pakistan,1,SAS,2436,4695.699879,0.045233807,0.935,0.455,0.045233807,0.045233807 +187,UZB,Uzbekistan,0,FSU,906,5700.236028,0.047281906,1,,0.047281906,0.047281906 +76,HKG,"China, Hong Kong SAR",1,CPA,1907,53595.24481,0.972987112,1,0.262,0.972987112,0.972987112 +131,NIC,Nicaragua,1,LAC,2430,4960.912412,0.048020442,0.811631393,0.455,0.048020442,0.048020442 +78,HRV,Croatia,0,EEU,244,20759.04815,0.272323808,1,,0.272323808,0.272323808 +119,MMR,Myanmar,1,PAS,2719,5056.859041,0.049278927,0.605,0.41,0.049278927,0.049278927 +80,HUN,Hungary,0,EEU,225,25034.45073,0.322592051,1,,0.322592051,0.322592051 +38,COG,Congo,1,AFR,2448,5542.892982,0.054748212,0.604,0.469,0.054748212,0.054748212 +190,VNM,Viet Nam,1,CPA,2641,5554.858056,0.055058876,1,0.272,0.055058876,0.055058876 +83,IRL,Ireland,0,WEU,4,61543.20777,0.058070329,1,,0.058070329,0.058070329 +192,WSM,Samoa,1,PAS,3205,5558.791879,0.055353219,0.999382782,0.284,0.055353219,0.055353219 +130,NGA,Nigeria,1,AFR,3087,5670.639443,0.056722283,0.525,0.502,0.056722283,0.056722283 +5,AND,Andorra,0,WEU,,,,1,,, +87,ISR,Israel,1,MEA,984,32024.35277,0.822851001,1,0.249,0.822851001,0.822851001 +88,ITA,Italy,0,WEU,363,34302.0374,0.509111902,1,,0.509111902,0.509111902 +99,LAO,Lao People's Dem. Republic,1,CPA,2136,5755.059505,0.056959904,0.897,0.314,0.056959904,0.056959904 +82,IND,India,1,SAS,2761,5754.064597,0.057645582,0.88,0.24,0.057645582,0.057645582 +91,JPN,Japan,0,PAO,550,37882.98062,0.655437567,1,,0.655437567,0.655437567 +92,KAZ,Kazakhstan,0,FSU,416,23522.29052,0.454510614,1,,0.454510614,0.454510614 +3,AGO,Angola,1,AFR,1203,6231.067992,0.05800138,0.42,0.555,0.05800138,0.05800138 +111,MAR,Morocco,1,MEA,707,7296.934401,0.060854693,0.995860138,0.131,0.060854693,0.060854693 +24,BOL,Bolivia,1,LAC,1461,6531.519398,0.064625161,0.91522822,0.435,0.064625161,0.064625161 +73,GTM,Guatemala,1,LAC,1053,7292.719104,0.070607826,0.905062943,0.345,0.070607826,0.070607826 +97,KOR,Republic of Korea,1,PAS,538,34177.65447,0.640633059,1,0.284,0.640633059,0.640633059 +140,PHL,Philippines,1,PAS,2715,6874.582566,0.073840673,0.8908,0.383,0.073840673,0.073840673 +168,SWZ,Swaziland,1,AFR,996,7758.495563,0.076765288,0.62994545,0.327,0.076765288,0.076765288 +75,GUY,Guyana,1,LAC,2963,7074.207137,0.077310978,0.835683517,0.331,0.077310978,0.077310978 +28,BTN,Bhutan,1,SAS,1032,7743.337996,0.077375656,0.984235229,0.313,0.077375656,0.077375656 +90,JOR,Jordan,1,MEA,990,8491.050311,0.089612077,0.999983215,0.129,0.089612077,0.089612077 +159,SLV,El Salvador,1,LAC,2258,7845.157575,0.090453154,0.954,0.289,0.090453154,0.090453154 +23,BLZ,Belize,1,LAC,2547,8061.331831,0.095309455,0.918,0.108,0.095309455,0.095309455 +89,JAM,Jamaica,1,LAC,2264,8095.261867,0.095457224,0.972788849,0.211,0.095457224,0.095457224 +25,BRA,Brazil,1,LAC,1665,14666.01817,0.1,0.99710902,0.223,0.1,0.1 +107,LTU,Lithuania,0,EEU,58,27045.71302,0.134479719,1,,0.134479719,0.134479719 +108,LUX,Luxembourg,0,WEU,97,94088.59223,0.208429615,1,,0.208429615,0.208429615 +109,LVA,Latvia,0,EEU,42,23018.81611,0.096479666,1,,0.096479666,0.096479666 +9,ATG,Antigua & Barbuda,1,LAC,,20154.94749,,0.968262939,0.211,, +33,CHL,Chile,1,LAC,48,22536.61769,0.10155158,0.99714844,0.09,0.10155158,0.10155158 +112,MDA,Republic of Moldova,0,FSU,251,4746.784911,0.018788538,1,,0.018788538,0.018788538 +60,FJI,Fiji,1,PAS,2001,8477.644733,0.102643431,0.971194916,0.284,0.102643431,0.102643431 +146,PRY,Paraguay,1,LAC,1659,8639.28685,0.104026635,0.99331532,0.211,0.104026635,0.104026635 +127,NAM,Namibia,1,AFR,1362,9964.222994,0.132384246,0.507034302,0.332,0.132384246,0.132384246 +116,MKD,TFYR Macedonia,0,EEU,138,12759.8166,0.065256978,1,,0.065256978,0.065256978 +53,EGY,Egypt,1,MEA,1428,10095.61017,0.1372239,1,0.106,0.1372239,0.1372239 +19,BHR,Bahrain,1,MEA,,43926.47404,,1,0.249,, +179,TUN,Tunisia,1,MEA,1116,10749.85917,0.147675839,1,0.08,0.147675839,0.147675839 +120,MNE,Montenegro,0,EEU,98,15289.7174,0.077856069,0.999991608,,0.077856069,0.077856069 +81,IDN,Indonesia,1,PAS,3012,10367.6953,0.154611223,0.975373674,0.218,0.154611223,0.154611223 +188,VCT,Saint Vincent and the Grenadines,1,LAC,3307,10447.52839,0.157325928,0.994550629,0.211,0.157325928,0.157325928 +52,ECU,Ecuador,1,LAC,2086,10749.12887,0.164147412,0.98825883,0.36,0.164147412,0.164147412 +194,ZAF,South Africa,1,AFR,678,12362.58381,0.166792615,0.855,0.23,0.166792615,0.166792615 +139,PER,Peru,1,LAC,971,11767.52174,0.172277415,0.93852179,0.342,0.172277415,0.172277415 +100,LBN,Lebanon,1,MEA,522,13352.71339,0.174377333,1,0.531,0.174377333,0.174377333 +105,LKA,Sri Lanka,1,SAS,2848,11061.84358,0.17712201,0.938899002,0.313,0.17712201,0.17712201 +51,DZA,Algeria,1,MEA,900,13724.72385,0.23820818,0.993367081,0.119,0.23820818,0.23820818 +39,COL,Colombia,1,LAC,1491,12985.38313,0.239690176,0.98186898,0.131,0.239690176,0.239690176 +50,DOM,Dominican Republic,1,LAC,2073,13371.52499,0.266951881,0.98560364,0.121,0.266951881,0.266951881 +114,MDV,Maldives,1,SAS,3518,13705.00532,0.287866737,0.999940109,0.313,0.287866737,0.287866737 +132,NLD,Netherlands,0,WEU,61,46494.36426,0.153146979,1,,0.153146979,0.153146979 +133,NOR,Norway,0,WEU,14,64008.28683,0.075521182,1,,0.075521182,0.075521182 +175,TKM,Turkmenistan,0,FSU,1207,14992.32314,0.319394584,1,,0.319394584,0.319394584 +135,NZL,New Zealand,0,PAO,59,34646.31361,0.147586095,1,,0.147586095,0.147586095 +42,CRI,Costa Rica,1,LAC,1871,14914.20675,0.340334716,0.99409804,0.055,0.340334716,0.340334716 +164,SUR,Suriname,1,LAC,3138,14766.79918,0.341559247,0.877446747,0.073,0.341559247,0.341559247 +85,IRQ,Iraq,1,MEA,2278,14928.8864,0.346473364,0.998621826,0.472,0.346473364,0.346473364 +29,BWA,Botswana,1,AFR,1512,15356.45762,0.353570326,0.585287514,0.559,0.353570326,0.353570326 +173,THA,Thailand,1,PAS,3116,15236.70646,0.366948938,0.996,0.25,0.366948938,0.366948938 +84,IRN,Iran (Islamic Republic of),1,MEA,1014,16500.90051,0.377280787,0.999750519,0.249,0.377280787,0.377280787 +142,POL,Poland,0,EEU,96,25299.97435,0.178685557,1,,0.178685557,0.178685557 +185,URY,Uruguay,1,LAC,570,19831.44589,0.426562626,0.9970948,0.211,0.426562626,0.426562626 +7,ARG,Argentina,1,LAC,748,19101.29739,0.453799748,0.999952087,0.167,0.453799748,0.453799748 +145,PRT,Portugal,0,WEU,346,26607.83312,0.450801361,1,,0.450801361,0.450801361 +62,GAB,Gabon,1,AFR,2600,16836.60591,0.456282675,0.903074722,0.37,0.456282675,0.456282675 +34,CHN,China,1,CPA,879,13569.89153,0.5,1,0.252,0.254,0.748 +124,MUS,Mauritius,1,AFR,1798,18864.10566,0.559986158,0.987412567,0.559,0.559986158,0.559986158 +138,PAN,Panama,1,LAC,2499,20674.29973,0.672683416,0.925548401,0.258,0.672683416,0.672683416 +150,ROU,Romania,0,EEU,209,20545.07714,0.240575252,1,,0.240575252,0.240575252 +151,RUS,Russian Federation,0,FSU,170,24516.54995,0.259934235,1,,0.259934235,0.259934235 +20,BHS,Bahamas,1,LAC,2401,21081.1124,0.691906054,1,0.211,0.691906054,0.691906054 +115,MEX,Mexico,1,LAC,968,16671.91198,0.7,0.99,0.111,0.7,0.7 +126,MYS,Malaysia,1,PAS,2686,25001.61267,0.849534752,0.999985886,0.284,0.849534752,0.849534752 +69,GNQ,Equatorial Guinea,1,AFR,2097,27572.58751,0.674737473,0.674737473,0.662,0.674737473,0.674737473 +26,BRB,Barbados,1,LAC,,,,1,0.211,, +177,TON,Tonga,1,PAS,2949,31283.45801,0.959427292,0.961754532,0.284,0.959427292,0.959427292 +143,PRI,Puerto Rico,0,NAM,2233,35291.80356,0.971034039,1,,0.971034039,0.971034039 +136,OMN,Oman,1,MEA,2536,40138.95172,0.987090344,1,0.249,0.987090344,0.987090344 +153,SAU,Saudi Arabia,1,MEA,2584,50723.71265,0.992057358,1,0.18,0.992057358,0.992057358 +161,SRB,Serbia,0,EEU,216,13277.80012,0.098156716,0.999827423,,0.098156716,0.098156716 +27,BRN,Brunei Darussalam,1,PAS,3006,74600.1643,0.996563081,1,0.284,0.996563081,0.996563081 +98,KWT,Kuwait,1,MEA,3008,68476.32504,0.996571565,1,0.249,0.996571565,0.996571565 +6,ARE,United Arab Emirates,1,MEA,3052,65975.37555,0.996837326,1,0.249,0.996837326,0.996837326 +165,SVK,Slovakia,0,EEU,99,28308.87977,0.196176717,1,,0.196176717,0.196176717 +166,SVN,Slovenia,0,EEU,114,29037.74168,0.218919312,1,,0.218919312,0.218919312 +167,SWE,Sweden,0,WEU,23,45679.278,0.090836423,1,,0.090836423,0.090836423 +149,QAT,Qatar,1,MEA,3226,119749.4285,0.997723159,1,0.249,0.997723159,0.997723159 +41,CPV,Cape Verde,1,AFR,,5915.122633,,0.902439041,0.559,, +43,CUB,Cuba,1,LAC,2531,,,1,0.211,, +48,DMA,Dominica,1,LAC,,9941.894925,,0.999029694,0.211,, +54,ERI,Eritrea,1,AFR,1888,1510.458929,0.021397846,0.455133209,0.559,0.021397846,0.021397846 +55,ESH,Western Sahara,1,AFR,1769,,,0,0.559,, +71,GRD,Grenada,1,LAC,,12757.96625,,0.918716888,0.06,, +72,GRL,Greenland,0,WEU,,,,1,,, +74,GUF,French Guiana,1,LAC,2716,,,0,0.211,, +86,ISL,Iceland,0,WEU,,43048.12515,,1,,, +96,KNA,Saint Kitts,1,LAC,,24169.85992,,0.999300156,0.211,, +102,LBY,Libyan Arab Jamahiriya,1,MEA,1487,14847.19705,0.32637951,0.985287628,0.119,0.32637951,0.32637951 +180,TUR,Turkey,0,WEU,403,23388.4813,0.443093808,1,0.119,0.443093808,0.443093808 +103,LCA,St. Lucia,1,LAC,,12522.04023,,0.971630783,0.119,, +104,LIE,Liechtenstein,0,WEU,,,,1,,, +110,MAC,Macau,1,CPA,,100444.5936,,1,0.262,, +118,MLT,Malta,0,WEU,,34087.08151,,1,,, +128,NCL,New Caledonia,1,PAS,1321,,,1,0.284,, +186,USA,United States of America,0,NAM,710,53029.29336,0.74826754,1,,0.74826754,0.74826754 +144,PRK,North Korea,1,CPA,350,,,0.374463196,0.262,, +148,PYF,French Polynesia,1,PAS,1221,,,1,0.284,, +156,SGP,Singapore,1,PAS,,81741.09694,,1,0.284,, +160,SOM,Somalia,1,AFR,3200,,0.018,0.282924042,0.736,0.018,0.018 +163,STP,Sao Tome and Principe,1,LAC,,2947.510971,,0.645101471,0.866,, +169,SYC,Seichelles,1,AFR,,24856.5599,,0.996783218,0.559,, +170,SYR,Syrian Arab Republic,1,MEA,1180,,,0.996365204,0.193,, +178,TTO,Trinidad and Tobago,1,LAC,2949,31524.58862,0.961397362,1,0.247,0.961397362,0.961397362 +181,TWN,Taiwan,1,PAS,1229,,,1,0.284,, +189,VEN,Venezuela,1,LAC,2419,16745.02198,0.449592952,0.994607391,0.211,0.449592952,0.449592952 diff --git a/message_ix_buildings/data/chilled/country/v4.csv b/message_ix_buildings/data/chilled/country/v4.csv new file mode 100755 index 0000000..a8e061b --- /dev/null +++ b/message_ix_buildings/data/chilled/country/v4.csv @@ -0,0 +1,197 @@ +REGNUM,ISO,NAME,GLOBAL_SOUTH,REGION_GEA,CDD (Popwtd),GDPpercap,access_elec,slum_pop,AC_penetr,AC_penetr_R,AC_penetr_U +1,ABW,Aruba,1,LAC,,,1,0,,, +2,AFG,Afghanistan,1,SAS,725,,1,0,,, +3,AGO,Angola,1,AFR,1203,,1,0,,, +4,ALB,Albania,0,EEU,309,,1,0,,, +5,AND,Andorra,0,WEU,,,1,0,,, +6,ARE,United Arab Emirates,1,MEA,3052,,1,0,,, +7,ARG,Argentina,1,LAC,748,33731,1,0,0.749613387,0.749613387,0.749613387 +8,ARM,Armenia,0,FSU,160,32590,1,0,0.288298408,0.288298408,0.288298408 +9,ATG,Antigua & Barbuda,1,LAC,,,1,0,,, +10,AUS,Australia,0,PAO,563,85533,1,0,0.668840875,0.668840875,0.668840875 +11,AUT,Austria,0,WEU,113,52103,1,0,0.231698735,0.231698735,0.231698735 +12,AZE,Azerbaijan,0,FSU,640,39382,1,0,0.709264932,0.709264932,0.709264932 +13,BDI,Burundi,1,AFR,721,1920,1,0,0.018235053,0.018235053,0.018235053 +14,BEL,Belgium,0,WEU,86,90680,1,0,0.191978388,0.191978388,0.191978388 +15,BEN,Benin,1,AFR,3470,4335,1,0,0.042042913,0.042042913,0.042042913 +16,BFA,Burkina Faso,1,AFR,3658,2640,1,0,0.02854355,0.02854355,0.02854355 +17,BGD,Bangladesh,1,SAS,2625,5986,1,0,0.06060816,0.06060816,0.06060816 +18,BGR,Bulgaria,0,EEU,217,27648,1,0,0.336985791,0.336985791,0.336985791 +19,BHR,Bahrain,1,MEA,,58462,1,0,0.050996886,0.050996886,0.050996886 +20,BHS,Bahamas,1,LAC,2401,55613,1,0,0.989231548,0.989231548,0.989231548 +21,BIH,Bosnia and Herzegovina,0,EEU,133,32455,1,0,0.25263309,0.25263309,0.25263309 +22,BLR,Belarus,0,FSU,84,32244,1,0,0.183357218,0.183357218,0.183357218 +23,BLZ,Belize,1,LAC,2547,22327,1,0,0.751447164,0.751447164,0.751447164 +24,BOL,Bolivia,1,LAC,1461,13464,1,0,0.259582963,0.259582963,0.259582963 +25,BRA,Brazil,1,LAC,1665,26617,1,0,0.858448923,0.858448923,0.858448923 +26,BRB,Barbados,1,LAC,,28032,1,0,0.047101036,0.047101036,0.047101036 +27,BRN,Brunei Darussalam,1,PAS,3006,24527,1,0,0.837471518,0.837471518,0.837471518 +28,BTN,Bhutan,1,SAS,1032,23723,1,0,0.70109035,0.70109035,0.70109035 +29,BWA,Botswana,1,AFR,1512,34254,1,0,0.926304116,0.926304116,0.926304116 +30,CAF,Central African Republic,1,AFR,2308,3596,1,0,0.035128943,0.035128943,0.035128943 +31,CAN,Canada,0,NAM,137,65651,1,0,0.265475893,0.265475893,0.265475893 +32,CHE,Switzerland,0,WEU,66,59548,1,0,0.161178551,0.161178551,0.161178551 +33,CHL,Chile,1,LAC,48,28795,1,0,0.123910728,0.123910728,0.123910728 +34,CHN,China,1,CPA,879,43065,1,0,0.814685832,0.814685832,0.814685832 +35,CIV,Cote d'Ivoire,1,AFR,2936,5344,1,0,0.052669357,0.052669357,0.052669357 +36,CMR,Cameroon,1,AFR,2239,7714,1,0,0.087886716,0.087886716,0.087886716 +37,COD,Dem. Rep. of the Congo,1,AFR,1921,9163,1,0,0.118110301,0.118110301,0.118110301 +38,COG,Congo,1,AFR,2448,13951,1,0,0.297424371,0.297424371,0.297424371 +39,COL,Colombia,1,LAC,1491,22135,1,0,0.70538725,0.70538725,0.70538725 +40,COM,Comoros,1,AFR,2018,4844,1,0,0.04621694,0.04621694,0.04621694 +41,CPV,Cape Verde,1,AFR,,12191,1,0,0.011245693,0.011245693,0.011245693 +42,CRI,Costa Rica,1,LAC,1871,23609,1,0,0.785758806,0.785758806,0.785758806 +43,CUB,Cuba,1,LAC,2531,31817,1,0,0.959268486,0.959268486,0.959268486 +44,CYP,Cyprus,0,WEU,1107,52481,1,0,0.880038682,0.880038682,0.880038682 +45,CZE,Czech Republic,0,EEU,91,33147,1,0,0.194702888,0.194702888,0.194702888 +46,DEU,Germany,0,WEU,103,44390,1,0,0.216889465,0.216889465,0.216889465 +47,DJI,Djibouti,1,AFR,3302,4779,1,0,0.04646616,0.04646616,0.04646616 +48,DMA,Dominica,1,LAC,,,1,0,,, +49,DNK,Denmark,0,WEU,24,46926,1,0,0.092562491,0.092562491,0.092562491 +50,DOM,Dominican Republic,1,LAC,2073,25277,1,0,0.845821115,0.845821115,0.845821115 +51,DZA,Algeria,1,MEA,900,17798,1,0,0.425441845,0.425441845,0.425441845 +52,ECU,Ecuador,1,LAC,2086,20823,1,0,0.673163861,0.673163861,0.673163861 +53,EGY,Egypt,1,MEA,1428,17581,1,0,0.470584449,0.470584449,0.470584449 +54,ERI,Eritrea,1,AFR,1888,5575,1,0,0.054138473,0.054138473,0.054138473 +55,ESH,Western Sahara,1,AFR,1769,,1,0,,, +56,ESP,Spain,0,WEU,448,67804,1,0,0.589384039,0.589384039,0.589384039 +57,EST,Estonia,0,EEU,31,31966,1,0,0.101153379,0.101153379,0.101153379 +58,ETH,Ethiopia,1,AFR,704,3285,1,0,0.024705608,0.024705608,0.024705608 +59,FIN,Finland,0,WEU,23,58876,1,0,0.090946146,0.090946146,0.090946146 +60,FJI,Fiji,1,PAS,2001,20361,1,0,0.647397091,0.647397091,0.647397091 +61,FRA,France,0,WEU,167,77023,1,0,0.30555072,0.30555072,0.30555072 +62,GAB,Gabon,1,AFR,2600,20033,1,0,0.63996721,0.63996721,0.63996721 +63,GBR,United Kingdom,0,WEU,21,87315,1,0,0.087544967,0.087544967,0.087544967 +64,GEO,Georgia,0,FSU,226,34178,1,0,0.370938814,0.370938814,0.370938814 +65,GHA,Ghana,1,AFR,3261,6309,1,0,0.065433311,0.065433311,0.065433311 +66,GIN,Guinea,1,AFR,2609,4567,1,0,0.044057578,0.044057578,0.044057578 +67,GMB,Gambia,1,AFR,3115,7806,1,0,0.090704402,0.090704402,0.090704402 +68,GNB,Guinea-Bissau,1,AFR,3065,4475,1,0,0.043328634,0.043328634,0.043328634 +69,GNQ,Equatorial Guinea,1,AFR,2097,37667,1,0,0.972987454,0.972987454,0.972987454 +70,GRC,Greece,0,WEU,508,72228,1,0,0.632966608,0.632966608,0.632966608 +71,GRD,Grenada,1,LAC,,,1,0,,, +72,GRL,Greenland,0,WEU,,,1,0,,, +73,GTM,Guatemala,1,LAC,1053,19549,1,0,0.536147487,0.536147487,0.536147487 +74,GUF,French Guiana,1,LAC,2716,,1,0,,, +75,GUY,Guyana,1,LAC,2963,13909,1,0,0.297155835,0.297155835,0.297155835 +76,HKG,"China, Hong Kong SAR",1,CPA,1907,63592,1,0,0.973157796,0.973157796,0.973157796 +77,HND,Honduras,1,LAC,1696,13059,1,0,0.247616077,0.247616077,0.247616077 +78,HRV,Croatia,0,EEU,244,32594,1,0,0.387790772,0.387790772,0.387790772 +79,HTI,Haiti,1,LAC,2361,8118,1,0,0.096144863,0.096144863,0.096144863 +80,HUN,Hungary,0,EEU,225,37094,1,0,0.373322011,0.373322011,0.373322011 +81,IDN,Indonesia,1,PAS,3012,27312,1,0,0.907503289,0.907503289,0.907503289 +82,IND,India,1,SAS,2761,25715,1,0,0.869870509,0.869870509,0.869870509 +83,IRL,Ireland,0,WEU,4,64216,1,0,0.058071131,0.058071131,0.058071131 +84,IRN,Iran (Islamic Republic of),1,MEA,1014,24160,1,0,0.710316384,0.710316384,0.710316384 +85,IRQ,Iraq,1,MEA,2278,28823,1,0,0.923235987,0.923235987,0.923235987 +86,ISL,Iceland,0,WEU,,79711,1,0,0.05099998,0.05099998,0.05099998 +87,ISR,Israel,1,MEA,984,29427,1,0,0.801618074,0.801618074,0.801618074 +88,ITA,Italy,0,WEU,363,77982,1,0,0.518647696,0.518647696,0.518647696 +89,JAM,Jamaica,1,LAC,2264,30760,1,0,0.945250437,0.945250437,0.945250437 +90,JOR,Jordan,1,MEA,990,19823,1,0,0.538853959,0.538853959,0.538853959 +91,JPN,Japan,0,PAO,550,47500,1,0,0.660150108,0.660150108,0.660150108 +92,KAZ,Kazakhstan,0,FSU,416,32295,1,0,0.547563545,0.547563545,0.547563545 +93,KEN,Kenya,1,AFR,1016,9148,1,0,0.103739,0.103739,0.103739 +94,KGZ,Kyrgyzstan,0,FSU,135,34365,1,0,0.257966229,0.257966229,0.257966229 +95,KHM,Cambodia,1,CPA,3300,15924,1,0,0.40580033,0.40580033,0.40580033 +96,KNA,Saint Kitts,1,LAC,,,1,0,,, +97,KOR,Republic of Korea,1,PAS,538,35308,1,0,0.64349521,0.64349521,0.64349521 +98,KWT,Kuwait,1,MEA,3008,40273,1,0,0.992063674,0.992063674,0.992063674 +99,LAO,Lao People's Dem. Republic,1,CPA,2136,10112,1,0,0.144784418,0.144784418,0.144784418 +100,LBN,Lebanon,1,MEA,522,29799,1,0,0.609273709,0.609273709,0.609273709 +101,LBR,Liberia,1,AFR,2624,4120,1,0,0.039814466,0.039814466,0.039814466 +102,LBY,Libyan Arab Jamahiriya,1,MEA,1487,23952,1,0,0.772902871,0.772902871,0.772902871 +103,LCA,St. Lucia,1,LAC,,,1,0,,, +104,LIE,Liechtenstein,0,WEU,,,1,0,,, +105,LKA,Sri Lanka,1,SAS,2848,10263,1,0,0.151212485,0.151212485,0.151212485 +106,LSO,Lesotho,1,AFR,121,5009,1,0,0.011924697,0.011924697,0.011924697 +107,LTU,Lithuania,0,EEU,58,30991,1,0,0.142685366,0.142685366,0.142685366 +108,LUX,Luxembourg,0,WEU,97,199080,1,0,0.208429617,0.208429617,0.208429617 +109,LVA,Latvia,0,EEU,42,31634,1,0,0.118505198,0.118505198,0.118505198 +110,MAC,Macau,1,CPA,,,1,0,,, +111,MAR,Morocco,1,MEA,707,11203,1,0,0.136622084,0.136622084,0.136622084 +112,MDA,Republic of Moldova,0,FSU,251,33174,1,0,0.39678896,0.39678896,0.39678896 +113,MDG,Madagascar,1,AFR,1046,3587,1,0,0.030741441,0.030741441,0.030741441 +114,MDV,Maldives,1,SAS,3518,12398,1,0,0.228749543,0.228749543,0.228749543 +115,MEX,Mexico,1,LAC,968,31534,1,0,0.815287988,0.815287988,0.815287988 +116,MKD,TFYR Macedonia,0,EEU,138,32255,1,0,0.25897147,0.25897147,0.25897147 +117,MLI,Mali,1,AFR,3702,6376,1,0,0.066490629,0.066490629,0.066490629 +118,MLT,Malta,0,WEU,,63709,1,0,0.050999102,0.050999102,0.050999102 +119,MMR,Myanmar,1,PAS,2719,,1,0,,, +120,MNE,Montenegro,0,EEU,98,,1,0,,, +121,MNG,Mongolia,1,CPA,61,13051,1,0,0.039479059,0.039479059,0.039479059 +122,MOZ,Mozambique,1,AFR,1981,4442,1,0,0.042130742,0.042130742,0.042130742 +123,MRT,Mauritania,1,AFR,3732,6916,1,0,0.074891967,0.074891967,0.074891967 +124,MUS,Mauritius,1,AFR,1798,18095,1,0,0.51651044,0.51651044,0.51651044 +125,MWI,Malawi,1,AFR,1456,4175,1,0,0.038069328,0.038069328,0.038069328 +126,MYS,Malaysia,1,PAS,2686,26393,1,0,0.885638001,0.885638001,0.885638001 +127,NAM,Namibia,1,AFR,1362,18770,1,0,0.530951682,0.530951682,0.530951682 +128,NCL,New Caledonia,1,PAS,1321,,1,0,,, +129,NER,Niger,1,AFR,3719,3200,1,0,0.032466651,0.032466651,0.032466651 +130,NGA,Nigeria,1,AFR,3087,11827,1,0,0.205425389,0.205425389,0.205425389 +131,NIC,Nicaragua,1,LAC,2430,8794,1,0,0.111131441,0.111131441,0.111131441 +132,NLD,Netherlands,0,WEU,61,80466,1,0,0.15330642,0.15330642,0.15330642 +133,NOR,Norway,0,WEU,14,92697,1,0,0.07552242,0.07552242,0.07552242 +134,NPL,Nepal,1,SAS,1442,5761,1,0,0.054335083,0.054335083,0.054335083 +135,NZL,New Zealand,0,PAO,59,51365,1,0,0.150084631,0.150084631,0.150084631 +136,OMN,Oman,1,MEA,2536,30121,1,0,0.944092238,0.944092238,0.944092238 +137,PAK,Pakistan,1,SAS,2436,9911,1,0,0.14006375,0.14006375,0.14006375 +138,PAN,Panama,1,LAC,2499,26247,1,0,0.879935786,0.879935786,0.879935786 +139,PER,Peru,1,LAC,971,22451,1,0,0.645134401,0.645134401,0.645134401 +140,PHL,Philippines,1,PAS,2715,11980,1,0,0.210773466,0.210773466,0.210773466 +141,PNG,Papua New Guinea,1,PAS,2092,16318,1,0,0.421169739,0.421169739,0.421169739 +142,POL,Poland,0,EEU,96,40646,1,0,0.206089686,0.206089686,0.206089686 +143,PRI,Puerto Rico,0,NAM,2233,36581,1,0,0.974780419,0.974780419,0.974780419 +144,PRK,North Korea,1,CPA,350,,1,0,,, +145,PRT,Portugal,0,WEU,346,63019,1,0,0.503089567,0.503089567,0.503089567 +146,PRY,Paraguay,1,LAC,1659,13191,1,0,0.252655752,0.252655752,0.252655752 +147,PSE,Occupied Palestinian Terr.,1,MEA,959,,1,0,,, +148,PYF,French Polynesia,1,PAS,1221,,1,0,,, +149,QAT,Qatar,1,MEA,3226,,1,0,,, +150,ROU,Romania,0,EEU,209,32555,1,0,0.348140337,0.348140337,0.348140337 +151,RUS,Russian Federation,0,FSU,170,32456,1,0,0.300711877,0.300711877,0.300711877 +152,RWA,Rwanda,1,AFR,337,3796,1,0,0.018422666,0.018422666,0.018422666 +153,SAU,Saudi Arabia,1,MEA,2584,28144,1,0,0.918403681,0.918403681,0.918403681 +154,SDN,Sudan,1,MEA,3683,9276,1,0,0.124042374,0.124042374,0.124042374 +155,SEN,Senegal,1,AFR,3053,6374,1,0,0.06631409,0.06631409,0.06631409 +156,SGP,Singapore,1,PAS,,79330,1,0,0.050999978,0.050999978,0.050999978 +157,SLB,Solomon Islands,1,PAS,2647,12337,1,0,0.224985918,0.224985918,0.224985918 +158,SLE,Sierra Leone,1,AFR,2926,4653,1,0,0.045069791,0.045069791,0.045069791 +159,SLV,El Salvador,1,LAC,2258,18161,1,0,0.530480372,0.530480372,0.530480372 +160,SOM,Somalia,1,AFR,3200,3317,1,0,0.033299489,0.033299489,0.033299489 +161,SRB,Serbia,0,EEU,216,32850,1,0,0.356923388,0.356923388,0.356923388 +162,SSD,South Sudan,1,MEA,3577,,1,0,,, +163,STP,Sao Tome and Principe,1,LAC,,,1,0,,, +164,SUR,Suriname,1,LAC,3138,35056,1,0,0.981933073,0.981933073,0.981933073 +165,SVK,Slovakia,0,EEU,99,33073,1,0,0.206215855,0.206215855,0.206215855 +166,SVN,Slovenia,0,EEU,114,32720,1,0,0.227011419,0.227011419,0.227011419 +167,SWE,Sweden,0,WEU,23,82616,1,0,0.090951163,0.090951163,0.090951163 +168,SWZ,Swaziland,1,AFR,996,13557,1,0,0.239680262,0.239680262,0.239680262 +169,SYC,Seichelles,1,AFR,,,1,0,,, +170,SYR,Syrian Arab Republic,1,MEA,1180,14284,1,0,0.284060773,0.284060773,0.284060773 +171,TCD,Chad,1,AFR,3424,4561,1,0,0.044247952,0.044247952,0.044247952 +172,TGO,Togo,1,AFR,3244,2100,1,0,0.025171212,0.025171212,0.025171212 +173,THA,Thailand,1,PAS,3116,25743,1,0,0.872899287,0.872899287,0.872899287 +174,TJK,Tajikistan,0,FSU,603,33632,1,0,0.677826558,0.677826558,0.677826558 +175,TKM,Turkmenistan,0,FSU,1207,33475,1,0,0.88061639,0.88061639,0.88061639 +176,TLS,East Timor,1,PAS,2459,16904,1,0,0.459196357,0.459196357,0.459196357 +177,TON,Tonga,1,PAS,2949,,1,0,,, +178,TTO,Trinidad and Tobago,1,LAC,2949,26785,1,0,0.896454377,0.896454377,0.896454377 +179,TUN,Tunisia,1,MEA,1116,20042,1,0,0.569222871,0.569222871,0.569222871 +180,TUR,Turkey,0,WEU,403,26175,1,0,0.490312235,0.490312235,0.490312235 +181,TWN,Taiwan,1,PAS,1229,,1,0,,, +182,TZA,United Republic of Tanzania,1,AFR,1469,4698,1,0,0.042931773,0.042931773,0.042931773 +183,UGA,Uganda,1,AFR,1475,5648,1,0,0.053197309,0.053197309,0.053197309 +184,UKR,Ukraine,0,FSU,212,33165,1,0,0.35294207,0.35294207,0.35294207 +185,URY,Uruguay,1,LAC,570,30669,1,0,0.644586183,0.644586183,0.644586183 +186,USA,United States of America,0,NAM,710,67102,1,0,0.748427242,0.748427242,0.748427242 +187,UZB,Uzbekistan,0,FSU,906,34063,1,0,0.809580362,0.809580362,0.809580362 +188,VCT,Saint Vincent and the Grenadines,1,LAC,3307,,1,0,,, +189,VEN,Venezuela,1,LAC,2419,31035,1,0,0.951062841,0.951062841,0.951062841 +190,VNM,Viet Nam,1,CPA,2641,20492,1,0,0.66465797,0.66465797,0.66465797 +191,VUT,Vanuatu,1,PAS,2036,23550,1,0,0.789796686,0.789796686,0.789796686 +192,WSM,Samoa,1,PAS,3205,24999,1,0,0.852776746,0.852776746,0.852776746 +193,YEM,Yemen,1,MEA,1286,29395,1,0,0.862627281,0.862627281,0.862627281 +194,ZAF,South Africa,1,AFR,678,26253,1,0,0.650795508,0.650795508,0.650795508 +195,ZMB,Zambia,1,AFR,1333,9140,1,0,0.111228643,0.111228643,0.111228643 +196,ZWE,Zimbabwe,1,AFR,1106,1890,1,0,0.021148487,0.021148487,0.021148487 From 7b9a9d3880a68026df44ec8bf5a616b92d10af3a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Mon, 8 Jul 2024 17:43:15 +0200 Subject: [PATCH 018/114] Edit function name --- message_ix_buildings/chilled/preprocess/message_raster.py | 2 +- message_ix_buildings/chilled/run_preprocess.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 5e7a71b..b71479b 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -10,7 +10,7 @@ from utils.config import Config # type: ignore -def create_archetype_template_map(config: "Config"): +def create_message_raster(config: "Config"): input_path = os.path.join(config.dle_path, "data") output_path = os.path.join(config.dle_path, "out", "raster") diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 3ad7c8d..2a12146 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,6 +1,6 @@ import os -from preprocess.message_raster import create_archetype_template_map # type: ignore +from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore cfg = Config() @@ -10,6 +10,6 @@ if not os.path.exists( os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_" + cfg.node + ".nc") ): - create_archetype_template_map(cfg) + create_message_raster(cfg) else: print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") From edab215b6f85493bdabc9e13b147f2d5277289ca Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 10:42:50 +0200 Subject: [PATCH 019/114] Replace input CSVs with Excel files --- .../chilled/versions/ALPS2023/arch_input.csv | 45 ------------------ .../versions/ALPS2023/arch_input_reg.xlsx | Bin 0 -> 27580 bytes .../versions/ALPS2023/arch_regions.csv | 12 ----- .../versions/ALPS2023/arch_regions.xlsx | Bin 0 -> 22870 bytes 4 files changed, 57 deletions(-) delete mode 100644 message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv create mode 100755 message_ix_buildings/data/chilled/versions/ALPS2023/arch_input_reg.xlsx delete mode 100644 message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv create mode 100755 message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.xlsx diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv deleted file mode 100644 index a140e91..0000000 --- a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input.csv +++ /dev/null @@ -1,45 +0,0 @@ -id,name,urt,arch,permanent,area_env,gl_perc,vol,fl_cnd,u_val,ach_cl,ach_op,gn_int,gl_g,gl_sh,roof_area,roof_abs,u_roof -0,AFR_r_new,rur,new,1,3.7,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,1,0.6,2.7 -1,AFR_u_new,urb,new,1,1.52,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,0.25,0.6,2.7 -2,CPA_r_new,rur,new,1,3.7,0.125,3,1,1.525,0.5,1.5,2.14,0.85,0.8,1,0.6,0.7 -3,CPA_u_new,urb,new,1,1.52,0.125,3,1,1.525,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.7 -4,EEU_r_new,rur,new,1,3.7,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,1,0.6,0.23 -5,EEU_u_new,urb,new,1,1.52,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.23 -6,FSU_r_new,rur,new,1,3.7,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,1,0.6,0.23 -7,FSU_u_new,urb,new,1,1.52,0.125,3,1,0.705,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.23 -8,LAC_r_new,rur,new,1,3.7,0.125,3,1,2.65,0.5,1.5,2.14,0.85,0.8,1,0.6,1.6 -9,LAC_u_new,urb,new,1,1.52,0.125,3,1,2.65,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1.6 -10,MEA_r_new,rur,new,1,3.7,0.125,3,1,2.5,0.5,1.5,2.14,0.85,0.8,1,0.6,1 -11,MEA_r_new,urb,new,1,1.52,0.125,3,1,2.5,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1 -12,NAM_r_new,rur,new,1,3.7,0.125,3,1,1.39,0.5,1.5,2.14,0.85,0.8,1,0.6,0.34 -13,NAM_u_new,urb,new,1,1.52,0.125,3,1,1.39,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.34 -14,PAO_r_new,rur,new,1,3.7,0.125,3,1,0.940,0.5,1.5,2.14,0.85,0.8,1,0.6,0.35 -15,PAO_u_new,urb,new,1,1.52,0.125,3,1,0.940,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.35 -16,PAS_r_new,rur,new,1,3.7,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,1,0.6,2.7 -17,PAS_u_new,urb,new,1,1.52,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,0.25,0.6,2.7 -18,SAS_r_new,rur,new,1,3.7,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,1,0.6,2.7 -19,SAS_u_new,urb,new,1,1.52,0.125,3,1,3.025,0.5,1.5,2.14,0.85,0.8,0.25,0.6,2.7 -20,WEU_r_new,rur,new,1,3.7,0.125,3,1,0.57875,0.5,1.5,2.14,0.85,0.8,1,0.6,0.2 -21,WEU_u_new,urb,new,1,1.52,0.125,3,1,0.57875,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.2 -22,AFR_r_new,rur,exist,1,3.7,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,1,0.6,3.300 -23,AFR_u_new,urb,exist,1,1.52,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,0.25,0.6,3.300 -24,CPA_r_new,rur,exist,1,3.7,0.125,3,1,1.925,0.5,1.5,2.14,0.85,0.8,1,0.6,0.900 -25,CPA_u_new,urb,exist,1,1.52,0.125,3,1,1.925,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.900 -26,EEU_r_new,rur,exist,1,3.7,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,1,0.6,0.800 -27,EEU_u_new,urb,exist,1,1.52,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.800 -28,FSU_r_new,rur,exist,1,3.7,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,1,0.6,0.800 -29,FSU_u_new,urb,exist,1,1.52,0.125,3,1,1.288,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.800 -30,LAC_r_new,rur,exist,1,3.7,0.125,3,1,2.763,0.5,1.5,2.14,0.85,0.8,1,0.6,1.750 -31,LAC_u_new,urb,exist,1,1.52,0.125,3,1,2.763,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1.750 -32,MEA_r_new,rur,exist,1,3.7,0.125,3,1,2.863,0.5,1.5,2.14,0.85,0.8,1,0.6,1.750 -33,MEA_r_new,urb,exist,1,1.52,0.125,3,1,2.863,0.5,1.5,2.14,0.85,0.8,0.25,0.6,1.750 -34,NAM_r_new,rur,exist,1,3.7,0.125,3,1,1.560,0.5,1.5,2.14,0.85,0.8,1,0.6,0.369 -35,NAM_u_new,urb,exist,1,1.52,0.125,3,1,1.560,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.369 -36,PAO_r_new,rur,exist,1,3.7,0.125,3,1,1.330,0.5,1.5,2.14,0.85,0.8,1,0.6,0.700 -37,PAO_u_new,urb,exist,1,1.52,0.125,3,1,1.330,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.700 -38,PAS_r_new,rur,exist,1,3.7,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,1,0.6,3.300 -39,PAS_u_new,urb,exist,1,1.52,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,0.25,0.6,3.300 -40,SAS_r_new,rur,exist,1,3.7,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,1,0.6,3.300 -41,SAS_u_new,urb,exist,1,1.52,0.125,3,1,3.475,0.5,1.5,2.14,0.85,0.8,0.25,0.6,3.300 -42,WEU_r_new,rur,exist,1,3.7,0.125,3,1,1.103,0.5,1.5,2.14,0.85,0.8,1,0.6,0.697 -43,WEU_u_new,urb,exist,1,1.52,0.125,3,1,1.103,0.5,1.5,2.14,0.85,0.8,0.25,0.6,0.697 \ No newline at end of file diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input_reg.xlsx b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input_reg.xlsx new file mode 100755 index 0000000000000000000000000000000000000000..a97cff8e31305203dbd0dded98421574481d818b GIT binary patch literal 27580 zcmeFZWpo|OmL@1>S0j2rGP<@0l)wt0000805WEz*8fu92cM4klz^!fas<9{#$ZSgWvzzpyK7d{_)!zwMNR6*j6xUcLb zSw4$N(yiG~giQ1I8>uq&L1pDeXmnVPu`U~AOv9(Uwnj2nUKVL&^b{_ii6euIs-16bW%uuTCM?`VmnBMpbnSsFjlZWCEJM$bKL& zl&OeR@3So++=9facNxER!Aq;%t`pZPqDlT{Q9wdY zm&j_A)dw#?UIsXn!Wfy4vf^QLaXA?peV{kTBwpJ|-4^Jp*zSE`?BqvXI|y%T3GgE8 zhPrm36$)`2t>1#t4(z_T-b>>>(Z<$U~-A+B&L38{Otn9bgXh0`Jjv?ywQU>IyH> zd%x0v^MM**bD(8!%>HH_FehXSsK^%nqv=Vl)glLcOD=hXvq1KjOXJk7E9kNOg-pJy zq+=+@BwxePr?3Kid;kN;|BEamX?GX_eaiC2r>H`I%Ce5Fk%b){?eF@J4F3-n-2c$^ zvY7uzh6%>nxmGC&XDsMM4rL7A02z|sblH-l@><>=L&heuq`S^+M zAg0>y!_%x~%B~)7i>`Sq30Fd*6~BiQuz@K*&fGsC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z{mVhx9{&}ww~bjT zx)3QS-=|K|^+*cPl@0+o?>itCJZMzMDkHiXG*KP0RDwAOge zhx@a5`q`|yN7n3UY?;IB{{XWZst{eDwTTsvvrDSM6=|)3&Ed$JO($s$etkeGEXN|{ z>q;r!S5*K@rwI7GR)EWsDTPf-q^!&IWSB#(cd13NDTndJ4a8e-PSY$ZVfy42(v5dg zwIv0xp@M+tJNynZUqxB$IUwuxK4*pXpe$~dBWpR!S_oer+k400o}O*+LP_D{2o`SzGtKI>iwm@`vn3l`&9q{ literal 0 HcmV?d00001 diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv deleted file mode 100644 index 0814a26..0000000 --- a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.csv +++ /dev/null @@ -1,12 +0,0 @@ -REGION_GEA,RegNum,arch,rural,urban -AFR,1,new,0,1 -CPA,2,new,2,3 -EEU,3,new,4,5 -FSU,4,new,6,7 -LAC,5,new,8,9 -MEA,6,new,10,11 -NAM,7,new,12,13 -PAO,8,new,14,15 -PAS,9,new,16,17 -SAS,10,new,18,19 -WEU,11,new,20,21 \ No newline at end of file diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.xlsx b/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.xlsx new file mode 100755 index 0000000000000000000000000000000000000000..803bbe6a99e1bb792fd61705843350f23881d19f GIT binary patch literal 22870 zcmeIaWq2IRvLz~JW{cTkCW{#@W@d{mX0n)>(PG(RW@fOMnOPR2MX&9B&NZBU=gs_> zKX-P0Uv*b^R;Q=qkC|7~5;pxmZ~e=751vWC4Ky?*Hfbe^>)O3DQ!aj7Wi}zAyTN%1vg}!Q%D! zj~qo=zH`ZMo3rnUnP+a+(xhvHOG=F~TP)|LcRfFTF?t<0oWR{|G_{pGIK>HsLAj{kYo24%`DO^aq+=4&#_Zj0E_%Gq zRyrgRrU8NnH*Tiw0iI7TFe|nt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fZrqjzXBZc z{i=h%i~s+L^?Tg-SFAIEzsLF+Mg9}(_u%8NShqrdkM%PY`6t%z5v*Uao<)Ae`aZky n3(bBu{J#fUeg#Mt`xD?_903O`JNcgKf(670xPnmp{^|b%uhRco literal 0 HcmV?d00001 From b90ea7dae0abc91a8f18bd8f2dc02dbee9390e78 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 10:43:05 +0200 Subject: [PATCH 020/114] Add function to get root directory --- message_ix_buildings/chilled/utils/util.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 message_ix_buildings/chilled/utils/util.py diff --git a/message_ix_buildings/chilled/utils/util.py b/message_ix_buildings/chilled/utils/util.py new file mode 100644 index 0000000..ded7079 --- /dev/null +++ b/message_ix_buildings/chilled/utils/util.py @@ -0,0 +1,5 @@ +from pathlib import Path + + +def get_project_root() -> Path: + return Path(__file__).parent.parent.parent From 7da9046eb2aa08be1923b06d9d180afb4e8ca8c8 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 10:43:18 +0200 Subject: [PATCH 021/114] Add function to create archetype rasters for each project/version --- .../chilled/preprocess/archetypes.py | 119 ++++++++++++++++++ .../chilled/run_preprocess.py | 4 + 2 files changed, 123 insertions(+) create mode 100644 message_ix_buildings/chilled/preprocess/archetypes.py diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py new file mode 100644 index 0000000..3d2a875 --- /dev/null +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -0,0 +1,119 @@ +""" +Create buildings archetypes maps using specified inputs +""" + +import datetime +import os + +import numpy as np +import pandas as pd +import xarray as xr +from utils.config import Config # type: ignore +from utils.util import get_project_root # type: ignore + + +def create_archetypes(config: "Config"): + root_path = get_project_root() + raster_path = os.path.join(config.dle_path, "out", "raster") + version_path = os.path.join(root_path, "data", "chilled", "versions", config.vstr) + archetype_path = os.path.join(raster_path, "archetypes", config.vstr) + + # if archetypes folder does not exist, create it + if not os.path.exists(archetype_path): + os.makedirs(archetype_path) + + # read in message raster + reg_ras = xr.open_dataarray( + os.path.join(raster_path, "map_reg_MESSAGE_" + config.node + ".nc") + ) + + for arch in config.archs: + suff = arch # suffix + + if config.arch_setting == "fixed": + input_file = os.path.join(version_path, "arch_input.xlsx") + + if os.path.exists(input_file): + arch_inputs = pd.read_excel(input_file, sheet_name=suff, index_col="id") + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + + elif config.arch_setting == "regional": + input_file = os.path.join( + version_path, + "arch_input_reg.xlsx", + ) + + reg_file = os.path.join( + version_path, + "arch_regions.xlsx", + ) + + if os.path.exists(input_file): + arch_inputs = pd.read_excel(input_file, sheet_name="arch") + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + + if os.path.exists(reg_file): + arch_reg = pd.read_excel(reg_file, sheet_name=arch) + else: + print( + "Regional archetypes input file " + + reg_file + + " does not exist! Please create file for input." + ) + + # Create map of archetypes based on MESSAGE regions raster + arch_map = xr.Dataset( + { + "urban": reg_ras.MESSAGE11.copy(deep=True), + "rural": reg_ras.MESSAGE11.copy(deep=True), + } + ) + + for row in arch_reg.itertuples(): + arch_map["urban"].values[reg_ras == row.RegNum] = float(row.urban) + arch_map["rural"].values[reg_ras == row.RegNum] = float(row.rural) + + arch_map = arch_map.astype(float) + # NOT WORKING with integers!! + for urt in config.urts: + arch_map[urt].values[arch_map[urt] < 0] = np.nan + + # % Write out to netcdf + + arch_map.attrs = { + "title": "Archetype IDs by region", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "arch_setting": config.arch_setting, + } + + encoding = {var: config.comp for var in arch_map.data_vars} + + filename = "arch_map_" + config.arch_setting + "_" + suff + ".nc" + arch_map.to_netcdf( + os.path.join( + archetype_path, + filename, + ), + encoding=encoding, + ) + + print( + "Completed archetype map at " + + os.path.join( + archetype_path, + filename, + ) + ) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 2a12146..b5f5a4b 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,5 +1,6 @@ import os +from preprocess.archetypes import create_archetypes # type: ignore from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore @@ -13,3 +14,6 @@ create_message_raster(cfg) else: print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") + +# run create_archetypes +create_archetypes(cfg) From aa7f0169b8ed7aadcb8cd9fde16e784c0f0e14cf Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 10:55:50 +0200 Subject: [PATCH 022/114] Edit so that MESSAGE maps are read in and created each time --- .../chilled/preprocess/archetypes.py | 49 +++++++++++++------ .../chilled/preprocess/message_raster.py | 15 +++--- .../chilled/run_preprocess.py | 15 +++--- 3 files changed, 47 insertions(+), 32 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 3d2a875..106b2c1 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -6,26 +6,25 @@ import os import numpy as np -import pandas as pd +import pandas as pd # type: ignore import xarray as xr +from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore from utils.util import get_project_root # type: ignore def create_archetypes(config: "Config"): root_path = get_project_root() - raster_path = os.path.join(config.dle_path, "out", "raster") version_path = os.path.join(root_path, "data", "chilled", "versions", config.vstr) - archetype_path = os.path.join(raster_path, "archetypes", config.vstr) + raster_path = os.path.join(config.dle_path, "out", "raster") + archetype_path = os.path.join(raster_path, config.vstr) # if archetypes folder does not exist, create it if not os.path.exists(archetype_path): os.makedirs(archetype_path) - # read in message raster - reg_ras = xr.open_dataarray( - os.path.join(raster_path, "map_reg_MESSAGE_" + config.node + ".nc") - ) + # get raster file and message map + ras, map_reg = create_message_raster(config) for arch in config.archs: suff = arch # suffix @@ -74,17 +73,18 @@ def create_archetypes(config: "Config"): # Create map of archetypes based on MESSAGE regions raster arch_map = xr.Dataset( { - "urban": reg_ras.MESSAGE11.copy(deep=True), - "rural": reg_ras.MESSAGE11.copy(deep=True), + "urban": ras.MESSAGE11.copy(deep=True), + "rural": ras.MESSAGE11.copy(deep=True), } ) for row in arch_reg.itertuples(): - arch_map["urban"].values[reg_ras == row.RegNum] = float(row.urban) - arch_map["rural"].values[reg_ras == row.RegNum] = float(row.rural) + arch_map["urban"].values[map_reg == row.RegNum] = float(row.urban) + arch_map["rural"].values[map_reg == row.RegNum] = float(row.rural) arch_map = arch_map.astype(float) - # NOT WORKING with integers!! + + # TODO: NOT WORKING with integers!! for urt in config.urts: arch_map[urt].values[arch_map[urt] < 0] = np.nan @@ -101,19 +101,36 @@ def create_archetypes(config: "Config"): encoding = {var: config.comp for var in arch_map.data_vars} - filename = "arch_map_" + config.arch_setting + "_" + suff + ".nc" + # save MESSAGE regions map + msg_file = "map_reg_MESSAGE_" + config.node + ".nc" + map_reg.to_netcdf( + os.path.join( + archetype_path, + msg_file, + ), + encoding=encoding, + ) + print( + "- Saved MESSAGE and raster map data to " + + os.path.join( + archetype_path, + msg_file, + ) + ) + + arch_file = "arch_map_" + config.arch_setting + "_" + suff + ".nc" arch_map.to_netcdf( os.path.join( archetype_path, - filename, + arch_file, ), encoding=encoding, ) print( - "Completed archetype map at " + "-- Saved archetype map to " + os.path.join( archetype_path, - filename, + arch_file, ) ) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index b71479b..b5eb563 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -12,7 +12,6 @@ def create_message_raster(config: "Config"): input_path = os.path.join(config.dle_path, "data") - output_path = os.path.join(config.dle_path, "out", "raster") if config.node == "R11": msgregions = pd.read_excel( @@ -95,14 +94,16 @@ def create_message_raster(config: "Config"): "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", } - filename = "map_reg_MESSAGE_" + config.node + ".nc" + # filename = "map_reg_MESSAGE_" + config.node + ".nc" - map_reg.to_netcdf(os.path.join(output_path, filename)) + # map_reg.to_netcdf(os.path.join(output_path, filename)) - print( - "Saved MESSAGE and raster map data to " - + os.path.join(output_path, filename) - ) + # print( + # "Saved MESSAGE and raster map data to " + # + os.path.join(output_path, filename) + # ) + + return reg_ras, map_reg else: print("Only R11 is supported at the moment.") diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index b5f5a4b..3ec325d 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,19 +1,16 @@ -import os - from preprocess.archetypes import create_archetypes # type: ignore -from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore cfg = Config() # check to see if "map_reg_MESSAGE_{config.node}.nc" exists # if not, create the file -if not os.path.exists( - os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_" + cfg.node + ".nc") -): - create_message_raster(cfg) -else: - print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") +# if not os.path.exists( +# os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_" + cfg.node + ".nc") +# ): +# create_message_raster(cfg) +# else: +# print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") # run create_archetypes create_archetypes(cfg) From 663f5a0023e27b7046a9ffee21f02b98bffb6909 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 10:57:17 +0200 Subject: [PATCH 023/114] Removing encoding from MESSAGE map `to_netcdf` --- message_ix_buildings/chilled/preprocess/archetypes.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 106b2c1..237b42a 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -103,13 +103,7 @@ def create_archetypes(config: "Config"): # save MESSAGE regions map msg_file = "map_reg_MESSAGE_" + config.node + ".nc" - map_reg.to_netcdf( - os.path.join( - archetype_path, - msg_file, - ), - encoding=encoding, - ) + map_reg.to_netcdf(os.path.join(archetype_path, msg_file)) print( "- Saved MESSAGE and raster map data to " + os.path.join( From 9c739e6ef5c343834d4b0a30fe3cde4a126cdb24 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 10:58:14 +0200 Subject: [PATCH 024/114] Move saving MESSAGE raster outside of inner loop --- .../chilled/preprocess/archetypes.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 237b42a..bcb665d 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -26,6 +26,17 @@ def create_archetypes(config: "Config"): # get raster file and message map ras, map_reg = create_message_raster(config) + # save MESSAGE regions map + msg_file = "map_reg_MESSAGE_" + config.node + ".nc" + map_reg.to_netcdf(os.path.join(archetype_path, msg_file)) + print( + "- Saved MESSAGE and raster map data to " + + os.path.join( + archetype_path, + msg_file, + ) + ) + for arch in config.archs: suff = arch # suffix @@ -101,17 +112,6 @@ def create_archetypes(config: "Config"): encoding = {var: config.comp for var in arch_map.data_vars} - # save MESSAGE regions map - msg_file = "map_reg_MESSAGE_" + config.node + ".nc" - map_reg.to_netcdf(os.path.join(archetype_path, msg_file)) - print( - "- Saved MESSAGE and raster map data to " - + os.path.join( - archetype_path, - msg_file, - ) - ) - arch_file = "arch_map_" + config.arch_setting + "_" + suff + ".nc" arch_map.to_netcdf( os.path.join( From d04a5403cbfd677223fad8de9d2e1558f3cd7eb4 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:01:38 +0200 Subject: [PATCH 025/114] Rename folder from `versions` to `version` --- .../ALPS2023/arch_input_reg.xlsx | Bin .../ALPS2023/arch_regions.xlsx | Bin .../{versions => version}/ALPS2023/par_var.csv | 0 .../chilled/{versions => version}/ALPS2023/runs.csv | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename message_ix_buildings/data/chilled/{versions => version}/ALPS2023/arch_input_reg.xlsx (100%) rename message_ix_buildings/data/chilled/{versions => version}/ALPS2023/arch_regions.xlsx (100%) rename message_ix_buildings/data/chilled/{versions => version}/ALPS2023/par_var.csv (100%) rename message_ix_buildings/data/chilled/{versions => version}/ALPS2023/runs.csv (100%) diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_input_reg.xlsx b/message_ix_buildings/data/chilled/version/ALPS2023/arch_input_reg.xlsx similarity index 100% rename from message_ix_buildings/data/chilled/versions/ALPS2023/arch_input_reg.xlsx rename to message_ix_buildings/data/chilled/version/ALPS2023/arch_input_reg.xlsx diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.xlsx b/message_ix_buildings/data/chilled/version/ALPS2023/arch_regions.xlsx similarity index 100% rename from message_ix_buildings/data/chilled/versions/ALPS2023/arch_regions.xlsx rename to message_ix_buildings/data/chilled/version/ALPS2023/arch_regions.xlsx diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/par_var.csv b/message_ix_buildings/data/chilled/version/ALPS2023/par_var.csv similarity index 100% rename from message_ix_buildings/data/chilled/versions/ALPS2023/par_var.csv rename to message_ix_buildings/data/chilled/version/ALPS2023/par_var.csv diff --git a/message_ix_buildings/data/chilled/versions/ALPS2023/runs.csv b/message_ix_buildings/data/chilled/version/ALPS2023/runs.csv similarity index 100% rename from message_ix_buildings/data/chilled/versions/ALPS2023/runs.csv rename to message_ix_buildings/data/chilled/version/ALPS2023/runs.csv From 8d0f22c68a04e0404ff3acb12e81f1e2accf7f2e Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:01:45 +0200 Subject: [PATCH 026/114] Change save directory --- message_ix_buildings/chilled/preprocess/archetypes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index bcb665d..27252b8 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -15,9 +15,9 @@ def create_archetypes(config: "Config"): root_path = get_project_root() - version_path = os.path.join(root_path, "data", "chilled", "versions", config.vstr) - raster_path = os.path.join(config.dle_path, "out", "raster") - archetype_path = os.path.join(raster_path, config.vstr) + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + out_path = os.path.join(config.dle_path, "out", "version") + archetype_path = os.path.join(out_path, config.vstr, "rasters") # if archetypes folder does not exist, create it if not os.path.exists(archetype_path): From fe9d01978495776a2bac5c26c8f7e689d1a07f14 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:14:56 +0200 Subject: [PATCH 027/114] Create function to set arch inputs and regions files --- .../chilled/preprocess/archetypes.py | 181 ++++++++++-------- 1 file changed, 100 insertions(+), 81 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 27252b8..22f4e59 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -13,6 +13,65 @@ from utils.util import get_project_root # type: ignore +def read_arch_inputs_df(config: "Config", suff: str): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + if config.arch_setting == "fixed": + input_file = os.path.join(version_path, "arch_input.xlsx") + + if os.path.exists(input_file): + arch_inputs = pd.read_excel(input_file, sheet_name=suff, index_col="id") + + return arch_inputs + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + elif config.arch_setting == "regional": + input_file = os.path.join( + version_path, + "arch_input_reg.xlsx", + ) + + if os.path.exists(input_file): + arch_inputs = pd.read_excel(input_file, sheet_name="arch") + + return arch_inputs + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + + +def read_arch_reg_df(config: "Config", arch: str): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + if config.arch_setting == "regional": + reg_file = os.path.join( + version_path, + "arch_regions.xlsx", + ) + + if os.path.exists(reg_file): + arch_reg = pd.read_excel(reg_file, sheet_name=arch) + return arch_reg + else: + print( + "Regional archetypes input file " + + reg_file + + " does not exist! Please create file for input." + ) + + else: + print("Archetypes are not regional. No regional file to read.") + + def create_archetypes(config: "Config"): root_path = get_project_root() version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) @@ -38,93 +97,53 @@ def create_archetypes(config: "Config"): ) for arch in config.archs: - suff = arch # suffix - - if config.arch_setting == "fixed": - input_file = os.path.join(version_path, "arch_input.xlsx") - - if os.path.exists(input_file): - arch_inputs = pd.read_excel(input_file, sheet_name=suff, index_col="id") - else: - print( - "Archetypes input file " - + input_file - + " does not exist! Please create file for input." - ) - - elif config.arch_setting == "regional": - input_file = os.path.join( - version_path, - "arch_input_reg.xlsx", - ) - - reg_file = os.path.join( - version_path, - "arch_regions.xlsx", - ) - - if os.path.exists(input_file): - arch_inputs = pd.read_excel(input_file, sheet_name="arch") - else: - print( - "Archetypes input file " - + input_file - + " does not exist! Please create file for input." - ) - - if os.path.exists(reg_file): - arch_reg = pd.read_excel(reg_file, sheet_name=arch) - else: - print( - "Regional archetypes input file " - + reg_file - + " does not exist! Please create file for input." - ) - - # Create map of archetypes based on MESSAGE regions raster - arch_map = xr.Dataset( - { - "urban": ras.MESSAGE11.copy(deep=True), - "rural": ras.MESSAGE11.copy(deep=True), - } - ) + arch_inputs = read_arch_inputs_df(config, arch) + arch_reg = read_arch_reg_df(config, arch) + + # Create map of archetypes based on MESSAGE regions raster + arch_map = xr.Dataset( + { + "urban": ras.MESSAGE11.copy(deep=True), + "rural": ras.MESSAGE11.copy(deep=True), + } + ) - for row in arch_reg.itertuples(): - arch_map["urban"].values[map_reg == row.RegNum] = float(row.urban) - arch_map["rural"].values[map_reg == row.RegNum] = float(row.rural) + for row in arch_reg.itertuples(): + arch_map["urban"].values[map_reg == row.RegNum] = float(row.urban) + arch_map["rural"].values[map_reg == row.RegNum] = float(row.rural) - arch_map = arch_map.astype(float) + arch_map = arch_map.astype(float) - # TODO: NOT WORKING with integers!! - for urt in config.urts: - arch_map[urt].values[arch_map[urt] < 0] = np.nan + # TODO: NOT WORKING with integers!! + for urt in config.urts: + arch_map[urt].values[arch_map[urt] < 0] = np.nan - # % Write out to netcdf + # % Write out to netcdf - arch_map.attrs = { - "title": "Archetype IDs by region", - "authors": "Edward Byers & Alessio Mastrucci", - "date": str(datetime.datetime.now()), - "institution": "IIASA Energy Program", - "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", - "arch_setting": config.arch_setting, - } + arch_map.attrs = { + "title": "Archetype IDs by region", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "arch_setting": config.arch_setting, + } - encoding = {var: config.comp for var in arch_map.data_vars} + encoding = {var: config.comp for var in arch_map.data_vars} - arch_file = "arch_map_" + config.arch_setting + "_" + suff + ".nc" - arch_map.to_netcdf( - os.path.join( - archetype_path, - arch_file, - ), - encoding=encoding, - ) + arch_file = "arch_map_" + config.arch_setting + "_" + arch + ".nc" + arch_map.to_netcdf( + os.path.join( + archetype_path, + arch_file, + ), + encoding=encoding, + ) - print( - "-- Saved archetype map to " - + os.path.join( - archetype_path, - arch_file, - ) + print( + "-- Saved archetype map to " + + os.path.join( + archetype_path, + arch_file, ) + ) From b67a4bdcab1ad5be462a0a491cc92c82d5a39f7c Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:30:10 +0200 Subject: [PATCH 028/114] Add code to create building archetype variables maps --- .../chilled/preprocess/archetypes.py | 63 ++++++++++++++++++- .../chilled/run_preprocess.py | 11 +++- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 22f4e59..3284f31 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -4,10 +4,12 @@ import datetime import os +from itertools import product import numpy as np import pandas as pd # type: ignore import xarray as xr +from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore from utils.util import get_project_root # type: ignore @@ -73,8 +75,6 @@ def read_arch_reg_df(config: "Config", arch: str): def create_archetypes(config: "Config"): - root_path = get_project_root() - version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) out_path = os.path.join(config.dle_path, "out", "version") archetype_path = os.path.join(out_path, config.vstr, "rasters") @@ -97,7 +97,6 @@ def create_archetypes(config: "Config"): ) for arch in config.archs: - arch_inputs = read_arch_inputs_df(config, arch) arch_reg = read_arch_reg_df(config, arch) # Create map of archetypes based on MESSAGE regions raster @@ -147,3 +146,61 @@ def create_archetypes(config: "Config"): arch_file, ) ) + + +def create_archetype_variables(config: "Config"): + out_path = os.path.join(config.dle_path, "out", "version") + archetype_path = os.path.join(out_path, config.vstr, "rasters") + + def map_archetype_variables(args): + arch_setting, arch, varname = args + + print( + "Creating archetype map for: " + arch_setting + " " + arch + " " + varname + ) + + # read in input files + arch_inputs = read_arch_inputs_df(config, arch) + + # read in relevant archetype raster + map = xr.open_dataset( + os.path.join( + archetype_path, "arch_map_" + arch_setting + "_" + arch + ".nc" + ) + ) + + # print(".....Writing to netCDF") + for urt in config.urts: + for index, row in arch_inputs.iterrows(): + map[urt].values[map[urt] == row["id"]] = float(row[varname]) + map[urt].values[map[urt] == -1] = np.nan + + map.attrs = { + "title": "map_" + varname, + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "arch_setting": arch_setting, + } + + encoding = {var: config.comp for var in map.data_vars} + + # save archetype variables maps to netcdf + filename = "arch_" + arch + "_" + varname + ".nc" + + map.to_netcdf( + os.path.join(archetype_path, filename), + encoding=encoding, + ) + + print( + ".......Completed writing to file: " + + os.path.join(archetype_path, filename) + ) + + # create archetype variables maps + + func_inputs = product(config.arch_settings, config.archs, VARS_ARCHETYPES) + + list(map(map_archetype_variables, func_inputs)) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 3ec325d..3ca11ae 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,4 +1,8 @@ -from preprocess.archetypes import create_archetypes # type: ignore +from preprocess.archetypes import ( # type: ignore + create_archetype_variables, + create_archetypes, +) + create_archetypes) from utils.config import Config # type: ignore cfg = Config() @@ -14,3 +18,8 @@ # run create_archetypes create_archetypes(cfg) +print("Archetypes created successfully.") + +# create maps of archetype variables +create_archetype_variables(cfg) +print("Archetype variables created successfully.") From 9a2d091cef31cdeb0b0514ad5d7064a282171fc2 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:32:11 +0200 Subject: [PATCH 029/114] Fix imports --- message_ix_buildings/chilled/run_preprocess.py | 1 - 1 file changed, 1 deletion(-) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 3ca11ae..0e13c18 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -2,7 +2,6 @@ create_archetype_variables, create_archetypes, ) - create_archetypes) from utils.config import Config # type: ignore cfg = Config() From 9a263d462236d000d635168c8837f50602290a89 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:33:13 +0200 Subject: [PATCH 030/114] Fix typo from `arch_settings` to `arch_setting` --- message_ix_buildings/chilled/preprocess/archetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 3284f31..4f160da 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -201,6 +201,6 @@ def map_archetype_variables(args): # create archetype variables maps - func_inputs = product(config.arch_settings, config.archs, VARS_ARCHETYPES) + func_inputs = product(config.arch_setting, config.archs, VARS_ARCHETYPES) list(map(map_archetype_variables, func_inputs)) From 7d56d8ff343da981c930b940b563a96d8c83df8c Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:35:43 +0200 Subject: [PATCH 031/114] Change input to list for product mapping --- message_ix_buildings/chilled/preprocess/archetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 4f160da..bea6b2e 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -201,6 +201,6 @@ def map_archetype_variables(args): # create archetype variables maps - func_inputs = product(config.arch_setting, config.archs, VARS_ARCHETYPES) + func_inputs = product([config.arch_setting], config.archs, VARS_ARCHETYPES) list(map(map_archetype_variables, func_inputs)) From 2baf9290f81b8a0d25b93e128cb7d945edee69eb Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:40:41 +0200 Subject: [PATCH 032/114] Move functions to read input files to `util.py` --- .../chilled/preprocess/archetypes.py | 62 +----------------- message_ix_buildings/chilled/utils/util.py | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+), 61 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index bea6b2e..d358480 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -7,71 +7,11 @@ from itertools import product import numpy as np -import pandas as pd # type: ignore import xarray as xr from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore -from utils.util import get_project_root # type: ignore - - -def read_arch_inputs_df(config: "Config", suff: str): - root_path = get_project_root() - version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) - - if config.arch_setting == "fixed": - input_file = os.path.join(version_path, "arch_input.xlsx") - - if os.path.exists(input_file): - arch_inputs = pd.read_excel(input_file, sheet_name=suff, index_col="id") - - return arch_inputs - else: - print( - "Archetypes input file " - + input_file - + " does not exist! Please create file for input." - ) - elif config.arch_setting == "regional": - input_file = os.path.join( - version_path, - "arch_input_reg.xlsx", - ) - - if os.path.exists(input_file): - arch_inputs = pd.read_excel(input_file, sheet_name="arch") - - return arch_inputs - else: - print( - "Archetypes input file " - + input_file - + " does not exist! Please create file for input." - ) - - -def read_arch_reg_df(config: "Config", arch: str): - root_path = get_project_root() - version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) - - if config.arch_setting == "regional": - reg_file = os.path.join( - version_path, - "arch_regions.xlsx", - ) - - if os.path.exists(reg_file): - arch_reg = pd.read_excel(reg_file, sheet_name=arch) - return arch_reg - else: - print( - "Regional archetypes input file " - + reg_file - + " does not exist! Please create file for input." - ) - - else: - print("Archetypes are not regional. No regional file to read.") +from utils.util import read_arch_inputs_df, read_arch_reg_df # type: ignore def create_archetypes(config: "Config"): diff --git a/message_ix_buildings/chilled/utils/util.py b/message_ix_buildings/chilled/utils/util.py index ded7079..80b95cf 100644 --- a/message_ix_buildings/chilled/utils/util.py +++ b/message_ix_buildings/chilled/utils/util.py @@ -1,5 +1,68 @@ +import os from pathlib import Path +import pandas as pd # type: ignore +from config import Config # type: ignore + def get_project_root() -> Path: return Path(__file__).parent.parent.parent + + +def read_arch_inputs_df(config: "Config", suff: str): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + if config.arch_setting == "fixed": + input_file = os.path.join(version_path, "arch_input.xlsx") + + if os.path.exists(input_file): + arch_inputs = pd.read_excel(input_file, sheet_name=suff, index_col="id") + + return arch_inputs + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + elif config.arch_setting == "regional": + input_file = os.path.join( + version_path, + "arch_input_reg.xlsx", + ) + + if os.path.exists(input_file): + arch_inputs = pd.read_excel(input_file, sheet_name="arch") + + return arch_inputs + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + + +def read_arch_reg_df(config: "Config", arch: str): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + if config.arch_setting == "regional": + reg_file = os.path.join( + version_path, + "arch_regions.xlsx", + ) + + if os.path.exists(reg_file): + arch_reg = pd.read_excel(reg_file, sheet_name=arch) + return arch_reg + else: + print( + "Regional archetypes input file " + + reg_file + + " does not exist! Please create file for input." + ) + + else: + print("Archetypes are not regional. No regional file to read.") From 192fbc348c852143ddc252c6efef3a6e07c586fc Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 11:41:45 +0200 Subject: [PATCH 033/114] Edit relative import path --- message_ix_buildings/chilled/utils/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/utils/util.py b/message_ix_buildings/chilled/utils/util.py index 80b95cf..493a713 100644 --- a/message_ix_buildings/chilled/utils/util.py +++ b/message_ix_buildings/chilled/utils/util.py @@ -2,7 +2,7 @@ from pathlib import Path import pandas as pd # type: ignore -from config import Config # type: ignore +from utils.config import Config # type: ignore def get_project_root() -> Path: From cdde81dda7b10920723ee1d3c9525d7544abdb35 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:05:11 +0200 Subject: [PATCH 034/114] Have path for project and for DLE input data --- .../chilled/functions/user_settings.py | 3 +- .../chilled/preprocess/archetypes.py | 4 +- .../chilled/preprocess/message_raster.py | 2 +- message_ix_buildings/chilled/utils/config.py | 29 +++++++------- message_ix_buildings/chilled/utils/util.py | 38 +++++++++++++++++++ 5 files changed, 56 insertions(+), 20 deletions(-) diff --git a/message_ix_buildings/chilled/functions/user_settings.py b/message_ix_buildings/chilled/functions/user_settings.py index 1974abc..2fa1ee2 100644 --- a/message_ix_buildings/chilled/functions/user_settings.py +++ b/message_ix_buildings/chilled/functions/user_settings.py @@ -39,7 +39,8 @@ "MEAS_UNICC": { "chunk_size": 450, "sys_path": "/home/mengm/repo/message-ix-buildings", - "dle_path": "/projects/chilled", + "project_path": "/projects/chilled", + "dle_path": "/projects/chilled/data/input_data/", "isimip_bias_adj_path": "/pdrive/projects/watxene/ISIMIP/ISIMIP3b/InputData/climate_updated/bias-adjusted", "isimip_ewembi_path": "/pdrive/projects/watxene/ISIMIP/ISIMIP2a_hist/input/EWEMBI", "message_region_map_file": "/pdrive/projects/ene.model3/data/powerplants/MESSAGE data/MESSAGEix_country_region_map.xlsx", diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index d358480..df15853 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -15,7 +15,7 @@ def create_archetypes(config: "Config"): - out_path = os.path.join(config.dle_path, "out", "version") + out_path = os.path.join(config.project_path, "out", "version") archetype_path = os.path.join(out_path, config.vstr, "rasters") # if archetypes folder does not exist, create it @@ -89,7 +89,7 @@ def create_archetypes(config: "Config"): def create_archetype_variables(config: "Config"): - out_path = os.path.join(config.dle_path, "out", "version") + out_path = os.path.join(config.project_path, "out", "version") archetype_path = os.path.join(out_path, config.vstr, "rasters") def map_archetype_variables(args): diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index b5eb563..c2f98bc 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -11,7 +11,7 @@ def create_message_raster(config: "Config"): - input_path = os.path.join(config.dle_path, "data") + input_path = os.path.join(config.project_path, "data") if config.node == "R11": msgregions = pd.read_excel( diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 01669a5..dc8bd45 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -4,11 +4,7 @@ from typing import Literal import numpy as np -from functions.user_settings import DICT_USER_SETTINGS -from functions.vdd_functions import ( - load_all_scenarios_data, - load_parametric_analysis_data, -) +from functions.user_settings import DICT_USER_SETTINGS # type: ignore @dataclass @@ -19,6 +15,7 @@ class Config: user: Literal["ALE", "ED", "MEAS", "MEAS_EBRO", "MEAS_UNICC"] = "MEAS_UNICC" # print(f"USER: {user}") + project_path = DICT_USER_SETTINGS[user]["dle_path"] dle_path = DICT_USER_SETTINGS[user]["dle_path"] message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] @@ -160,17 +157,17 @@ class Config: # Final maps (y4) parameters nd_thresh = 5 - # Load scenarios data - s_runs = load_all_scenarios_data( - input_dle_path=DICT_USER_SETTINGS[user]["dle_path"], input_version_name=vstr - ) - - # Load paramtric analysis data - par_var = load_parametric_analysis_data( - input_dle_path=DICT_USER_SETTINGS[user]["dle_path"], - input_version_name=vstr, - input_paranalysis_mode=paranalysis_mode, - ) + # # Load scenarios data + # s_runs = load_all_scenarios_data( + # input_dle_path=DICT_USER_SETTINGS[user]["dle_path"], input_version_name=vstr + # ) + + # # Load paramtric analysis data + # par_var = load_parametric_analysis_data( + # input_dle_path=DICT_USER_SETTINGS[user]["dle_path"], + # input_version_name=vstr, + # input_paranalysis_mode=paranalysis_mode, + # ) # #: Base year for projections. # base_year: int = BASE_YEAR diff --git a/message_ix_buildings/chilled/utils/util.py b/message_ix_buildings/chilled/utils/util.py index 493a713..175f9c1 100644 --- a/message_ix_buildings/chilled/utils/util.py +++ b/message_ix_buildings/chilled/utils/util.py @@ -66,3 +66,41 @@ def read_arch_reg_df(config: "Config", arch: str): else: print("Archetypes are not regional. No regional file to read.") + + +def load_all_scenarios_data(config: "Config"): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + input_file = os.path.join(version_path, "runs.csv") + + if os.path.exists(input_file): + df = pd.read_csv(input_file, index_col="id") + return df + else: + print( + "Scenarios file " + + input_file + + " does not exist! Please create file for input." + ) + + +def load_parametric_analysis_data(config: "Config"): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + input_file = os.path.join(version_path, "par_var.csv") + + if os.path.exists(input_file): + df = pd.read_csv(input_file, index_col="id_run") + + if config.paranalysis_mode == 0: + df = df.loc[df.name_run == "ref", :] + + return df + else: + print( + "Parametric analysis data file " + + input_file + + " does not exist! Please create file for input." + ) From d943d14cb91338deb2e7c06ee330e8b06e16b116 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:07:27 +0200 Subject: [PATCH 035/114] Edit path for GAUL raster file --- message_ix_buildings/chilled/preprocess/message_raster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index c2f98bc..8de3d41 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -11,7 +11,7 @@ def create_message_raster(config: "Config"): - input_path = os.path.join(config.project_path, "data") + input_path = os.path.join(config.dle_path) if config.node == "R11": msgregions = pd.read_excel( From e5aa37e3cf22d17efd1861b0fbfbc3d1d9c4d931 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:13:54 +0200 Subject: [PATCH 036/114] Make function to create climate outputs --- message_ix_buildings/chilled/main/climate.py | 909 +++++++++++++++++++ message_ix_buildings/chilled/run_main.py | 13 + 2 files changed, 922 insertions(+) create mode 100644 message_ix_buildings/chilled/main/climate.py create mode 100644 message_ix_buildings/chilled/run_main.py diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py new file mode 100644 index 0000000..7737d43 --- /dev/null +++ b/message_ix_buildings/chilled/main/climate.py @@ -0,0 +1,909 @@ +import datetime +import os + +import numpy as np +import pandas as pd # type: ignore +import xarray as xr +from dask.diagnostics import ProgressBar +from functions.buildings_funcs_grid import ( + P_f, + Q_c_tmax, + Q_h, + calc_E_c_ac, + calc_E_c_fan, + calc_E_h, + calc_gn_sol, + calc_gn_sol_h, + calc_gn_sol_tot, + calc_H_tr, + calc_H_v_cl, + calc_H_v_op, + calc_Nd, + calc_Nf, + calc_SCDD_m, + calc_SHDD_m, + calc_t_bal_c, + calc_t_bal_h, + calc_t_max_c, + calc_vdd_h, + calc_vdd_tmax_c, +) +from utils.config import Config # type: ignore +from utils.util import load_parametric_analysis_data # type: ignore + + +def create_climate_outputs(config: "Config", input_start: datetime.datetime): + out_path = os.path.join(config.dle_path, "out", "version") + save_path = os.path.join(out_path, config.vstr, "VDD_ene_calcs") + + # input_path = os.path.join(input_dle_path, "input_data") + + output_path_vdd = os.path.join( + save_path, + config.gcm, + config.rcp, + "2_VDD_ene_calcs", + ) + + if not os.path.exists(output_path_vdd): + os.makedirs(output_path_vdd) + + par_var = load_parametric_analysis_data(config) + + for clim in config.clims: + print(f"Starting {clim} ######################") + + ## ============================================================================= + # Mean air temperature + ## ============================================================================= + + # output_folder_scen = output_folder+scen+'\\' + years_clim = config.yeardic[clim] + # << this selects the correct years. + # But when testing you’ll want to use just say 3 years data, + # so set years manually, e.g. + # years_clim = yeardic6p0[str(s_run.clim)] + + # this will be the shortcut line to make the testing faster (2 years data) + if config.testing_mode == 1: + years_clim = ( + years_clim[0], + str(int(years_clim[0]) + 1), + ) + + nyrs_clim = int(years_clim[1]) - int(years_clim[0]) + 1 + + if str(clim) == "hist": + isi_folder = config.isimip_ewemib_path + filestr = config.climate_filestr_hist + else: + isi_folder = config.isimip_bias_adj_path + filestr = config.input_climate_filestr_fut + + filepath = os.path.join( + isi_folder, config.rcpdata, config.gcm, f"{filestr.lower()}*{config.endstr}" + ) + if config.rcp == "rcp26": + dst = xr.open_mfdataset( + filepath, + chunks={"lon": config.chunk_size}, + concat_dim="time", + use_cftime=True, + ) # Setting for RCP2.6 + else: + dst = xr.open_mfdataset( + filepath, + chunks={"lon": config.chunk_size}, + ) # , concat_dim='time' ) # Setting for RCP6.0 + + dst_crop = dst.sel(time=slice(years_clim[0], years_clim[1])) + t_out_ave = dst_crop[config.davar].astype("float32") - 273.16 + t_out_ave = t_out_ave.transpose("lat", "lon", "time") + + t_oa_gbm = t_out_ave.groupby("time.month") + + # ============================================================================= + # %% Solar Irradiation - Building parameters + # ============================================================================= + # Fixed values + # arb_fan = 2 + # t_sp_h = np.int8(20) # Indoor setpoint temperature for heating + # + # P_f = 55 # power of fan (W) + # area_fan = 25 # Numer of m2 per fan + # + # gains = np.int8(50) # Heat gains + # gridshape2 = (360,720) + # + # 3D - time variable + # i_sol = xr.open_dataarray('P:\\watxene\\Wat-Data\\ISI-MIP2b\\multi-GCM_input\\historical\\HadGEM2-ES\\rsds_day_HadGEM2-ES_historical_r1i1p1_EWEMBI_19710101-19801231.nc4') + # Vertical irradiation + # i_sol_v = xr.open_dataarray(input_folder+'CERES_vert_irrad_2001-13_avg.nc') #Values in daily Wh/m2 + i_sol_v = xr.open_dataarray( + os.path.join(config.dle_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") + ) # Values in daily Wh/m2 + + # Horizontal irradiation + i_sol_h = xr.open_dataarray( + os.path.join(config.dle_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") + ) # Values in daily Wh/m2 + + # i_sol = i_sol.sel(time=slice(years_clim[0],years_clim[1])) + + # ============================================================================= + # Start Degree Days calculations + # ============================================================================= + + for arch in config.archs: + # Read in archetype parameters + if config.arch_setting == "regional": + xr.open_dataset( + os.path.join( + output_path_vdd, + "arch_map_" + config.arch_setting + "_" + arch + ".nc", + ) + ) + # elif floor_setting == 'per_cap': + # floorarea = xr.open_dataset(input_folder3+'floor_area_map_'+floor_setting+'_'+suff+'.nc') + + dfa = pd.DataFrame( + columns=["H_v_cl", "H_v_op", "H_tr"], index=par_var.index + ) + # suff = arch+'_'+clim + # + # suff2 = str(s_run.scen)+'_'+str(s_run.year) #suffix: only scen and year + # #suff3 = str(s_run.scen)+'_'+str(s_run.year)+'_'+arch #suffix: scen, year and arch + + for parset in par_var.itertuples(): + # parset = par_var.iloc[0] # Placeholder select first row + + suff = clim + "_" + arch # suffix + # suff = clim+'_'+arch+'_'+str(parset.name_run) #suffix + suff1 = arch # only arch (for imports arch data) + + print("Starting: " + suff + "_" + str(parset.name_run)) + if config.cool == 1: + cop = parset.cop + t_sp_c = np.int8( + parset.t_sp_c + ) # Indoor setpoint temperature for cooling -> 26 + t_sp_c_max = np.int8( + parset.t_sp_c_max + ) # Indoor max temperature when fans are on (°C) -> 28 + + f_c = parset.f_c + f_f = parset.f_f + + if config.heat == 1: + t_sp_h = np.int8( + parset.t_sp_h + ) # Indoor max temperature when fans are on (°C) -> 20 + eff = parset.eff # Efficiency heating system + + f_h = parset.f_h + + # # Archetypes should be in parset to execute this (OLD CODE) + # if arch_setting == 'fixed': + # au = parset.arch_u + # ar = parset.arch_r + # al = [ar, au] + + # print(sddf) + + if config.runsdd == 1: + # ============================================================= + # Simple CDD calculation + # ============================================================= + + for bal_temp in config.bal_temps: + with ProgressBar(): + print("Stage 3 - Simple HDDCDD - cooling") + print("Balance temp " + str(bal_temp) + "C") + sdd_c = calc_SCDD_m(t_out_ave, bal_temp) + sdd_c = sdd_c.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + sdd_c.attrs = { + "name": "sdd_c", + "description": "Simple cooling degree days", + "units": "degC", + "short name": "CDD.", + # 'urt': urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + "bal_temp": str(bal_temp), + } + sdd_c = sdd_c.to_dataset(name="sdd_c") + encoding = {"sdd_c": config.comp} + # fname = suff+'_'+str(parset.Index)+'_sdd_c_'+str(bal_temp)+'.nc' + fname = suff + "_sdd_c_" + str(bal_temp) + ".nc" + filestr = os.path.join(output_path_vdd, fname) + sdd_c.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + sdd_c = xr.open_dataarray(filestr) + + # ============================================================== + # Simple HDD calculation + # ============================================================== + + for bal_temp in config.bal_temps: + with ProgressBar(): + print("Stage 3 - Simple HDDCDD - heating") + print("Balance temp " + str(bal_temp) + "C") + sdd_h = calc_SHDD_m(t_out_ave, bal_temp) + sdd_h = sdd_h.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + sdd_h.attrs = { + "name": "sdd_h", + "description": "Simple heating degree days", + "units": "degC", + "short name": "HDD.", + # 'urt': urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + "bal_temp": str(bal_temp), + } + sdd_h = sdd_h.to_dataset(name="sdd_h") + encoding = {"sdd_h": config.comp} + # fname = suff+'_'+str(parset.Index)+'_sdd_h_'+str(bal_temp)+'.nc' + fname = suff + "_sdd_h_" + str(bal_temp) + ".nc" + filestr = os.path.join(output_path_vdd, fname) + sdd_h.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + sdd_h = xr.open_dataarray(filestr) + + for urt in config.urts: + if config.cool == 1: + # AC penetration values + if urt == "urban": + pass + elif urt == "rural": + pass + + area_env = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_area_env.nc") + )[urt] # Area of the building envelope + gl_perc = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_gl_perc.nc") + )[urt] # 0.1 + vol = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_vol.nc") + )[urt] # 3 + xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_fl_cnd.nc") + )[urt] # 1 + u_val = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_u_val.nc") + )[urt] # 2.4 # Average U-value of building envelope # float + ach_cl = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_ach_cl.nc") + )[urt] # 0.5 + ach_op = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_ach_op.nc") + )[urt] # 1.5 # TAB - ACH (1/h) - open windows + gn_int = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_gn_int.nc") + )[urt] # 5 # FIX Internal gains (W/m2) + gl_g = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_gl_g.nc") + )[urt] # 0.85 # TAB g-value for glazing + gl_sh = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_gl_sh.nc") + )[urt] # 0.9 # TAB shading coeff for openings + roof_area = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_roof_area.nc") + )[urt] + roof_abs = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_roof_abs.nc") + )[urt] + u_roof = xr.open_dataset( + os.path.join(output_path_vdd, "arch_" + suff1 + "_u_roof.nc") + )[urt] + + # ============================================================================== + # Heat gains functions + # ============================================================================== + + if config.solar_gains == "VERT": + # Solar gains - From windows only + with ProgressBar(): + print("Stage 3 - calc gn_sol") + gn_sol = calc_gn_sol(i_sol_v, gl_perc, gl_g, gl_sh) + gn_sol = gn_sol.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + gn_sol.attrs = { + "name": "gn_sol", + "description": "Solar gains - Windows", + "units": "W/m2", + "short name": "Solar gains - Windows", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + gn_sol = gn_sol.to_dataset(name="gn_sol") + encoding = {"gn_sol": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_gn_sol_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + gn_sol.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + gn_sol = xr.open_dataarray(filestr).load() + + elif config.solar_gains == "TOT": + # Solar gains - Total + with ProgressBar(): + print("Stage 3 - calc gn_sol") + gn_sol = calc_gn_sol_tot( + i_sol_v, + gl_perc, + gl_g, + gl_sh, + i_sol_h, + roof_area, + roof_abs, + u_roof, + ) + gn_sol = gn_sol.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + gn_sol.attrs = { + "name": "gn_sol", + "description": "Solar gains", + "units": "W/m2", + "short name": "Solar gains", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + gn_sol = gn_sol.to_dataset(name="gn_sol") + encoding = {"gn_sol": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_gn_sol_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + gn_sol.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + gn_sol = xr.open_dataarray(filestr).load() + + elif config.solar_gains == "HOR": + # Solar gains - Total + with ProgressBar(): + print("Stage 3 - calc gn_sol") + gn_sol = calc_gn_sol_h(i_sol_h, roof_area, roof_abs, u_roof) + gn_sol = gn_sol.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + gn_sol.attrs = { + "name": "gn_sol", + "description": "Solar gains", + "units": "W/m2", + "short name": "Solar gains", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + gn_sol = gn_sol.to_dataset(name="gn_sol") + encoding = {"gn_sol": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_gn_sol_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + gn_sol.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + gn_sol = xr.open_dataarray(filestr).load() + # + # #Solar gains - From roof only + # with ProgressBar(): + # print('Stage 3 - calc gn_sol_h') + # gn_sol_h = calc_gn_sol_h(i_sol_h, roof_area, roof_abs, u_roof) + # gn_sol_h = gn_sol_h.chunk(chunks={'lon':chunksize2}) + # # t_out_ave = t_out_ave.chunk(chunks={'lon':chunksize2}) + # print('chunked') + # # vdd_c = calc_vdd_c(t_out_ave, t_bal_c, arb_fan=2) # Not needed any more + # print('out') + # gn_sol_h.attrs = {'name':'gn_sol_h', + # 'description':'Solar gains - Roof', + # 'units':'W/m2', + # 'short name': 'Solar gains - Roof', + # 'urt': urt, + # 'name_run': parset.name_run, + # 'id_run': str(parset.Index)} + # gn_sol_h = gn_sol_h.to_dataset(name='gn_sol_h') + # encoding = {'gn_sol_h': comp} + # fname = suff+'_'+str(parset.Index)+'_gn_sol_h_'+urt+'.nc' + # filestr = output_folder2+fname + # gn_sol_h.to_netcdf(filestr, encoding=encoding) + # print(datetime.datetime.now()-start) + # gn_sol_h = xr.open_dataarray(filestr).load() + # + # #Solar gains - From windows only + # with ProgressBar(): + # print('Stage 3 - calc gn_sol_v') + # gn_sol_v = calc_gn_sol_v(i_sol_v, gl_perc, gl_g, gl_sh) + # gn_sol_v = gn_sol_v.chunk(chunks={'lon':chunksize2}) + # # t_out_ave = t_out_ave.chunk(chunks={'lon':chunksize2}) + # print('chunked') + # # vdd_c = calc_vdd_c(t_out_ave, t_bal_c, arb_fan=2) # Not needed any more + # print('out') + # gn_sol_v.attrs = {'name':'gn_sol_v', + # 'description':'Solar gains - Windows', + # 'units':'W/m2', + # 'short name': 'Solar gains - Windows', + # 'urt': urt, + # 'name_run': parset.name_run, + # 'id_run': str(parset.Index)} + # gn_sol_v = gn_sol_v.to_dataset(name='gn_sol_v') + # encoding = {'gn_sol_v': comp} + # fname = suff+'_'+str(parset.Index)+'_gn_sol_v_'+urt+'.nc' + # filestr = output_folder2+fname + # gn_sol_v.to_netcdf(filestr, encoding=encoding) + # print(datetime.datetime.now()-start) + # gn_sol_v = xr.open_dataarray(filestr).load() + + # ============================================================================== + # Heat transfer functions + # ============================================================================== + + with ProgressBar(): + H_v_cl = calc_H_v_cl(vol, ach_cl) + if config.verbose: + print("Stage 3 - calc_H_v_cl") + print(datetime.datetime.now() - input_start) + # H_v_cl = xr.open_dataarray(output_folder2+'H_v_cl_'+urt+'.nc').load() + + with ProgressBar(): + H_v_op = calc_H_v_op(vol, ach_op) + if config.verbose: + print("Stage 3 - calc_H_v_op") + print(datetime.datetime.now() - input_start) + # H_v_op = xr.open_dataarray(output_folder2+'H_v_op_'+urt+'.nc').load() + + with ProgressBar(): + H_tr = calc_H_tr(u_val, area_env) + if config.verbose: + print("Stage 3 - calc_H_tr") + print(datetime.datetime.now() - input_start) + # H_tr = xr.open_dataarray(output_folder2+'H_tr_'+urt+'.nc').load() + dfa.loc[parset.Index, :] = [H_v_cl, H_v_op, H_tr] + + # ============================================================================== + # COOLING CALCULATIONS + # ============================================================================== + + if config.cool == 1: + # ============================================================================== + # Variable CDD functions + # ============================================================================== + with ProgressBar(): + print("t_bal_c") + t_bal_c = calc_t_bal_c( + t_sp_c, gn_int, gn_sol, H_tr, H_v_cl + ).astype("float32") # , x_diff0 + t_bal_c = t_bal_c.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + t_bal_c.attrs = { + "name": "t_bal_c", + "description": "Balance (base) temperature", + "units": "degC", + "short name": "Balance temp.", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + t_bal_c = t_bal_c.to_dataset(name="t_bal_c") + encoding = {"t_bal_c": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_t_bal_c_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + t_bal_c.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + t_bal_c = xr.open_dataarray(filestr) + + # ============================================================================= + # t_max_c + # ============================================================================= + with ProgressBar(): + print("Calc_t_max_c") + t_max_c = calc_t_max_c( + t_sp_c_max, gn_int, gn_sol, H_tr, H_v_op + ) # , x_diff0) + t_max_c.attrs = { + "name": "t_max_c", + "description": "This returns the max temperature", + "units": "degC", + "short name": "Max temp.", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + t_max_c = t_max_c.to_dataset(name="t_max_c") + encoding = {"t_max_c": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_t_max_c_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + t_max_c.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + t_max_c = xr.open_dataarray(filestr).load() + # ============================================================================= + # Nd - only this one uses daily + # ============================================================================= + # Days per month over t_max_c + with ProgressBar(): + print("Calc Nd") + Nd = calc_Nd(t_out_ave, t_max_c, nyrs_clim) + Nd.attrs = { + "name": "Nd", + "description": "This returns the days per month over t_max_c", + "units": "days/month", + "short name": "Days > t_max_c", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + Nd = Nd.to_dataset(name="Nd") + encoding = {"Nd": config.comp} + fname = ( + suff + "_" + str(parset.Index) + "_Nd_" + urt + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + Nd.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + Nd = xr.open_dataarray(filestr) + + # ============================================================================= + # Nf - only this one uses daily + # ============================================================================= + # Days per month over t_max_c + with ProgressBar(): + print("Calc Nf") + Nf = calc_Nf(t_out_ave, t_bal_c, nyrs_clim) + Nf.attrs = { + "name": "Nf", + "description": "This returns the days per month above t_bal_c", + "units": "days/month", + "short name": "Days > t_bal_c", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + Nf = Nf.to_dataset(name="Nf") + encoding = {"Nf": config.comp} + fname = ( + suff + "_" + str(parset.Index) + "_Nf_" + urt + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + Nf.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + Nf = xr.open_dataarray(filestr) + + # ============================================================================= + # vdd_tmax_c + # ============================================================================= + # Days per month over t_max_c + with ProgressBar(): + print("Calc_vdd_tmax_c") + vdd_tmax_c = calc_vdd_tmax_c(t_oa_gbm, t_max_c) + vdd_tmax_c = vdd_tmax_c.chunk( + chunks={"lon": config.chunk_size} + ) + vdd_tmax_c = ( + vdd_tmax_c.groupby("time.month").sum("time") / nyrs_clim + ) # <<< divide by years + vdd_tmax_c.attrs = { + "name": "vdd_tmax_c", + "description": "This returns the sum of variable cooling degree days per month based on Tmax", + "units": "degC", + "short name": "Var. cooling DD", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + vdd_tmax_c = vdd_tmax_c.to_dataset(name="vdd_tmax_c") + encoding = {"vdd_tmax_c": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_vdd_tmax_c_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + vdd_tmax_c.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + vdd_tmax_c = xr.open_dataarray(filestr) + + # ============================================================================= + # qctmax + # ============================================================================= + t_bal_c = xr.open_dataarray( + os.path.join( + output_path_vdd, + suff + + "_" + + str(parset.Index) + + "_t_bal_c_" + + urt + + ".nc", + ) + ) + with ProgressBar(): + print("Calc_qctmax") + qctmax = Q_c_tmax( + H_tr, H_v_cl, vdd_tmax_c, t_max_c, t_bal_c, Nd, f_c + ) + qctmax.attrs = { + "name": "qctmax", + "description": "This returns the monthly cooling energy (MJ) based on variable degree days", + "units": "MJ/month", + "short name": "Sensible load", + "AC_hours": str(f_c), + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + qctmax = qctmax.to_dataset(name="qctmax") + encoding = {"qctmax": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_qctmax_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + qctmax.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + t_bal_c.close() + qctmax = xr.open_dataarray(filestr) + + # ============================================================================= + # E_c_ac electricity + # ============================================================================= + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + with ProgressBar(): + print("E_c AC") + E_c_ac = calc_E_c_ac(qctmax, cop) + E_c_ac.attrs = { + "name": "E_c_ac", + "description": "monthly electricity requirement for air conditioning - sensible (MJ)", + "units": "MJ/month", + "short name": "AC energy sens", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + E_c_ac = E_c_ac.to_dataset(name="E_c_ac") + encoding = {"E_c_ac": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_E_c_ac_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + E_c_ac.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + with ProgressBar(): + print("E_f fans") + E_c_fan = calc_E_c_fan( + f_f, P_f, Nf, config.area_fan + ) # Where Nf is same as Nd + E_c_fan.attrs = { + "name": "E_c_fan", + "description": "monthly electricity requirement for fans (MJ)", + "units": "MJ/month", + "short name": "Fan energy", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + E_c_fan = E_c_fan.to_dataset(name="E_c_fan") + encoding = {"E_c_fan": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_E_c_fan_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + E_c_fan.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + # ============================================================================= + # dfa.to_csv(output_folder2+'constant_vars_out.csv') + # print('Finished!: '+str(parset)) + # print(datetime.datetime.now()-start) + # ============================================================================= + + # ============================================================================== + # HEATING CALCULATIONS + # ============================================================================== + + if config.heat == 1: + # ============================================================================== + # Variable HDD functions + # ============================================================================== + with ProgressBar(): + print("calc_t_bal_h") + t_bal_h = calc_t_bal_h( + t_sp_h, gn_int, gn_sol, H_tr, H_v_cl + ).astype("float32") # , x_diff0 + t_bal_h = t_bal_h.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + t_bal_h.attrs = { + "name": "t_bal_h", + "description": "Balance (base) temperature", + "units": "degC", + "short name": "Balance temp.", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + t_bal_h = t_bal_h.to_dataset(name="t_bal_h") + encoding = {"t_bal_h": config.comp} + fname = ( + suff + + "_" + + str(parset.Index) + + "_t_bal_h_" + + urt + + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + t_bal_h.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + t_bal_h = xr.open_dataarray(filestr) + + # ============================================================================= + # vdd_h + # ============================================================================= + + with ProgressBar(): + print("calc_vdd_h") + vdd_h = calc_vdd_h(t_oa_gbm, t_bal_h) + vdd_h = vdd_h.chunk(chunks={"lon": config.chunk_size}) + vdd_h = ( + vdd_h.groupby("time.month").sum("time") / nyrs_clim + ) # <<< divide by years + vdd_h.attrs = { + "name": "vdd_h", + "description": "This returns the sum of variable heating degree days per month", + "units": "degC", + "short name": "Var. heating DD", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + vdd_h = vdd_h.to_dataset(name="vdd_h") + encoding = {"vdd_h": config.comp} + fname = ( + suff + "_" + str(parset.Index) + "_vdd_h_" + urt + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + vdd_h.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + vdd_h = xr.open_dataarray(filestr) + + # ============================================================================= + # qh + # ============================================================================= + t_bal_h = xr.open_dataarray( + os.path.join( + output_path_vdd, + suff + + "_" + + str(parset.Index) + + "_t_bal_h_" + + urt + + ".nc", + ) + ) + with ProgressBar(): + print("Calc_qh") + qh = Q_h(H_tr, H_v_cl, f_h, vdd_h) + qh.attrs = { + "name": "qh", + "description": "This returns the monthly heating energy (MJ) based on variable degree days", + "units": "MJ/month", + "short name": "Sensible load", + "heating_hours": str(f_h), + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + qh = qh.to_dataset(name="qh") + encoding = {"qh": config.comp} + fname = ( + suff + "_" + str(parset.Index) + "_qh_" + urt + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + qh.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + qh = xr.open_dataarray(filestr) + + # ============================================================================= + # E_h final energy + # ============================================================================= + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + with ProgressBar(): + print("E_h") + E_h = calc_E_h(qh, eff) + E_h.attrs = { + "name": "E_h", + "description": "monthly final energy for heating (MJ)", + "units": "MJ/month", + "short name": "heating energy", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + E_h = E_h.to_dataset(name="E_h") + encoding = {"E_h": config.comp} + fname = ( + suff + "_" + str(parset.Index) + "_E_h_" + urt + ".nc" + ) + filestr = os.path.join(output_path_vdd, fname) + E_h.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - input_start) + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + dfa.to_csv( + os.path.join( + output_path_vdd, suff + "_" + "constant_vars_out.csv" + ) + ) + # print('Finished!: '+suff+'+str(parset)) + # print('Finished!') + print(datetime.datetime.now() - input_start) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py new file mode 100644 index 0000000..4133f83 --- /dev/null +++ b/message_ix_buildings/chilled/run_main.py @@ -0,0 +1,13 @@ +import datetime + +from main.climate import create_climate_outputs # type: ignore +from utils.config import Config # type: ignore + +start = datetime.datetime.now() + +cfg = Config() + +# create climate outputs +create_climate_outputs(cfg, start) + +end = datetime.datetime.now() From f53abfb3443e61abeb6fc0bced7fc576f76c8f12 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:15:41 +0200 Subject: [PATCH 037/114] Fix typo for `climate_filestr_future` --- message_ix_buildings/chilled/main/climate.py | 48 ++++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 7737d43..e65a5df 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -32,12 +32,10 @@ from utils.util import load_parametric_analysis_data # type: ignore -def create_climate_outputs(config: "Config", input_start: datetime.datetime): +def create_climate_outputs(config: "Config", start_time: datetime.datetime): out_path = os.path.join(config.dle_path, "out", "version") save_path = os.path.join(out_path, config.vstr, "VDD_ene_calcs") - # input_path = os.path.join(input_dle_path, "input_data") - output_path_vdd = os.path.join( save_path, config.gcm, @@ -78,7 +76,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = config.climate_filestr_hist else: isi_folder = config.isimip_bias_adj_path - filestr = config.input_climate_filestr_fut + filestr = config.climate_filestr_future filepath = os.path.join( isi_folder, config.rcpdata, config.gcm, f"{filestr.lower()}*{config.endstr}" @@ -219,7 +217,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) sdd_c.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) sdd_c = xr.open_dataarray(filestr) # ============================================================== @@ -250,7 +248,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) sdd_h.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) sdd_h = xr.open_dataarray(filestr) for urt in config.urts: @@ -334,7 +332,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) gn_sol.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) gn_sol = xr.open_dataarray(filestr).load() elif config.solar_gains == "TOT": @@ -375,7 +373,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) gn_sol.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) gn_sol = xr.open_dataarray(filestr).load() elif config.solar_gains == "HOR": @@ -407,7 +405,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) gn_sol.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) gn_sol = xr.open_dataarray(filestr).load() # # #Solar gains - From roof only @@ -466,21 +464,21 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): H_v_cl = calc_H_v_cl(vol, ach_cl) if config.verbose: print("Stage 3 - calc_H_v_cl") - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) # H_v_cl = xr.open_dataarray(output_folder2+'H_v_cl_'+urt+'.nc').load() with ProgressBar(): H_v_op = calc_H_v_op(vol, ach_op) if config.verbose: print("Stage 3 - calc_H_v_op") - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) # H_v_op = xr.open_dataarray(output_folder2+'H_v_op_'+urt+'.nc').load() with ProgressBar(): H_tr = calc_H_tr(u_val, area_env) if config.verbose: print("Stage 3 - calc_H_tr") - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) # H_tr = xr.open_dataarray(output_folder2+'H_tr_'+urt+'.nc').load() dfa.loc[parset.Index, :] = [H_v_cl, H_v_op, H_tr] @@ -521,7 +519,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) t_bal_c.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) t_bal_c = xr.open_dataarray(filestr) # ============================================================================= @@ -555,7 +553,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) t_max_c.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) t_max_c = xr.open_dataarray(filestr).load() # ============================================================================= # Nd - only this one uses daily @@ -581,7 +579,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) Nd.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) Nd = xr.open_dataarray(filestr) # ============================================================================= @@ -608,7 +606,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) Nf.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) Nf = xr.open_dataarray(filestr) # ============================================================================= @@ -646,7 +644,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) vdd_tmax_c.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) vdd_tmax_c = xr.open_dataarray(filestr) # ============================================================================= @@ -692,7 +690,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) qctmax.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) t_bal_c.close() qctmax = xr.open_dataarray(filestr) @@ -726,7 +724,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) E_c_ac.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') with ProgressBar(): print("E_f fans") @@ -755,7 +753,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) E_c_fan.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) # ============================================================================= # dfa.to_csv(output_folder2+'constant_vars_out.csv') # print('Finished!: '+str(parset)) @@ -799,7 +797,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) t_bal_h.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) t_bal_h = xr.open_dataarray(filestr) # ============================================================================= @@ -830,7 +828,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) vdd_h.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) vdd_h = xr.open_dataarray(filestr) # ============================================================================= @@ -869,7 +867,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) qh.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) qh = xr.open_dataarray(filestr) # ============================================================================= @@ -897,7 +895,7 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): filestr = os.path.join(output_path_vdd, fname) E_h.to_netcdf(filestr, encoding=encoding) if config.verbose: - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') dfa.to_csv( os.path.join( @@ -906,4 +904,4 @@ def create_climate_outputs(config: "Config", input_start: datetime.datetime): ) # print('Finished!: '+suff+'+str(parset)) # print('Finished!') - print(datetime.datetime.now() - input_start) + print(datetime.datetime.now() - start_time) From 622700fc9c51cb94433e49e581d7e0bb101b59a6 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:17:08 +0200 Subject: [PATCH 038/114] Fix archetype path --- message_ix_buildings/chilled/main/climate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index e65a5df..5384048 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -34,6 +34,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): out_path = os.path.join(config.dle_path, "out", "version") + archetype_path = os.path.join(out_path, config.vstr, "rasters") save_path = os.path.join(out_path, config.vstr, "VDD_ene_calcs") output_path_vdd = os.path.join( @@ -137,7 +138,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): if config.arch_setting == "regional": xr.open_dataset( os.path.join( - output_path_vdd, + archetype_path, "arch_map_" + config.arch_setting + "_" + arch + ".nc", ) ) From aa9756c366b2cc50de89181b1513cbd7dbf70b12 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:18:32 +0200 Subject: [PATCH 039/114] Edit archetype paths for other variables --- message_ix_buildings/chilled/main/climate.py | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 5384048..22df499 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -261,43 +261,43 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): pass area_env = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_area_env.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_area_env.nc") )[urt] # Area of the building envelope gl_perc = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_gl_perc.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_gl_perc.nc") )[urt] # 0.1 vol = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_vol.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_vol.nc") )[urt] # 3 xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_fl_cnd.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_fl_cnd.nc") )[urt] # 1 u_val = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_u_val.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_u_val.nc") )[urt] # 2.4 # Average U-value of building envelope # float ach_cl = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_ach_cl.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_ach_cl.nc") )[urt] # 0.5 ach_op = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_ach_op.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_ach_op.nc") )[urt] # 1.5 # TAB - ACH (1/h) - open windows gn_int = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_gn_int.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_gn_int.nc") )[urt] # 5 # FIX Internal gains (W/m2) gl_g = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_gl_g.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_gl_g.nc") )[urt] # 0.85 # TAB g-value for glazing gl_sh = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_gl_sh.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_gl_sh.nc") )[urt] # 0.9 # TAB shading coeff for openings roof_area = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_roof_area.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_roof_area.nc") )[urt] roof_abs = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_roof_abs.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_roof_abs.nc") )[urt] u_roof = xr.open_dataset( - os.path.join(output_path_vdd, "arch_" + suff1 + "_u_roof.nc") + os.path.join(archetype_path, "arch_" + suff1 + "_u_roof.nc") )[urt] # ============================================================================== From 0d00616219362ffc9ba12bf74347440a6178e928 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:28:49 +0200 Subject: [PATCH 040/114] Edit save paths for VDD calculations --- message_ix_buildings/chilled/main/climate.py | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 22df499..e8e3515 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -33,15 +33,14 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): - out_path = os.path.join(config.dle_path, "out", "version") - archetype_path = os.path.join(out_path, config.vstr, "rasters") - save_path = os.path.join(out_path, config.vstr, "VDD_ene_calcs") + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + archetype_path = os.path.join(out_path, "rasters") + save_path = os.path.join(out_path, "VDD_ene_calcs") output_path_vdd = os.path.join( save_path, config.gcm, config.rcp, - "2_VDD_ene_calcs", ) if not os.path.exists(output_path_vdd): @@ -217,6 +216,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): fname = suff + "_sdd_c_" + str(bal_temp) + ".nc" filestr = os.path.join(output_path_vdd, fname) sdd_c.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) sdd_c = xr.open_dataarray(filestr) @@ -248,6 +248,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): fname = suff + "_sdd_h_" + str(bal_temp) + ".nc" filestr = os.path.join(output_path_vdd, fname) sdd_h.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) sdd_h = xr.open_dataarray(filestr) @@ -332,6 +333,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) gn_sol.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) gn_sol = xr.open_dataarray(filestr).load() @@ -373,6 +375,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) gn_sol.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) gn_sol = xr.open_dataarray(filestr).load() @@ -405,6 +408,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) gn_sol.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) gn_sol = xr.open_dataarray(filestr).load() @@ -519,6 +523,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) t_bal_c.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) t_bal_c = xr.open_dataarray(filestr) @@ -553,6 +558,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) t_max_c.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) t_max_c = xr.open_dataarray(filestr).load() @@ -579,6 +585,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) Nd.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) Nd = xr.open_dataarray(filestr) @@ -606,6 +613,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) Nf.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) Nf = xr.open_dataarray(filestr) @@ -644,6 +652,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) vdd_tmax_c.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) vdd_tmax_c = xr.open_dataarray(filestr) @@ -690,6 +699,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) qctmax.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) t_bal_c.close() @@ -724,6 +734,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) E_c_ac.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') @@ -753,6 +764,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) E_c_fan.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) # ============================================================================= @@ -797,6 +809,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) t_bal_h.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) t_bal_h = xr.open_dataarray(filestr) @@ -828,6 +841,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) vdd_h.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) vdd_h = xr.open_dataarray(filestr) @@ -867,6 +881,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) qh.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) qh = xr.open_dataarray(filestr) @@ -895,6 +910,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): ) filestr = os.path.join(output_path_vdd, fname) E_h.to_netcdf(filestr, encoding=encoding) + print("Saved: " + filestr) if config.verbose: print(datetime.datetime.now() - start_time) # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') From af29e1a359ce61ef16c4908bf7454177467c34c8 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:39:42 +0200 Subject: [PATCH 041/114] Set options and defaults in config --- message_ix_buildings/chilled/utils/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index dc8bd45..45c3b9c 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -37,11 +37,13 @@ class Config: # VERSION SETTINGS vstr = "ALPS2023" # version input data vstrcntry = "v4" # version string for country data and floor surface - gcm = "MRI-ESM2-0" # options: GFDL-ESM4, IPSL-CM6A-LR, MPI-ESM1-2-HR, MRI-ESM2-0, and UKESM1-0-LL + gcm: Literal[ + "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0" + ] = "GFDL-ESM4" # SCENARIO SETTINGS rcps = ["ssp126", "ssp370", "ssp585", "baseline"] # list all possible scenarios - rcp = "ssp126" # options: "ssp126", "ssp370", "ssp585", "baseline" + rcp: Literal["ssp126", "ssp370", "ssp585", "baseline"] = "baseline" if rcp == "baseline": rcpdata = "ssp126" From 6680533da08b1d81e3fe690c7738400821716f3b Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:39:52 +0200 Subject: [PATCH 042/114] Edit script to take in inputs and arguments --- message_ix_buildings/chilled/run_main.py | 64 ++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 4133f83..1eec50c 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -1,13 +1,69 @@ import datetime +import sys +from argparse import ArgumentParser from main.climate import create_climate_outputs # type: ignore from utils.config import Config # type: ignore -start = datetime.datetime.now() -cfg = Config() +def parse_arguments(arguments): + """ + + :return: + """ + parser = ArgumentParser(add_help=True) + + # Scenario name and location options + parser.add_argument( + "-gcm", + "--gcm", + default="GFDL-ESM4", + help="GCM to run. Options: GFDL-ESM4, IPSL-CM6A-LR, MPI-ESM1-2-HR, MRI-ESM2-0, UKESM1-0. Default: GFDL-ESM4.", + ) + parser.add_argument( + "-rcp", + "--rcp", + default="baseline", + help="RCP to run. Options: ssp126, ssp370, ssp585, baseline. Default: baseline.", + ) + + # Parse arguments + parsed_arguments = parser.parse_known_args(args=arguments)[0] + + return parsed_arguments + + +def print_arguments(parsed_arguments): + """ + :param parsed_arguments: + + """ + + # Print arguments + print("---------- Parsed arguments ------------") + print("Selected GCM: " + parsed_arguments.gcm) + print("Selected RCP scenario: " + parsed_arguments.rcp) + # create climate outputs -create_climate_outputs(cfg, start) +def create_config(parsed_arguments): + cfg = Config(gcm=parsed_arguments.gcm, rcp=parsed_arguments.rcp) + + return cfg + + +def main(args=None): + if args is None: + args = sys.argv[1:] + + parsed_args = parse_arguments(arguments=args) + + # Run the main function + start = datetime.datetime.now() + print_arguments(parsed_arguments=parsed_args) + cfg = create_config(parsed_arguments=parsed_args) + create_climate_outputs(cfg, start) + -end = datetime.datetime.now() +if __name__ == "__main__": + main() From 778ca9442d139195148eb7d8ffb028b87cd4eac6 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 12:44:55 +0200 Subject: [PATCH 043/114] Add argument for version --- message_ix_buildings/chilled/run_main.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 1eec50c..346a415 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -13,7 +13,12 @@ def parse_arguments(arguments): """ parser = ArgumentParser(add_help=True) - # Scenario name and location options + parser.add_argument( + "-version", + "--version", + default="ALPS2023", + help="Version of inputs to run. Default: ALPS2023.", + ) parser.add_argument( "-gcm", "--gcm", @@ -41,13 +46,18 @@ def print_arguments(parsed_arguments): # Print arguments print("---------- Parsed arguments ------------") + print("Selected version: " + parsed_arguments.version) print("Selected GCM: " + parsed_arguments.gcm) print("Selected RCP scenario: " + parsed_arguments.rcp) # create climate outputs def create_config(parsed_arguments): - cfg = Config(gcm=parsed_arguments.gcm, rcp=parsed_arguments.rcp) + cfg = Config( + gcm=parsed_arguments.gcm, + rcp=parsed_arguments.rcp, + vstr=parsed_arguments.version, + ) return cfg From ea7689805edb446f37bf39e84fd6721643945c0a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 13:00:22 +0200 Subject: [PATCH 044/114] Change to using `create_climate_variables_maps()` function --- message_ix_buildings/chilled/main/climate.py | 689 +++++++++++++++++++ message_ix_buildings/chilled/run_main.py | 4 +- 2 files changed, 691 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index e8e3515..0d4de9e 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -1,5 +1,6 @@ import datetime import os +from itertools import product import numpy as np import pandas as pd # type: ignore @@ -28,10 +29,698 @@ calc_vdd_h, calc_vdd_tmax_c, ) +from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from utils.config import Config # type: ignore from utils.util import load_parametric_analysis_data # type: ignore +def create_climate_variables_maps(config: "Config", start_time: datetime.datetime): + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + archetype_path = os.path.join(out_path, "rasters") + save_path = os.path.join(out_path, "VDD_ene_calcs") + + output_path_vdd = os.path.join( + save_path, + config.gcm, + config.rcp, + ) + + if not os.path.exists(output_path_vdd): + os.makedirs(output_path_vdd) + + par_var = load_parametric_analysis_data(config) + + def map_calculated_variables(args): + clim, arch, parset, urt = args + + print(clim + " + " + arch + " + " + parset.name_run + " + " + urt) + + years_clim = config.yeardic[clim] + # << this selects the correct years. + # But when testing you’ll want to use just say 3 years data, + # so set years manually, e.g. + # years_clim = yeardic6p0[str(s_run.clim)] + + # this will be the shortcut line to make the testing faster (2 years data) + if config.testing_mode == 1: + years_clim = ( + years_clim[0], + str(int(years_clim[0]) + 1), + ) + + nyrs_clim = int(years_clim[1]) - int(years_clim[0]) + 1 + + if str(clim) == "hist": + isi_folder = config.isimip_ewemib_path + filestr = config.climate_filestr_hist + else: + isi_folder = config.isimip_bias_adj_path + filestr = config.climate_filestr_future + + filepath = os.path.join( + isi_folder, + config.rcpdata, + config.gcm, + f"{filestr.lower()}*{config.endstr}", + ) + if config.rcp == "rcp26": + dst = xr.open_mfdataset( + filepath, + chunks={"lon": config.chunk_size}, + concat_dim="time", + use_cftime=True, + ) # Setting for RCP2.6 + else: + dst = xr.open_mfdataset( + filepath, + chunks={"lon": config.chunk_size}, + ) # , concat_dim='time' ) # Setting for RCP6.0 + + dst_crop = dst.sel(time=slice(years_clim[0], years_clim[1])) + t_out_ave = dst_crop[config.davar].astype("float32") - 273.16 + t_out_ave = t_out_ave.transpose("lat", "lon", "time") + t_oa_gbm = t_out_ave.groupby("time.month") + + i_sol_v = xr.open_dataarray( + os.path.join(config.dle_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") + ) # Values in daily Wh/m2 + + # Horizontal irradiation + i_sol_h = xr.open_dataarray( + os.path.join(config.dle_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") + ) # Values in daily Wh/m2 + + if config.arch_setting == "regional": + xr.open_dataset( + os.path.join( + archetype_path, + "arch_map_" + config.arch_setting + "_" + arch + ".nc", + ) + ) + + dfa = pd.DataFrame(columns=["H_v_cl", "H_v_op", "H_tr"], index=par_var.index) + + suff = clim + "_" + arch # suffix + # suff = clim+'_'+arch+'_'+str(parset.name_run) #suffix + suff1 = arch # only arch (for imports arch data) + + print("Starting: " + suff + "_" + str(parset.name_run)) + if config.cool == 1: + cop = parset.cop + t_sp_c = np.int8( + parset.t_sp_c + ) # Indoor setpoint temperature for cooling -> 26 + t_sp_c_max = np.int8( + parset.t_sp_c_max + ) # Indoor max temperature when fans are on (°C) -> 28 + + f_c = parset.f_c + f_f = parset.f_f + + if config.heat == 1: + t_sp_h = np.int8( + parset.t_sp_h + ) # Indoor max temperature when fans are on (°C) -> 20 + eff = parset.eff # Efficiency heating system + + f_h = parset.f_h + + # # Archetypes should be in parset to execute this (OLD CODE) + # if arch_setting == 'fixed': + # au = parset.arch_u + # ar = parset.arch_r + # al = [ar, au] + + # print(sddf) + + if config.runsdd == 1: + # ============================================================= + # Simple CDD calculation + # ============================================================= + + for bal_temp in config.bal_temps: + with ProgressBar(): + print("Stage 3 - Simple HDDCDD - cooling") + print("Balance temp " + str(bal_temp) + "C") + sdd_c = calc_SCDD_m(t_out_ave, bal_temp) + sdd_c = sdd_c.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + sdd_c.attrs = { + "name": "sdd_c", + "description": "Simple cooling degree days", + "units": "degC", + "short name": "CDD.", + # 'urt': urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + "bal_temp": str(bal_temp), + } + print(sdd_c) + sdd_c = sdd_c.to_dataset(name="sdd_c") + encoding = {"sdd_c": config.comp} + # fname = suff+'_'+str(parset.Index)+'_sdd_c_'+str(bal_temp)+'.nc' + fname = suff + "_sdd_c_" + str(bal_temp) + ".nc" + filestr = os.path.join(output_path_vdd, fname) + sdd_c.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + sdd_c = xr.open_dataarray(filestr) + + # ============================================================== + # Simple HDD calculation + # ============================================================== + + for bal_temp in config.bal_temps: + with ProgressBar(): + print("Stage 3 - Simple HDDCDD - heating") + print("Balance temp " + str(bal_temp) + "C") + sdd_h = calc_SHDD_m(t_out_ave, bal_temp) + sdd_h = sdd_h.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + sdd_h.attrs = { + "name": "sdd_h", + "description": "Simple heating degree days", + "units": "degC", + "short name": "HDD.", + # 'urt': urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + "bal_temp": str(bal_temp), + } + sdd_h = sdd_h.to_dataset(name="sdd_h") + encoding = {"sdd_h": config.comp} + # fname = suff+'_'+str(parset.Index)+'_sdd_h_'+str(bal_temp)+'.nc' + fname = suff + "_sdd_h_" + str(bal_temp) + ".nc" + filestr = os.path.join(output_path_vdd, fname) + sdd_h.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + sdd_h = xr.open_dataarray(filestr) + + def read_netcdf_files(input_args): + varname, arch, urt = input_args + var = xr.open_dataset( + os.path.join( + archetype_path, "arch_" + arch + "_" + str(varname) + ".nc" + ) + )[urt] + + return var + + list_args = product(VARS_ARCHETYPES, [arch], [urt]) + list_netcdf = list(map(read_netcdf_files, list_args)) + dict_netcdf = dict(zip(VARS_ARCHETYPES, list_netcdf)) + + if config.solar_gains == "VERT": + # Solar gains - From windows only + with ProgressBar(): + print("Stage 3 - calc gn_sol") + gn_sol = calc_gn_sol( + i_sol_v, + dict_netcdf["gl_perc"], + dict_netcdf["gl_g"], + dict_netcdf["gl_sh"], + ) + gn_sol = gn_sol.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + gn_sol.attrs = { + "name": "gn_sol", + "description": "Solar gains - Windows", + "units": "W/m2", + "short name": "Solar gains - Windows", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + gn_sol = gn_sol.to_dataset(name="gn_sol") + encoding = {"gn_sol": config.comp} + fname = suff + "_" + str(parset.Index) + "_gn_sol_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + gn_sol.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + gn_sol = xr.open_dataarray(filestr).load() + + elif config.solar_gains == "TOT": + # Solar gains - Total + with ProgressBar(): + print("Stage 3 - calc gn_sol") + gn_sol = calc_gn_sol_tot( + i_sol_v, + dict_netcdf["gl_perc"], + dict_netcdf["gl_g"], + dict_netcdf["gl_sh"], + i_sol_h, + dict_netcdf["roof_area"], + dict_netcdf["roof_abs"], + dict_netcdf["u_roof"], + ) + gn_sol = gn_sol.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + gn_sol.attrs = { + "name": "gn_sol", + "description": "Solar gains", + "units": "W/m2", + "short name": "Solar gains", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + gn_sol = gn_sol.to_dataset(name="gn_sol") + encoding = {"gn_sol": config.comp} + fname = suff + "_" + str(parset.Index) + "_gn_sol_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + gn_sol.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + gn_sol = xr.open_dataarray(filestr).load() + + elif config.solar_gains == "HOR": + # Solar gains - Total + with ProgressBar(): + print("Stage 3 - calc gn_sol") + gn_sol = calc_gn_sol_h( + i_sol_h, + dict_netcdf["roof_area"], + dict_netcdf["roof_abs"], + dict_netcdf["u_roof"], + ) + gn_sol = gn_sol.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + gn_sol.attrs = { + "name": "gn_sol", + "description": "Solar gains", + "units": "W/m2", + "short name": "Solar gains", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + gn_sol = gn_sol.to_dataset(name="gn_sol") + encoding = {"gn_sol": config.comp} + fname = suff + "_" + str(parset.Index) + "_gn_sol_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + gn_sol.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + gn_sol = xr.open_dataarray(filestr).load() + + # ============================================================================== + # Heat transfer functions + # ============================================================================== + with ProgressBar(): + H_v_cl = calc_H_v_cl(dict_netcdf["vol"], dict_netcdf["ach_cl"]) + if config.verbose: + print("Stage 3 - calc_H_v_cl") + # print(datetime.datetime.now() - start_time) + # H_v_cl = xr.open_dataarray(output_folder2+'H_v_cl_'+urt+'.nc').load() + + with ProgressBar(): + H_v_op = calc_H_v_op(dict_netcdf["vol"], dict_netcdf["ach_op"]) + if config.verbose: + print("Stage 3 - calc_H_v_op") + # print(datetime.datetime.now() - start_time) + # H_v_op = xr.open_dataarray(output_folder2+'H_v_op_'+urt+'.nc').load() + + with ProgressBar(): + H_tr = calc_H_tr(dict_netcdf["u_val"], dict_netcdf["area_env"]) + if config.verbose: + print("Stage 3 - calc_H_tr") + # print(datetime.datetime.now() - start_time) + # H_tr = xr.open_dataarray(output_folder2+'H_tr_'+urt+'.nc').load() + dfa.loc[parset.Index, :] = [H_v_cl, H_v_op, H_tr] + + if config.cool == 1: + # ============================================================================== + # Variable CDD functions + # ============================================================================== + with ProgressBar(): + print("t_bal_c") + t_bal_c = calc_t_bal_c( + t_sp_c, dict_netcdf["gn_int"], gn_sol, H_tr, H_v_cl + ).astype("float32") # , x_diff0 + t_bal_c = t_bal_c.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + t_bal_c.attrs = { + "name": "t_bal_c", + "description": "Balance (base) temperature", + "units": "degC", + "short name": "Balance temp.", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + t_bal_c = t_bal_c.to_dataset( + name="t_bal_c" + ) # comment out because already a Dataset + encoding = {"t_bal_c": config.comp} + fname = suff + "_" + str(parset.Index) + "_t_bal_c_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + t_bal_c.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + t_bal_c = xr.open_dataarray(filestr) + + # ============================================================================= + # t_max_c + # ============================================================================= + with ProgressBar(): + print("Calc_t_max_c") + t_max_c = calc_t_max_c( + t_sp_c_max, dict_netcdf["gn_int"], gn_sol, H_tr, H_v_op + ) # , x_diff0) + t_max_c.attrs = { + "name": "t_max_c", + "description": "This returns the max temperature", + "units": "degC", + "short name": "Max temp.", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + t_max_c = t_max_c.to_dataset(name="t_max_c") + encoding = {"t_max_c": config.comp} + fname = suff + "_" + str(parset.Index) + "_t_max_c_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + t_max_c.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + t_max_c = xr.open_dataarray(filestr).load() + # ============================================================================= + # Nd - only this one uses daily + # ============================================================================= + # Days per month over t_max_c + with ProgressBar(): + print("Calc Nd") + Nd = calc_Nd(t_out_ave, t_max_c, nyrs_clim) + Nd.attrs = { + "name": "Nd", + "description": "This returns the days per month over t_max_c", + "units": "days/month", + "short name": "Days > t_max_c", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + Nd = Nd.to_dataset(name="Nd") + encoding = {"Nd": config.comp} + fname = suff + "_" + str(parset.Index) + "_Nd_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + Nd.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + Nd = xr.open_dataarray(filestr) + + # ============================================================================= + # Nf - only this one uses daily + # ============================================================================= + # Days per month over t_max_c + with ProgressBar(): + print("Calc Nf") + Nf = calc_Nf(t_out_ave, t_bal_c, nyrs_clim) + Nf.attrs = { + "name": "Nf", + "description": "This returns the days per month above t_bal_c", + "units": "days/month", + "short name": "Days > t_bal_c", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + Nf = Nf.to_dataset(name="Nf") + encoding = {"Nf": config.comp} + fname = suff + "_" + str(parset.Index) + "_Nf_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + Nf.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + Nf = xr.open_dataarray(filestr) + + # ============================================================================= + # vdd_tmax_c + # ============================================================================= + # Days per month over t_max_c + with ProgressBar(): + print("Calc_vdd_tmax_c") + vdd_tmax_c = calc_vdd_tmax_c(t_oa_gbm, t_max_c) + vdd_tmax_c = vdd_tmax_c.chunk(chunks={"lon": config.chunk_size}) + vdd_tmax_c = ( + vdd_tmax_c.groupby("time.month").sum("time") / nyrs_clim + ) # <<< divide by years + + # old = xr.open_dataarray("D:\\mengm\\IIASA\\DLE - Data\\output_data_v19_ALPS2023\\GFDL-ESM4\\ssp585\\2_VDD_ene_calcs\\archive\\2015_new_0_vdd_tmax_c_urban.nc") + vdd_tmax_c.attrs = { + "name": "vdd_tmax_c", + "description": "This returns the sum of variable cooling degree days per month based on Tmax", + "units": "degC", + "short name": "Var. cooling DD", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + vdd_tmax_c = vdd_tmax_c.to_dataset(name="vdd_tmax_c") + encoding = {"vdd_tmax_c": config.comp} + fname = suff + "_" + str(parset.Index) + "_vdd_tmax_c_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + vdd_tmax_c.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + vdd_tmax_c = xr.open_dataarray(filestr) + + # ============================================================================= + # qctmax + # ============================================================================= + # t_bal_c = xr.open_dataarray( + # os.path.join( + # output_path_vdd, + # suff + "_" + str(parset.Index) + "_t_bal_c_" + urt + ".nc", + # ) + # ) + with ProgressBar(): + print("Calc_qctmax") + qctmax = Q_c_tmax(H_tr, H_v_cl, vdd_tmax_c, t_max_c, t_bal_c, Nd, f_c) + qctmax.attrs = { + "name": "qctmax", + "description": "This returns the monthly cooling energy (MJ) based on variable degree days", + "units": "MJ/month", + "short name": "Sensible load", + "AC_hours": str(f_c), + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + qctmax = qctmax.to_dataset(name="qctmax") + encoding = {"qctmax": config.comp} + fname = suff + "_" + str(parset.Index) + "_qctmax_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + qctmax.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + # t_bal_c.close() + qctmax = xr.open_dataarray(filestr) + + # ============================================================================= + # E_c_ac electricity + # ============================================================================= + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + with ProgressBar(): + print("E_c AC") + E_c_ac = calc_E_c_ac(qctmax, cop) + E_c_ac.attrs = { + "name": "E_c_ac", + "description": "monthly electricity requirement for air conditioning - sensible (MJ)", + "units": "MJ/month", + "short name": "AC energy sens", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + E_c_ac = E_c_ac.to_dataset(name="E_c_ac") + encoding = {"E_c_ac": config.comp} + fname = suff + "_" + str(parset.Index) + "_E_c_ac_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + E_c_ac.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + with ProgressBar(): + print("E_f fans") + E_c_fan = calc_E_c_fan( + f_f, P_f, Nf, config.area_fan + ) # Where Nf is same as Nd + E_c_fan.attrs = { + "name": "E_c_fan", + "description": "monthly electricity requirement for fans (MJ)", + "units": "MJ/month", + "short name": "Fan energy", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + E_c_fan = E_c_fan.to_dataset(name="E_c_fan") + encoding = {"E_c_fan": config.comp} + fname = suff + "_" + str(parset.Index) + "_E_c_fan_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + E_c_fan.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + # ============================================================================= + # dfa.to_csv(output_folder2+'constant_vars_out.csv') + # print('Finished!: '+str(parset)) + # print(datetime.datetime.now()-start) + # ============================================================================= + + # ============================================================================== + # HEATING CALCULATIONS + # ============================================================================== + + if config.heat == 1: + # ============================================================================== + # Variable HDD functions + # ============================================================================== + with ProgressBar(): + print("calc_t_bal_h") + t_bal_h = calc_t_bal_h( + t_sp_h, dict_netcdf["gn_int"], gn_sol, H_tr, H_v_cl + ).astype("float32") # , x_diff0 + t_bal_h = t_bal_h.chunk(chunks={"lon": config.chunk_size}) + print("chunked") + t_bal_h.attrs = { + "name": "t_bal_h", + "description": "Balance (base) temperature", + "units": "degC", + "short name": "Balance temp.", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + t_bal_h = t_bal_h.to_dataset(name="t_bal_h") + encoding = {"t_bal_h": config.comp} + fname = suff + "_" + str(parset.Index) + "_t_bal_h_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + t_bal_h.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + t_bal_h = xr.open_dataarray(filestr) + + # ============================================================================= + # vdd_h + # ============================================================================= + + with ProgressBar(): + print("calc_vdd_h") + vdd_h = calc_vdd_h(t_oa_gbm, t_bal_h) + vdd_h = vdd_h.chunk(chunks={"lon": config.chunk_size}) + vdd_h = ( + vdd_h.groupby("time.month").sum("time") / nyrs_clim + ) # <<< divide by years + vdd_h.attrs = { + "name": "vdd_h", + "description": "This returns the sum of variable heating degree days per month", + "units": "degC", + "short name": "Var. heating DD", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + vdd_h = vdd_h.to_dataset(name="vdd_h") + encoding = {"vdd_h": config.comp} + fname = suff + "_" + str(parset.Index) + "_vdd_h_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + vdd_h.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + vdd_h = xr.open_dataarray(filestr) + + # ============================================================================= + # qh + # ============================================================================= + # t_bal_h = xr.open_dataarray( + # os.path.join( + # output_path_vdd, + # suff + "_" + str(parset.Index) + "_t_bal_h_" + urt + ".nc", + # ) + # ) + with ProgressBar(): + print("Calc_qh") + qh = Q_h(H_tr, H_v_cl, f_h, vdd_h) + qh.attrs = { + "name": "qh", + "description": "This returns the monthly heating energy (MJ) based on variable degree days", + "units": "MJ/month", + "short name": "Sensible load", + "heating_hours": str(f_h), + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + qh = qh.to_dataset(name="qh") + encoding = {"qh": config.comp} + fname = suff + "_" + str(parset.Index) + "_qh_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + qh.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + if config.verbose: + print(datetime.datetime.now() - start_time) + qh = xr.open_dataarray(filestr) + + # ============================================================================= + # E_h final energy + # ============================================================================= + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + with ProgressBar(): + print("E_h") + E_h = calc_E_h(qh, eff) + E_h.attrs = { + "name": "E_h", + "description": "monthly final energy for heating (MJ)", + "units": "MJ/month", + "short name": "heating energy", + "urt": urt, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + E_h = E_h.to_dataset(name="E_h") + encoding = {"E_h": config.comp} + fname = suff + "_" + str(parset.Index) + "_E_h_" + urt + ".nc" + filestr = os.path.join(output_path_vdd, fname) + E_h.to_netcdf(filestr, encoding=encoding) + if config.verbose: + print(datetime.datetime.now() - start_time) + # qlat_month = xr.open_dataarray(output_folder2+'qlat_month_'+urt+'.nc') + dfa.to_csv( + os.path.join(output_path_vdd, suff + "_" + "constant_vars_out.csv") + ) + # print('Finished!: '+suff+'+str(parset)) + # print('Finished!') + print(datetime.datetime.now() - start_time) + + inputs = product(config.clims, config.archs, par_var.itertuples(), config.urts) + list(map(map_calculated_variables, inputs)) + + # mypool = Pool(4) + # return list(mypool.map(map_calculated_variables, inputs)) + + def create_climate_outputs(config: "Config", start_time: datetime.datetime): out_path = os.path.join(config.project_path, "out", "version", config.vstr) archetype_path = os.path.join(out_path, "rasters") diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 346a415..93d7bc3 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -2,7 +2,7 @@ import sys from argparse import ArgumentParser -from main.climate import create_climate_outputs # type: ignore +from main.climate import create_climate_variables_maps # type: ignore from utils.config import Config # type: ignore @@ -72,7 +72,7 @@ def main(args=None): start = datetime.datetime.now() print_arguments(parsed_arguments=parsed_args) cfg = create_config(parsed_arguments=parsed_args) - create_climate_outputs(cfg, start) + create_climate_variables_maps(cfg, start) if __name__ == "__main__": From e6e79122f6fc9278e6dd619092d691924f11ce60 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 13:07:28 +0200 Subject: [PATCH 045/114] Specify `vstr` is string to allow for modifying --- message_ix_buildings/chilled/run_main.py | 2 +- message_ix_buildings/chilled/utils/config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 93d7bc3..2c1e55b 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -54,9 +54,9 @@ def print_arguments(parsed_arguments): # create climate outputs def create_config(parsed_arguments): cfg = Config( + vstr=parsed_arguments.version, gcm=parsed_arguments.gcm, rcp=parsed_arguments.rcp, - vstr=parsed_arguments.version, ) return cfg diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 45c3b9c..235df71 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -35,7 +35,7 @@ class Config: testing_mode = 0 # 1= selects only two years for testing; 0= select all years (full calculation) # VERSION SETTINGS - vstr = "ALPS2023" # version input data + vstr: str = "ALPS2023" # version input data vstrcntry = "v4" # version string for country data and floor surface gcm: Literal[ "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0" From b112bf6f8d31310e1f0cca5aee1d975dbba6516e Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 13:10:06 +0200 Subject: [PATCH 046/114] Add print statement --- message_ix_buildings/chilled/main/climate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 0d4de9e..971082a 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -83,6 +83,7 @@ def map_calculated_variables(args): config.gcm, f"{filestr.lower()}*{config.endstr}", ) + print("Reading: " + filepath) if config.rcp == "rcp26": dst = xr.open_mfdataset( filepath, From 4ded03734d8fafa03a70f62f224a9b21ce0046fe Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 13:15:16 +0200 Subject: [PATCH 047/114] Remove filestrings from config to function --- message_ix_buildings/chilled/main/climate.py | 22 ++++++++++++++------ message_ix_buildings/chilled/utils/config.py | 10 --------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 971082a..b55a93b 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -70,19 +70,29 @@ def map_calculated_variables(args): nyrs_clim = int(years_clim[1]) - int(years_clim[0]) + 1 + # Climate input variable format + climate_filestr_hist = ( + f"tas_day_{config.gcm}_{config.rcpdata}_r1i1p1_EWEMBI_landonly_" # ISIMIP2 + ) + + if config.gcm == "UKESM1-0-LL": + climate_filestr_future = f"{config.gcm}_r1i1p1f2_w5e5_{config.rcpdata}_{config.var}_global_daily_" + else: + climate_filestr_future = f"{config.gcm}_r1i1p1f1_w5e5_{config.rcpdata}_{config.var}_global_daily_" + + endstr = ".nc" + if str(clim) == "hist": isi_folder = config.isimip_ewemib_path - filestr = config.climate_filestr_hist + filestr = climate_filestr_hist else: isi_folder = config.isimip_bias_adj_path - filestr = config.climate_filestr_future + filestr = climate_filestr_future filepath = os.path.join( - isi_folder, - config.rcpdata, - config.gcm, - f"{filestr.lower()}*{config.endstr}", + isi_folder, config.rcpdata, config.gcm, f"{filestr.lower()}*{endstr}" ) + print("Reading: " + filepath) if config.rcp == "rcp26": dst = xr.open_mfdataset( diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 235df71..39b06af 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -128,16 +128,6 @@ class Config: overwrite = 0 - # Climate input variable format - climate_filestr_hist = f"tas_day_{gcm}_{rcpdata}_r1i1p1_EWEMBI_landonly_" # ISIMIP2 - - if gcm == "UKESM1-0-LL": - climate_filestr_future = f"{gcm}_r1i1p1f2_w5e5_{rcpdata}_{var}_global_daily_" - else: - climate_filestr_future = f"{gcm}_r1i1p1f1_w5e5_{rcpdata}_{var}_global_daily_" - - endstr = ".nc" - # BULDING PARAMETERS # Fixed values bal_temps = [18.3, 21.1, 26] # [21.1] # For simple cooling degree days From 316193e79c66a487cfb2b2f89b888fa465e3c3f1 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 13:23:02 +0200 Subject: [PATCH 048/114] Edit to take in arguments --- .../chilled/run_preprocess.py | 72 +++++++++++++++++-- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 0e13c18..b4a460b 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,10 +1,71 @@ -from preprocess.archetypes import ( # type: ignore - create_archetype_variables, +import sys +from argparse import ArgumentParser + +from preprocess.archetypes import ( + create_archetype_variables, # type: ignore create_archetypes, ) from utils.config import Config # type: ignore -cfg = Config() + +def parse_arguments(arguments): + """ + + :return: + """ + parser = ArgumentParser(add_help=True) + + parser.add_argument( + "-version", + "--version", + default="ALPS2023", + help="Version of inputs to run. Default: ALPS2023.", + ) + + # Parse arguments + parsed_arguments = parser.parse_known_args(args=arguments)[0] + + return parsed_arguments + + +def print_arguments(parsed_arguments): + """ + :param parsed_arguments: + + """ + + # Print arguments + print("---------- Parsed arguments ------------") + print("Selected version: " + parsed_arguments.version) + + +# create climate outputs +def create_config(parsed_arguments): + cfg = Config( + vstr=parsed_arguments.version, + ) + + return cfg + + +def main(args=None): + if args is None: + args = sys.argv[1:] + + parsed_args = parse_arguments(arguments=args) + + # Run the main function + print_arguments(parsed_arguments=parsed_args) + cfg = create_config(parsed_arguments=parsed_args) + create_archetypes(cfg) + print("Archetypes created successfully.") + create_archetype_variables(cfg) + print("Archetype variables created successfully.") + + +if __name__ == "__main__": + main() + # check to see if "map_reg_MESSAGE_{config.node}.nc" exists # if not, create the file @@ -16,9 +77,6 @@ # print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") # run create_archetypes -create_archetypes(cfg) -print("Archetypes created successfully.") + # create maps of archetype variables -create_archetype_variables(cfg) -print("Archetype variables created successfully.") From 23a677936d40e1fad75aedc5c3851c4edfdb538a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 14:41:44 +0200 Subject: [PATCH 049/114] Edit UKESM1-0-LL gcm typo --- message_ix_buildings/chilled/run_main.py | 2 +- message_ix_buildings/chilled/utils/config.py | 4 +- message_ix_buildings/chilled/utils/util.py | 40 ++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 2c1e55b..8367405 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -23,7 +23,7 @@ def parse_arguments(arguments): "-gcm", "--gcm", default="GFDL-ESM4", - help="GCM to run. Options: GFDL-ESM4, IPSL-CM6A-LR, MPI-ESM1-2-HR, MRI-ESM2-0, UKESM1-0. Default: GFDL-ESM4.", + help="GCM to run. Options: GFDL-ESM4, IPSL-CM6A-LR, MPI-ESM1-2-HR, MRI-ESM2-0, UKESM1-0-LL. Default: GFDL-ESM4.", ) parser.add_argument( "-rcp", diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 39b06af..37877e3 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -38,7 +38,7 @@ class Config: vstr: str = "ALPS2023" # version input data vstrcntry = "v4" # version string for country data and floor surface gcm: Literal[ - "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0" + "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0-LL" ] = "GFDL-ESM4" # SCENARIO SETTINGS @@ -103,7 +103,7 @@ class Config: urts = ["urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES - archs = ["new", "exist"] + # archs = ["new", "exist"] # PARAMETERS FOR STEP 2 SCRIPT verbose = True diff --git a/message_ix_buildings/chilled/utils/util.py b/message_ix_buildings/chilled/utils/util.py index 175f9c1..ad007ba 100644 --- a/message_ix_buildings/chilled/utils/util.py +++ b/message_ix_buildings/chilled/utils/util.py @@ -9,6 +9,46 @@ def get_project_root() -> Path: return Path(__file__).parent.parent.parent +def get_archs(config: "Config"): + root_path = get_project_root() + version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) + + if config.arch_setting == "fixed": + input_file = os.path.join(version_path, "arch_input.xlsx") + + if os.path.exists(input_file): + input_file = os.path.join(version_path, "arch_input.xlsx") + archs = pd.ExcelFile(input_file).sheet_names + + return archs + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + elif config.arch_setting == "regional": + input_file = os.path.join( + version_path, + "arch_input_reg.xlsx", + ) + + if os.path.exists(input_file): + archs = pd.read_excel(input_file, sheet_name="arch").arch.unique() + + return archs + else: + print( + "Archetypes input file " + + input_file + + " does not exist! Please create file for input." + ) + + # if config.arch_setting == "fixed", then get sheet names of file (these will be the archetypes) + + # if config.arch_setting == "regional", then read in the single file and get the unique values of the "arch" column + + def read_arch_inputs_df(config: "Config", suff: str): root_path = get_project_root() version_path = os.path.join(root_path, "data", "chilled", "version", config.vstr) From 802423577b17c8b8d53e0fad91632603e663bc5a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Tue, 9 Jul 2024 14:44:25 +0200 Subject: [PATCH 050/114] Bring back `archs` in Config for now --- message_ix_buildings/chilled/utils/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 37877e3..e96f9b9 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -103,7 +103,7 @@ class Config: urts = ["urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES - # archs = ["new", "exist"] + archs = ["new", "exist"] # PARAMETERS FOR STEP 2 SCRIPT verbose = True From e9bb01d1eec6aef7ad8129b765847a92d58e9344 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 03:31:48 +0200 Subject: [PATCH 051/114] Fix project path --- message_ix_buildings/chilled/main/climate.py | 8 ++++---- message_ix_buildings/chilled/run_preprocess.py | 5 +---- message_ix_buildings/chilled/utils/config.py | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index b55a93b..703bf38 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -113,12 +113,12 @@ def map_calculated_variables(args): t_oa_gbm = t_out_ave.groupby("time.month") i_sol_v = xr.open_dataarray( - os.path.join(config.dle_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") + os.path.join(config.input_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 # Horizontal irradiation i_sol_h = xr.open_dataarray( - os.path.join(config.dle_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") + os.path.join(config.input_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 if config.arch_setting == "regional": @@ -818,12 +818,12 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): # Vertical irradiation # i_sol_v = xr.open_dataarray(input_folder+'CERES_vert_irrad_2001-13_avg.nc') #Values in daily Wh/m2 i_sol_v = xr.open_dataarray( - os.path.join(config.dle_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") + os.path.join(config.input_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 # Horizontal irradiation i_sol_h = xr.open_dataarray( - os.path.join(config.dle_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") + os.path.join(config.input_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 # i_sol = i_sol.sel(time=slice(years_clim[0],years_clim[1])) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index b4a460b..8105198 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,10 +1,7 @@ import sys from argparse import ArgumentParser -from preprocess.archetypes import ( - create_archetype_variables, # type: ignore - create_archetypes, -) +from preprocess.archetypes import create_archetype_variables, create_archetypes from utils.config import Config # type: ignore diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index e96f9b9..521e5e7 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -15,13 +15,13 @@ class Config: user: Literal["ALE", "ED", "MEAS", "MEAS_EBRO", "MEAS_UNICC"] = "MEAS_UNICC" # print(f"USER: {user}") - project_path = DICT_USER_SETTINGS[user]["dle_path"] + project_path = DICT_USER_SETTINGS[user]["project_path"] dle_path = DICT_USER_SETTINGS[user]["dle_path"] + input_path = os.path.join(dle_path, "input_data") message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] isimip_ewemib_path = DICT_USER_SETTINGS[user]["isimip_ewembi_path"] chunk_size = DICT_USER_SETTINGS[user]["chunk_size"] - input_path = os.path.join(dle_path, "input_data") # type: ignore # RUN SETTINGS paranalysis_mode = 1 # 1 = run entire parametric analysis; 0 = run only ref case From fe5c06454dc739881460ed92641269ce0b15d5d9 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 03:39:59 +0200 Subject: [PATCH 052/114] Edit DLE path --- message_ix_buildings/chilled/main/climate.py | 8 ++++---- message_ix_buildings/chilled/utils/config.py | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 703bf38..b55a93b 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -113,12 +113,12 @@ def map_calculated_variables(args): t_oa_gbm = t_out_ave.groupby("time.month") i_sol_v = xr.open_dataarray( - os.path.join(config.input_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") + os.path.join(config.dle_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 # Horizontal irradiation i_sol_h = xr.open_dataarray( - os.path.join(config.input_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") + os.path.join(config.dle_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 if config.arch_setting == "regional": @@ -818,12 +818,12 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): # Vertical irradiation # i_sol_v = xr.open_dataarray(input_folder+'CERES_vert_irrad_2001-13_avg.nc') #Values in daily Wh/m2 i_sol_v = xr.open_dataarray( - os.path.join(config.input_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") + os.path.join(config.dle_path, "EWEMBI_vert_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 # Horizontal irradiation i_sol_h = xr.open_dataarray( - os.path.join(config.input_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") + os.path.join(config.dle_path, "EWEMBI_horiz_irrad_1980-2009_avg.nc") ) # Values in daily Wh/m2 # i_sol = i_sol.sel(time=slice(years_clim[0],years_clim[1])) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 521e5e7..4b9b0f3 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -1,5 +1,4 @@ import datetime -import os from dataclasses import dataclass from typing import Literal @@ -17,7 +16,6 @@ class Config: project_path = DICT_USER_SETTINGS[user]["project_path"] dle_path = DICT_USER_SETTINGS[user]["dle_path"] - input_path = os.path.join(dle_path, "input_data") message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] isimip_ewemib_path = DICT_USER_SETTINGS[user]["isimip_ewembi_path"] From 6c608100244d7fe81a720cdc0ccbae428ed91a3f Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 04:39:16 +0200 Subject: [PATCH 053/114] Output ISO attributes --- message_ix_buildings/chilled/preprocess/archetypes.py | 2 +- message_ix_buildings/chilled/preprocess/message_raster.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index df15853..b22727c 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -23,7 +23,7 @@ def create_archetypes(config: "Config"): os.makedirs(archetype_path) # get raster file and message map - ras, map_reg = create_message_raster(config) + ras, map_reg, iso_attrs = create_message_raster(config) # save MESSAGE regions map msg_file = "map_reg_MESSAGE_" + config.node + ".nc" diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 8de3d41..47013dd 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -24,13 +24,13 @@ def create_message_raster(config: "Config"): os.path.join(input_path, "gaul_lvl0_hybrid_05_3.nc") ) - ISO_attrs = pd.DataFrame([country_ras.attrs]).T.rename(columns={0: "ISO"}) + iso_attrs = pd.DataFrame([country_ras.attrs]).T.rename(columns={0: "ISO"}) # Region raster reg_ras = xr.Dataset({"MESSAGE11": country_ras.copy(deep=True)}) reg_ras["ISO"] = country_ras.copy(deep=True) - for row in ISO_attrs.itertuples(): + for row in iso_attrs.itertuples(): code = row.ISO # get country ISO code regval = msgregions.loc[msgregions.iso_code == code, "RegNum"] if regval.values.size != 0: @@ -103,7 +103,7 @@ def create_message_raster(config: "Config"): # + os.path.join(output_path, filename) # ) - return reg_ras, map_reg + return reg_ras, map_reg, iso_attrs else: print("Only R11 is supported at the moment.") From 48ae5ac28270d12028507440f9530de1f25a7008 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:23:59 +0200 Subject: [PATCH 054/114] Add other GCM-RCP climate data functions --- message_ix_buildings/chilled/main/climate.py | 1398 +++++++++++++++++- message_ix_buildings/chilled/run_scratch.py | 106 ++ 2 files changed, 1496 insertions(+), 8 deletions(-) create mode 100644 message_ix_buildings/chilled/run_scratch.py diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index b55a93b..38212ae 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -2,19 +2,18 @@ import os from itertools import product +import cartopy # type: ignore +import cartopy.crs as ccrs # type: ignore +import cartopy.feature as cfeature # type: ignore +import matplotlib.pyplot as plt # type: ignore import numpy as np import pandas as pd # type: ignore import xarray as xr from dask.diagnostics import ProgressBar +from functions.buildings_funcs_grid import Q_h # type: ignore from functions.buildings_funcs_grid import ( P_f, Q_c_tmax, - Q_h, - calc_E_c_ac, - calc_E_c_fan, - calc_E_h, - calc_gn_sol, - calc_gn_sol_h, calc_gn_sol_tot, calc_H_tr, calc_H_v_cl, @@ -29,9 +28,16 @@ calc_vdd_h, calc_vdd_tmax_c, ) -from functions.variable_dicts import VARS_ARCHETYPES # type: ignore +from functions.variable_dicts import ( + VARDICT_COOL, + VARDICT_HEAT, + VARS_ARCHETYPES, + VARUNDICT_COOL, + VARUNDICT_HEAT, +) +from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore -from utils.util import load_parametric_analysis_data # type: ignore +from utils.util import load_all_scenarios_data, load_parametric_analysis_data def create_climate_variables_maps(config: "Config", start_time: datetime.datetime): @@ -732,6 +738,1382 @@ def read_netcdf_files(input_args): # return list(mypool.map(map_calculated_variables, inputs)) +def aggregate_urban_rural_files(config: "Config"): + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + save_path = os.path.join(out_path, "VDD_ene_calcs") + + output_path_vdd = os.path.join( + save_path, + config.gcm, + config.rcp, + ) + + par_var = load_parametric_analysis_data(config) + + if not os.path.exists(output_path_vdd): + os.makedirs(output_path_vdd) + + for clim in config.clims: + for arch in config.archs: + suff = clim + "_" + arch # suffix + + print("Aggregating results for " + suff) + # Aggregate archetypes into same files. + varlist = [] + + if config.archs == 1: + varlist.extend( + [ + "t_bal_c", + "vdd_tmax_c", + "qctmax", + "Nd", + "Nf", + "E_c_ac", + "E_c_fan", + "t_max_c", + ] + ) + + if config.heat == 1: + varlist.extend(["t_bal_h", "vdd_h", "qh", "E_h"]) + + comp = {"zlib": True} + + for parset in par_var.itertuples(): + for var in varlist: + print(var) + mds = xr.open_mfdataset( + os.path.join( + output_path_vdd, + suff + "_" + str(parset.Index) + "_" + var + "_*.nc", + ), + concat_dim="urt", + combine="nested", + ) # +urt[0] + # mds['arch'] = al #arcs#[:4] + mds["urt"] = config.urts # arcs#[:4] + + mds.attrs = { + "title": mds[var].attrs["name"], + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + # 'archetypes': al, + "urb_rur": config.urts, + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + encoding = {var: comp for var in mds.data_vars} + filestr = os.path.join( + output_path_vdd, + suff + "_" + str(parset.Index) + "_" + var + "ALL.nc", + ) + mds.to_netcdf(filestr, encoding=encoding) + print("...Saved " + filestr) + + +def make_vdd_total_maps(config: "Config"): + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + save_path = os.path.join(out_path, "VDD_ene_calcs") + + output_path_vdd = os.path.join( + save_path, + config.gcm, + config.rcp, + ) + + par_var = load_parametric_analysis_data(config) + + # TODO: (meas) the original code does not query for clims, + # but without it the code will crash if not all years have been run + clims_int = list(map(int, config.clims)) + print(clims_int) + + s_runs = load_all_scenarios_data(config) + + for s_run in s_runs.itertuples(): + for arch in config.archs: + for urt in config.urts: + suff = str(s_run.clim) + "_" + arch # suffix + + print("Running " + suff) + + def make_map( + data, + ax=None, + add_features=True, + cbar=True, + grid=False, + logNorm=False, + crs=ccrs.PlateCarree(), + plotargs={}, + ): + if ax is None: + fig, ax = plt.subplots(subplot_kw=dict(projection=crs)) + elif not isinstance(ax, cartopy.mpl.geoaxes.GeoAxesSubplot): + msg = "Must provide a cartopy axes object, not: {}" + raise ValueError(msg.format(type(ax))) + + # ax = plt.axes(projection=ccrs.Robinson()) + if add_features: + # ax.add_feature(cartopy.feature.LAND, zorder=0) + + ax.add_feature( + cartopy.feature.OCEAN, facecolor="#bde6ed", zorder=0 + ) + ax.add_feature( + cartopy.feature.LAND, facecolor=[0.8, 0.8, 0.8] + ) # , zorder=0) + + ax.coastlines(linewidth=0.3, edgecolor="k") # '#778899' + ax.add_feature( + cfeature.BORDERS, linewidth=0.3, edgecolor="#778899" + ) + + # ax.add_feature(cartopy.feature.COASTLINE) + # ax.add_feature(cartopy.feature.BORDERS) + + if logNorm: + from matplotlib.colors import LogNorm # type: ignore + + plotargs["norm"] = LogNorm( + vmin=plotargs["vmin"], vmax=plotargs["vmax"] + ) + + if data is not None: + p = data.plot( + transform=ccrs.PlateCarree(), + ax=ax, + add_colorbar=cbar, + **plotargs, + ) + + if grid: + import matplotlib.ticker as mticker # type: ignore + from cartopy.mpl.gridliner import ( + LATITUDE_FORMATTER, + LONGITUDE_FORMATTER, + ) + + gl = ax.gridlines( + crs=crs, + draw_labels=True, + linewidth=1, + color="gray", + alpha=0.5, + linestyle="--", + ) + gl.xlabels_top = False + gl.ylabels_left = False + gl.xlines = False + gl.xlocator = mticker.FixedLocator([-180, -90, 0, 90, 180]) + gl.ylocator = mticker.FixedLocator( + [-90, -60, -30, 0, 30, 60, 90] + ) + gl.xformatter = LONGITUDE_FORMATTER + gl.yformatter = LATITUDE_FORMATTER + gl.xlabel_style = {"size": 15, "color": "gray"} + gl.xlabel_style = {"color": "black"} # , 'weight': 'bold'} + + return p + + if config.cool == 1: + vdd_c_in = xr.open_dataarray( + os.path.join( + output_path_vdd, suff + "_0_vdd_tmax_c_" + urt + ".nc" + ) + ).load() + vdd_c_year = vdd_c_in.sum(dim="month") + E_c_ac_in = xr.open_dataarray( + os.path.join(output_path_vdd, suff + "_0_E_c_ac_" + urt + ".nc") + ).load() + (E_c_ac_in.sum(dim="month") * 0.2777778) # Yearly total in kWh/m2 + + if config.heat == 1: + vdd_h_in = xr.open_dataarray( + os.path.join(output_path_vdd, suff + "_0_vdd_h_" + urt + ".nc") + ).load() + vdd_h_year = vdd_h_in.sum(dim="month") + E_h_in = xr.open_dataarray( + os.path.join(output_path_vdd, suff + "_0_E_h_" + urt + ".nc") + ).load() + (E_h_in.sum(dim="month") * 0.2777778) # Yearly total in kWh/m2 + + cbloc = [ + 0.86, + 0.185, + 0.03, + 0.61, + ] # [0.3, 0.07, 0.4, cbh] #color bar location + cbor = "vertical" + + proj = ccrs.PlateCarree() + rows = 1 + fw = "bold" + tfs = 9 + cmap = "magma_r" + + # cb8 = plt.colorbar(im8, cax=cbaxes8, orientation=cbor, extend='max') + # cb8.ax.tick_params(labelsize=tfs-2) + # cbaxes8.text(-3,-0.12, u'people/km\u00b2', fontsize=10) + + poplog = False + + # Cooling Degree Days + if config.cool == 1: + vmin = 0 + vmax = 4000 + plotargs = {"cmap": cmap, "vmin": vmin, "vmax": vmax} + + dvar = eval("vdd_c_year") # / larea + # dvar = dvar[urt] + fig = plt.figure(figsize=(6, 4)) + ax8 = fig.add_subplot(rows, 1, 1, projection=proj) + im8 = make_map( + dvar.where(dvar > 0), + ax=ax8, + cbar=False, + grid=False, + logNorm=poplog, + plotargs=plotargs, + ) + plt.title("Cooling Degree Days", fontsize=tfs, fontweight=fw) + cbaxes8 = fig.add_axes(cbloc) + cb8 = plt.colorbar(im8, cax=cbaxes8, orientation=cbor) + cb8.ax.tick_params(labelsize=tfs - 2) + + # cbaxes8.text(-3,-0.12, u'VDD/year', fontsize=10) + plt.tight_layout() + fig.subplots_adjust( + left=0.05, right=0.85, top=0.95, bottom=0.03 + ) # subplot margins + plt.savefig( + os.path.join( + output_path_vdd, + suff + "_VDD_c_" + cmap + str(poplog) + ".png", + ), + dpi=300, + bbox_inches="tight", + ) + + # Heating Degree Days + if config.heat == 1: + vmin = 0 + vmax = 10000 + plotargs = {"cmap": cmap, "vmin": vmin, "vmax": vmax} + + dvar = eval("vdd_h_year") # / larea + # dvar = dvar[urt] + fig = plt.figure(figsize=(6, 4)) + ax8 = fig.add_subplot(rows, 1, 1, projection=proj) + im8 = make_map( + dvar.where(dvar > 0), + ax=ax8, + cbar=False, + grid=False, + logNorm=poplog, + plotargs=plotargs, + ) + plt.title("Heating Degree Days", fontsize=tfs, fontweight=fw) + cbaxes8 = fig.add_axes(cbloc) + cb8 = plt.colorbar(im8, cax=cbaxes8, orientation=cbor) + cb8.ax.tick_params(labelsize=tfs - 2) + + # cbaxes8.text(-3,-0.12, u'VDD/year', fontsize=10) + plt.tight_layout() + fig.subplots_adjust( + left=0.05, right=0.85, top=0.95, bottom=0.03 + ) # subplot margins + plt.savefig( + os.path.join( + output_path_vdd, + suff + "_VDD_h_" + cmap + str(poplog) + ".png", + ), + dpi=300, + bbox_inches="tight", + ) + + # Energy demand - Heating [kWh/m2] + if config.heat == 1: + vmin = 0 + vmax = 300 + plotargs = {"cmap": cmap, "vmin": vmin, "vmax": vmax} + + dvar = eval("E_h_year") # / larea + # dvar = dvar[urt] + fig = plt.figure(figsize=(6, 4)) + ax8 = fig.add_subplot(rows, 1, 1, projection=proj) + im8 = make_map( + dvar.where(dvar > 0), + ax=ax8, + cbar=False, + grid=False, + logNorm=poplog, + plotargs=plotargs, + ) + plt.title("Energy demand - Heating", fontsize=tfs, fontweight=fw) + cbaxes8 = fig.add_axes(cbloc) + cb8 = plt.colorbar(im8, cax=cbaxes8, orientation=cbor) + cb8.ax.tick_params(labelsize=tfs - 2) + + # cbaxes8.text(-3,-0.12, u'VDD/year', fontsize=10) + plt.tight_layout() + fig.subplots_adjust( + left=0.05, right=0.85, top=0.95, bottom=0.03 + ) # subplot margins + plt.savefig( + os.path.join( + output_path_vdd, + suff + "_E_h_" + cmap + str(poplog) + ".png", + ), + dpi=300, + bbox_inches="tight", + ) + + # Energy demand - Cooling - AC only [kWh/m2] + if config.cool == 1: + vmin = 0 + vmax = 100 + plotargs = {"cmap": cmap, "vmin": vmin, "vmax": vmax} + + dvar = eval("vdd_c_year") # / larea + # dvar = dvar[urt] + fig = plt.figure(figsize=(6, 4)) + ax8 = fig.add_subplot(rows, 1, 1, projection=proj) + im8 = make_map( + dvar.where(dvar > 0), + ax=ax8, + cbar=False, + grid=False, + logNorm=poplog, + plotargs=plotargs, + ) + plt.title( + "Energy demand - Cooling (AC only)", fontsize=tfs, fontweight=fw + ) + cbaxes8 = fig.add_axes(cbloc) + cb8 = plt.colorbar(im8, cax=cbaxes8, orientation=cbor) + cb8.ax.tick_params(labelsize=tfs - 2) + + # cbaxes8.text(-3,-0.12, u'VDD/year', fontsize=10) + plt.tight_layout() + fig.subplots_adjust( + left=0.05, right=0.85, top=0.95, bottom=0.03 + ) # subplot margins + plt.savefig( + os.path.join( + output_path_vdd, + suff + "_E_c_ac_" + cmap + str(poplog) + ".png", + ), + dpi=300, + bbox_inches="tight", + ) + + +def process_construction_shares(config: "Config"): + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + floorarea_path = os.path.join(out_path, "floorarea_country") + + output_path = os.path.join( + floorarea_path, + config.gcm, + config.rcp, + ) + + if not os.path.exists(output_path): + os.makedirs(output_path) + + par_var = load_parametric_analysis_data(config) + + # get raster file and message map + ras, map_reg, iso_attrs = create_message_raster(config) + + # If constr_setting == 1, then process construction shares. Otherwise, skip + if config.constr_setting == 1: + input_path = config.dle_path + + dsc = xr.Dataset() + for urt in config.urts: + # Read in excel files + conshare = pd.read_csv( + os.path.join(input_path, "constr_share_" + urt + ".csv") + ) + tl = list(conshare.columns) + arcs = [s for s in tl if s[0] == urt[0]] + + # build dummy dataset + block = np.full((360, 720, 20), np.nan) + lats = ras.lat + lons = ras.lon + coords = {"lat": lats, "lon": lons, "arch": arcs} + ds = xr.DataArray(block, coords=coords, dims=["lat", "lon", "arch"]) + + for row in iso_attrs.itertuples(): + conshare.loc[conshare.ISO == row.ISO, "regnum"] = row.Index + + # missing AND, Andorra DMA, Dominica GRD,Grenada LIE, + # liechenstein ATG, Antigua & barbuda KNA, Saint kitts SYC seychelles + for arch in arcs: # For each arch + ai = arcs.index(arch) + ta = ds.sel(arch=arch).values + + for row in iso_attrs.itertuples(): # For each country + ats = conshare.loc[conshare.ISO == row.ISO, :] + + try: + ta[ras == int(row.Index)] = ats.loc[ + ats.ISO == row.ISO, arch + ].values[0] + except IndexError: + print("map:" + row.ISO) + ds.values[:, :, ai] = ta + + ds.attrs = { + "title": "Construction shares by archetype", + "urb_rur": urt, + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + } + ds = ds.to_dataset(name=urt) + comp = {"zlib": True} + encoding = {var: comp for var in ds.data_vars} + ds.to_netcdf( + os.path.join(output_path, "constr_share_" + urt + ".nc"), + encoding=encoding, + ) + dsc[urt] = ds[urt] + + dsc.attrs = { + "title": "Construction share by archetype", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + } + + encoding = {var: comp for var in dsc.data_vars} + dsc.to_netcdf( + os.path.join(output_path, "constr_share_urbanrural.nc"), encoding=encoding + ) + print("Completed construction share maps") + else: + print("Skipping construction share maps because constr_setting != 1") + + +def process_floor_area_maps(config: "Config"): + input_path = config.dle_path + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + save_path = os.path.join(out_path, "floorarea_country") + + output_path = os.path.join( + save_path, + config.gcm, + config.rcp, + ) + + if not os.path.exists(output_path): + os.makedirs(output_path) + + par_var = load_parametric_analysis_data(config) + ras, map_reg, iso_attrs = create_message_raster(config) + s_runs = load_all_scenarios_data(config) + + if config.floor_setting == "std_cap": + floorarea = pd.read_csv( + os.path.join(input_path, "floor_std_cap.csv") + ) # STD conditioned floor area (same for all regions, based on DLE) + + floormap = xr.Dataset( + { + "urban": map_reg.MESSAGE11.copy(deep=True), + "rural": map_reg.MESSAGE11.copy(deep=True), + } + ) + + for row in floorarea.itertuples(): + floormap["urban"].values[floormap.urban == row.RegNum] = float(row.urban) + floormap["rural"].values[floormap.rural == row.RegNum] = float(row.rural) + # floormap['urban'].values[floormap.urban==row.RegNum] = getattr(row,'urban'+suff) + # floormap['rural'].values[floormap.rural==row.RegNum] = getattr(row,'rural'+suff) + + floormap = floormap.astype(float) + for urt in config.urts: + floormap[urt].values[floormap[urt] == -1] = np.nan + + plt.figure() + floormap.urban.plot() + plt.figure() + floormap.rural.plot() + + # % Write out to netcdf + floormap.attrs = { + "title": "Floor area by region", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "floor_setting": config.floor_setting, + } + comp = {"zlib": True} + encoding = {var: comp for var in floormap.data_vars} + floormap.to_netcdf( + os.path.join(output_path, "floor_area_map_std_cap.nc"), encoding=encoding + ) + print("Completed floor area maps") + + elif config.floor_setting == "per_cap": + for s_run in s_runs.itertuples(): + suff = ( + str(s_run.scen) + "_" + str(s_run.year) + "_" + str(s_run.clim) + ) # suffix + suff2 = ( + str(s_run.scen) + "_" + str(s_run.year) + ) # suffix: only scen and year + + floorarea = pd.read_excel( + os.path.join(input_path, "floor_per_cap_" + config.vstrcntry + ".xlsx"), + sheet_name=suff2, + ) + + floormap = xr.Dataset( + { + "urban": map_reg.MESSAGE11.copy(deep=True), + "rural": map_reg.MESSAGE11.copy(deep=True), + } + ) + + for row in floorarea.itertuples(): + floormap["urban"].values[floormap.urban == row.RegNum] = float( + row.urban + ) + floormap["rural"].values[floormap.rural == row.RegNum] = float( + row.rural + ) + # floormap['urban'].values[floormap.urban==row.RegNum] = getattr(row,'urban'+suff) + # floormap['rural'].values[floormap.rural==row.RegNum] = getattr(row,'rural'+suff) + + floormap = floormap.astype(float) + for urt in config.urts: + floormap[urt].values[floormap[urt] == -1] = np.nan + + plt.figure() + floormap.urban.plot() + plt.figure() + floormap.rural.plot() + + # % Write out to netcdf + + floormap.attrs = { + "title": "Floor area by region", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "floor_setting": config.floor_setting, + } + comp = {"zlib": True} + encoding = {var: comp for var in floormap.data_vars} + floormap.to_netcdf( + os.path.join( + output_path, + "floor_area_map_" + config.floor_setting + "_" + suff + ".nc", + ), + encoding=encoding, + ) + + print("Completed floor area maps") + + else: + print("Skipping floor area maps because floor_setting != std_cap or per_cap") + + +def process_country_maps(config: "Config"): + input_path = config.dle_path + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + save_path = os.path.join(out_path, "floorarea_country") + + output_path = os.path.join( + save_path, + config.gcm, + config.rcp, + ) + + if not os.path.exists(output_path): + os.makedirs(output_path) + + par_var = load_parametric_analysis_data(config) + s_runs = load_all_scenarios_data(config) + ras, map_reg, iso_attrs = create_message_raster(config) + + for s_run in s_runs.itertuples(): + suff = str(s_run.scen) + "_" + str(s_run.year) + "_" + str(s_run.clim) # suffix + str(s_run.scen) + "_" + str(s_run.year) # suffix: only scen and year + + # Read in country_data for AC penetration, electricity access, slumpop + # country_data = pd.read_excel(input_folder+'country_data_'+vstrcntry+'.xlsx', sheet_name = 'suff2') + country_data = pd.read_excel( + os.path.join(input_path, "country_data_" + config.vstrcntry + ".xlsx"), + sheet_name="ssp2_2010", + ) # hack to use same sheet every time + + # Column names + # cols = ['AC_penetr','access_elec','slum_pop'] + cols = [ + "AC_penetr", + "AC_penetr_U", + "AC_penetr_R", + "access_elec", + "slum_pop", + "GLOBAL_SOUTH", + ] + # cols = ['AC_penetr'+suff,'AC_penetr_U'+suff,'AC_penetr_R'+suff,'access_elec'+suff,'slum_pop'+suff,'GLOBAL_SOUTH'] + + # Match the GAUL country numbers to the ISOs in country_data table (just in case) + iso_attrs["GAULi"] = iso_attrs.index.astype(float) + country_data = country_data.merge(iso_attrs, on="ISO", how="outer") + + # create dataset four country data + cd_map = xr.Dataset({cols[0]: ras.copy(deep=True).astype("float")}) + for col in cols[1:]: + cd_map[col] = ras.copy(deep=True).astype("float") + + # Populate the dataset with country data + for col in cols: + for idx in iso_attrs.GAULi: + cd_map[col].values[cd_map[col] == idx] = country_data.loc[ + country_data.GAULi == idx, col + ] + + plt.figure() + cd_map[col].plot() + plt.close() + + # Write out to netcdf + cd_map.attrs = { + "title": "Maps of country data", + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "variables": cols, + } + + comp = {"zlib": True, "complevel": 5} + encoding = {var: comp for var in cd_map.data_vars} + cd_map.to_netcdf( + os.path.join(output_path, "country_data_maps_" + suff + ".nc"), + encoding=encoding, + ) + + print("Finished country data maps") + + +def process_final_maps(config: "Config"): + input_path = config.dle_path + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + vdd_path = os.path.join( + out_path, + "VDD_ene_calcs", + config.gcm, + config.rcp, + ) + floorarea_path = os.path.join( + out_path, + "floorarea_country", + config.gcm, + config.rcp, + ) + finalmaps_path = os.path.join(out_path, "final_maps", config.gcm, config.rcp) + + if not os.path.exists(finalmaps_path): + os.makedirs(finalmaps_path) + + par_var = load_parametric_analysis_data(config) + s_runs = load_all_scenarios_data(config) + ras, map_reg, iso_attrs = create_message_raster(config) + + # country_maps_path = os.path.join( + # input_dle_path, + # f"output_data_{input_version_name}", + # input_gcm, + # input_rcp_scenario, + # "3_floorarea_country_data", + # ) + + # ene_calcs_path = os.path.join( + # input_dle_path, + # f"output_data_{input_version_name}", + # input_gcm, + # input_rcp_scenario, + # "2_VDD_ene_calcs", + # ) + + # final_maps_path = os.path.join( + # input_dle_path, + # f"output_data_{input_version_name}", + # input_gcm, + # input_rcp_scenario, + # "4_final_maps", + # ) + + vardic = {} + varundic = {} + + # Update dictionaries if config.cool == 1 + if config.cool == 1: + vardic.update(VARDICT_COOL) + varundic.update(VARUNDICT_COOL) + # Update dictionaries if config.heat == 1 + if config.heat == 1: + vardic.update(VARDICT_HEAT) + varundic.update(VARUNDICT_HEAT) + + [key for key in varundic.keys()] + + if ( + config.paranalysis_mode == 0 + ): # If running in ref mode, keep only the ref parameter set + par_var = par_var.loc[par_var.name_run == "ref", :] + + # TODO: (meas) the original code does not query for clims, + # but without it the code will crash if not all years have been run + clims_int = list(map(int, config.clims)) + print("Years of data available: " + str(clims_int)) + s_runs = s_runs.query("clim in @clims_int") + + for s_run in s_runs.itertuples(): + for arch in config.archs: + suff = ( + str(s_run.scen) + + "_" + + str(s_run.year) + + "_" + + str(s_run.clim) + + "_" + + arch + ) # suffix + suff1 = str(s_run.clim) + "_" + arch # suffix + if config.popfix is True: + suff2 = "ssp2_" + str(s_run.year) + else: + suff2 = ( + str(s_run.scen) + "_" + str(s_run.year) + ) # suffix: only scen and year + suff3 = ( + str(s_run.scen) + "_" + str(s_run.year) + "_" + str(s_run.clim) + ) # suffix: scen, year and arch + + print("Starting " + suff) + + # Load country data + country_data = xr.open_dataset( + os.path.join(floorarea_path, "country_data_maps_" + suff3 + ".nc") + ) + + # Load population data + popdata = xr.Dataset() + popdata["urban"] = xr.open_dataarray( + os.path.join( + input_path, "population", "population", suff2 + "_urban_hd.nc4" + ) + ) + popdata["rural"] = xr.open_dataarray( + os.path.join( + input_path, "population", "population", suff2 + "_rural_hd.nc4" + ) + ) + popdata["total"] = xr.open_dataarray( + os.path.join( + input_path, "population", "population", suff2 + "_total_hd.nc4" + ) + ) + + # Floor area data + if config.floor_setting == "std_cap": + floorarea = xr.open_dataset( + os.path.join( + floorarea_path, + "floor_area_map_" + config.floor_setting + ".nc", + ) + ) + elif config.floor_setting == "per_cap": + floorarea = xr.open_dataset( + os.path.join( + floorarea_path, + "floor_area_map_" + config.floor_setting + "_" + suff3 + ".nc", + ) + ) + + # Construction shares + # constr = xr.open_dataset(input_folder+'map_constr_floorarea\\constr_share_urbanrural.nc') + + # ============================================================================= + # First apply population weighting to energy demand: + # ============================================================================= + + for parset in par_var.itertuples(): + if config.cool == 1: + Nd1 = xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_NdALL.nc", + ) + ).load() # For calculation + # Nd = Nd.sum(dim=['arch','month'])/2 #<<< divide by 2 because 2 archetypes + Nd1 = ( + Nd1.sum(dim=["urt", "month"]) / 2 + ) # <<< divide by 2 (rural + urban) + + Ndr = xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_NdALL.nc", + ) + ).load() # For reporting + # Nd = Nd.sum(dim=['arch','month'])/2 #<<< divide by 2 because 2 archetypes + # Nd = Nd.sum(dim=['month']) #<<< divide by 2 (rural + urban) + + Nfr = xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_NfALL.nc", + ) + ).load() + # Nf = Nf.sum(dim=['arch','month'])/2 #<<< divide by 2 because 2 archetypes + # Nf = Nf.sum(dim=['month']) #<<< divide by 2 (rural + urban) + + E_c_ac = ( + xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_E_c_ac" + "ALL.nc", + ) + ).where(Nd1 >= config.nd_thresh) + ).load() + E_c_fan = ( + xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_E_c_fan" + "ALL.nc", + ) + ).where(Nd1 >= config.nd_thresh) + ).load() + E_c = E_c_ac + E_c_fan + vdd_c_in = xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_vdd_tmax_cALL.nc", + ) + ).load() + + if config.heat == 1: + E_h = ( + xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_E_h" + "ALL.nc", + ) + ).where(Nd1 >= 0) + ).load() # ****************************** + vdd_h_in = xr.open_dataarray( + os.path.join( + vdd_path, + suff1 + "_" + str(parset.Index) + "_vdd_hALL.nc", + ) + ).load() + # vdd_in = vdd_in.sum(dim='arch') + + # if (runsdd==1) and (parset.Index==0): + # for bal_temp in bal_temps: + # sdd_c_in = xr.open_dataarray(input_folder2+str(parset.Index)+'_s_cddALL.nc').load() + # sdd_h_in = xr.open_dataarray(input_folder2+str(parset.Index)+'_s_hddALL.nc').load() + # print(xkss) + + if config.cool == 1: + # Cooling outputs + E_c_perpix = ( + xr.Dataset() + ) # Pixel / person per gridsquare energy demand + E_c_ac_popwei = ( + xr.Dataset() + ) # Total Energy, population weighted, per pixel + E_c_fan_popwei = xr.Dataset() + E_c_popwei = xr.Dataset() + E_c_ac_wAccess = xr.Dataset() + E_c_ac_gap = xr.Dataset() + E_c_fan_wAccess = xr.Dataset() + E_c_fan_gap = xr.Dataset() + E_c_wAccess = xr.Dataset() + E_c_gap = xr.Dataset() + Nf = xr.Dataset() + Nd = xr.Dataset() + vdd_c_popwei = xr.Dataset() # Degree Days multiplied by population + # sdd_c = xr.Dataset() + + P_c_ac_potential = xr.Dataset() + P_c_ac_gap = xr.Dataset() + P_c_fan_gap = xr.Dataset() + P_c_fanNoAC = xr.Dataset() + + if config.heat == 1: + # Heating outputs + E_h_perpix = ( + xr.Dataset() + ) # Pixel / person per gridsquare energy demand + E_h_popwei = xr.Dataset() # population weighted (FULL demand) + + P_h_potential = xr.Dataset() + + vdd_h_popwei = xr.Dataset() # Degree Days multiplied by population + # sdd_h = xr.Dataset() + + # % Produce spatial results + for urt in config.urts: + if config.cool == 1: + if urt == "urban": + # at = au + acp = "AC_penetr_U" + elif urt == "rural": + # at = ar + acp = "AC_penetr_R" + + # print(sddddd) + E_c_perpix[urt] = ( + floorarea[urt] * E_c["urt" == urt] + ) # energy per person per pixel + E_c_ac_popwei[urt] = ( + popdata[urt] * floorarea[urt] * E_c_ac["urt" == urt] + ) # Total Energy, population weighted, per pixel + E_c_fan_popwei[urt] = ( + popdata[urt] * floorarea[urt] * E_c_fan["urt" == urt] + ) # Total Energy, population weighted, per pixel + E_c_popwei[urt] = ( + popdata[urt] * E_c_perpix[urt] + ) # Total Energy, population weighted, per pixel + # E_c_pwpercap = E_c_popwei[urt] / popdata[urt] + + E_c_ac_wAccess[urt] = ( + E_c_ac_popwei[urt] * country_data[acp] + ) # AC energy incl AC penetre + E_c_ac_gap[urt] = E_c_ac_popwei[urt] * ( + 1 - country_data[acp] + ) # AC energy gap + + E_c_fan_wAccess[urt] = ( + E_c_fan_popwei[urt] * country_data["access_elec"] + ) # Fan energy incl elec access + E_c_fan_gap[urt] = E_c_fan_popwei[urt] * ( + 1 - country_data["access_elec"] + ) # Fan energy gap + + E_c_wAccess[urt] = ( + E_c_ac_wAccess[urt] + E_c_fan_wAccess[urt] + ) # << Current energy usage + E_c_gap[urt] = ( + E_c_ac_gap[urt] + E_c_fan_gap[urt] + ) # Total energy gap + + Nd[urt] = Ndr[ + "urt" == urt + ] # .sum(dim='month') # summed later over months + Nf[urt] = Nfr["urt" == urt] + + vdd_c_popwei[urt] = ( + popdata[urt] * vdd_c_in["urt" == urt] + ) # Degree Days multiplied by population + # if (runsdd==1) and (parset.Index==0): + # sdd_c[urt] = sdd_c_in # popdata[urt] * + + # Population that needs access to AC (AC market) + P_c_ac_potential[urt] = popdata[urt].where( + E_c_ac["urt" == urt].sum(dim="month") > 0 + ) + # Population (unsatisfied) that needs access to AC + P_c_ac_gap[urt] = popdata[urt].where( + E_c_ac["urt" == urt].sum(dim="month") > 0 + ) * (1 - country_data[acp]) + P_c_fan_gap[urt] = popdata[urt].where( + E_c_fan["urt" == urt].sum(dim="month") > 0 + ) * (1 - country_data["access_elec"]) + P_c_fanNoAC[urt] = P_c_ac_gap[urt] - P_c_fan_gap[urt] + + if config.heat == 1: + # Heating results + E_h_perpix[urt] = ( + floorarea[urt] * E_h["urt" == urt] + ) # energy per person per pixel + E_h_popwei[urt] = ( + popdata[urt] * floorarea[urt] * E_h["urt" == urt] + ) # Total Energy, population weighted, per pixel + + P_h_potential[urt] = popdata[urt].where( + E_h["urt" == urt].sum(dim="month") > 0 + ) # Population that needs access to heating + + vdd_h_popwei[urt] = ( + popdata[urt] * vdd_h_in["urt" == urt] + ) # Degree Days multiplied by population + # if (runsdd==1) and (parset.Index==0): + # sdd_h[urt] = sdd_h_in # popdata[urt] * + + for var in vardic.keys(): + # if (runsdd==1) and (var=='sdd_c' or var =='sdd_h') and (parset.Index>0): + # print('do nothing') + # else: + ds = eval(var) + # ds['arch'] = al + ds["urt"] = config.urts + ds.attrs = { + "title": var, + "description": vardic[var], + "units": varundic[var], + "authors": "Edward Byers & Alessio Mastrucci", + "date": str(datetime.datetime.now()), + "institution": "IIASA Energy Program", + "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", + "name_run": parset.name_run, + "id_run": str(parset.Index), + } + + # if (runsdd==1) and (var=='sdd_c' or var=='sdd_h'): + # ds.attrs['bal_temps'] = str(bal_temps) + # else: + # ds.attrs['archetypes'] = al + + encoding = {vari: config.comp for vari in ds.data_vars} + fname = suff + "_" + str(parset.Index) + "_" + var + ".nc" + filestr = os.path.join(finalmaps_path, fname) + ds.to_netcdf(filestr, encoding=encoding) + + if varundic[var][-5:] == "month": + dsy = ds.sum(dim="month") + for urt in config.urts: + # if (runsdd==1) and (var == 'sdd_c' or var=='sdd_h'): + # dsy[urt] = (['bal_temp', 'lat','lon',], dsy[urt].values) #.sum(dim='arch') + # else: + dsy[urt] = ( + ["lat", "lon"], + dsy[urt].values, + ) # .sum(dim='arch') + + dsy.attrs = ds.attrs + dsy.attrs["units"] = varundic[var][:-5] + "year" + encoding = {vari: config.comp for vari in dsy.data_vars} + fname = suff + "_" + str(parset.Index) + "_" + var + "_year.nc" + filestr = os.path.join(finalmaps_path, fname) + dsy.to_netcdf(filestr, encoding=encoding) + + +def process_iso_tables(config: "Config"): + start = datetime.datetime.now() + + input_path = config.dle_path + out_path = os.path.join(config.project_path, "out", "version", config.vstr) + vdd_path = os.path.join(out_path, "VDD_ene_calcs", config.gcm, config.rcp) + floorarea_path = os.path.join(out_path, "floorarea_country", config.gcm, config.rcp) + finalmaps_path = os.path.join(out_path, "final_maps", config.gcm, config.rcp) + iso_path = os.path.join(out_path, "iso_tables", config.gcm, config.rcp) + + if not os.path.exists(iso_path): + os.makedirs(iso_path) + + par_var = load_parametric_analysis_data(config) + s_runs = load_all_scenarios_data(config) + ras, map_reg, iso_attrs = create_message_raster(config) + + updated_urts = config.urts + ["total"] + + # final_maps_path = os.path.join( + # input_dle_path, + # f"output_data_{input_version_name}", + # input_gcm, + # input_rcp_scenario, + # "4_final_maps", + # ) + + # iso_tables_path = os.path.join( + # input_dle_path, + # f"output_data_{input_version_name}", + # input_gcm, + # input_rcp_scenario, + # "5_ISO_tables", + # ) + + vardic = {} + varundic = {} + + # Update dictionaries if config.cool == 1 + if config.cool == 1: + vardic.update(VARDICT_COOL) + varundic.update(VARUNDICT_COOL) + # Update dictionaries if config.heat == 1 + if config.heat == 1: + vardic.update(VARDICT_HEAT) + varundic.update(VARUNDICT_HEAT) + + varlist_cool = [key for key in VARDICT_COOL.keys()] + varlist_heat = [key for key in VARDICT_HEAT.keys()] + + # TODO: (meas) the original code does not query for clims, + # but without it the code will crash if not all years have been run + clims_int = list(map(int, config.clims)) + print("Years of data available: " + str(clims_int)) + s_runs = s_runs.query("clim in @clims_int") + + # Read raster data + raster = xr.open_dataarray(os.path.join(input_path, "gaul_lvl0_hybrid_05_3.nc")) + + # Read country data + dfd = pd.read_csv( + os.path.join(input_path, "gaul_lvl0_raster0.5.csv"), index_col="ID" + ).assign(ISONUM=lambda x: x.index) + + # Import MESSAGE regions and North/South classification + msgNS = pd.read_excel( + os.path.join(input_path, "country_data_" + config.vstrcntry + ".xlsx"), + sheet_name="ssp2_2010", + ) + + # Add 'GLOBAL_SOUTH' and 'REGION_GEA' to dfd + dfd = dfd.merge( + msgNS.reindex(columns=["ISO", "GLOBAL_SOUTH", "REGION_GEA"]), + left_on="ISO3", + right_on="ISO", + ).set_index("ISONUM") + + # Load population data + print("Opening population data....") + l_popdata = [] + for s_run in s_runs.itertuples(): + suff = str(s_run.scen) + "_" + str(s_run.year) + print(suff) + + popdata = xr.Dataset() + for urt in updated_urts: + popdata[urt] = xr.open_dataarray( + os.path.join( + input_path, + "population", + "population", + suff + "_" + urt + "_hd.nc4", + ) + ) + + agg_popdata = ( + popdata.groupby(raster) + .sum() + .to_dataframe() + .reset_index() + .melt(id_vars="gaul_lvl0", var_name="urt", value_name="popsum") + .assign(population_scenario=s_run.scen, year=s_run.year) + ) + + l_popdata.append(agg_popdata) + + pop_agg = ( + pd.concat(l_popdata) + .reset_index(drop=True) + .assign(year=lambda x: x.year.astype(int)) + ) + + # map s_runs, archs, updated_urts, and par_var to a tuple + # then map the tuple to the process_data function + # then convert the map object to a list + inputs_cool = product( + s_runs.itertuples(), + config.archs, + updated_urts, + par_var.itertuples(), + varlist_cool, + ) + inputs_heat = product( + s_runs.itertuples(), + config.archs, + updated_urts, + par_var.itertuples(), + varlist_heat, + ) + + def aggregate_ncfile(args: tuple) -> xr.Dataset: + s_run, arch, urt, parset, varname = args + str_varname = str(varname) + + print( + f"Opening {varname} data for: {s_run.scen}_{s_run.year}_{s_run.clim}_{arch}_{urt}_{parset.Index}" + ) + suff = ( + str(s_run.scen) + "_" + str(s_run.year) + "_" + str(s_run.clim) + "_" + arch + ) + + # if urt is "urban" or "rural" then load the data from the file + # otherwise if urt is "total" then add the data from the "urban" and "rural" files + if (urt == "urban") or (urt == "rural"): + varname = xr.open_dataset( + os.path.join( + finalmaps_path, + suff + "_" + str(parset.Index) + "_" + varname + ".nc", + ) + )[urt] + + elif urt == "total": + varname = ( + xr.open_dataset( + os.path.join( + finalmaps_path, + suff + "_" + str(parset.Index) + "_" + varname + ".nc", + ) + )["urban"] + + xr.open_dataset( + os.path.join( + finalmaps_path, + suff + "_" + str(parset.Index) + "_" + varname + ".nc", + ) + )["rural"] + ) + + # If varname is Nd or Nf, then take the mean. Otherwise, take the sum + if str_varname in ["Nd", "Nf"]: + # Group varname by raster index and take the mean + print("...Aggregating data by raster") + agg_ras_month = ( + varname.groupby(raster).mean().to_dataframe(name="value").reset_index() + ) + + # Group by gaul_lvl0 and take the mean + print(".....Aggregating data by gaul_lvl0") + agg_gaul_lvl0 = ( + agg_ras_month.groupby("gaul_lvl0")["value"] + .agg(lambda x: x.mean() / 2) + .reset_index() + ) + else: + # Group varname by raster index and sum + print("...Aggregating data by raster") + agg_ras_month = ( + varname.groupby(raster).sum().to_dataframe(name="value").reset_index() + ) + + # Group by gaul_lvl0 and sum + print(".....Aggregating data by gaul_lvl0") + agg_gaul_lvl0 = ( + agg_ras_month.groupby("gaul_lvl0")["value"].sum().reset_index() + ) + + # Add columns for: + # - s_run.scen + # - s_run.year + # - s_run.clim + # - arch + # - urt + # - varname + df = agg_gaul_lvl0.assign( + gcm=str(config.gcm), + scenario=str(config.rcp), + scen=str(s_run.scen), + year=str(s_run.year), + clim=str(s_run.clim), + arch=str(arch), + urt=str(urt), + par_var=str(parset.Index), + name_run=str(parset.name_run), + varname=str_varname, + ) + + return df + + if config.cool == 1: + list_cool = list(map(aggregate_ncfile, inputs_cool)) + df_agg = ( + pd.concat(list_cool) + .reset_index(drop=True) + .merge(dfd, left_on="gaul_lvl0", right_on="ISONUM") + ) + if config.heat == 1: + list_heat = list(map(aggregate_ncfile, inputs_heat)) + df_heat = ( + pd.concat(list_heat) + .reset_index(drop=True) + .merge(dfd, left_on="gaul_lvl0", right_on="ISONUM") + ) + # Add df_heat to df_agg + df_agg = df_agg.append(df_heat, ignore_index=True) + + print("Completed aggregating raster data! Now processing and saving...") + + # Merge df_agg with pop_agg + df_agg = df_agg.assign(year=lambda x: x.year.astype(int)).merge( + pop_agg, + left_on=["gaul_lvl0", "urt", "year"], + right_on=["gaul_lvl0", "urt", "year"], + ) + + # Convert from long to wide on varname + df_agg_wide = df_agg.pivot_table( + index=[ + "gaul_lvl0", + "ADM0_CODE", + "ADM0_NAME", + "CONTINENT", + "FAO_CODE", + "ISO3", + "UN_CODE", + "UN_REGION", + "ISO", + "GLOBAL_SOUTH", + "REGION_GEA", + "gcm", + "scenario", + "scen", + "population_scenario", + "year", + "clim", + "arch", + "urt", + "par_var", + "name_run", + "popsum", + ], + columns="varname", + values="value", + ).reset_index() + + # Calculate population-averaged degree days + if config.cool == 1: + df_agg_wide = df_agg_wide.assign(vdd_c_avg=lambda x: x.vdd_c_popwei / x.popsum) + if config.heat == 1: + df_agg_wide = df_agg_wide.assign(vdd_h_avg=lambda x: x.vdd_h_popwei / x.popsum) + + # Drop and rename columns + df_agg_wide = df_agg_wide.drop( + columns=["ADM0_CODE", "CONTINENT", "FAO_CODE", "ISO3", "UN_CODE", "UN_REGION"] + ).rename(columns={"gaul_lvl0": "id", "ADM0_NAME": "NAME"}) + + # Save to excel and csv + df_agg_wide.to_excel( + os.path.join( + iso_path, + "ISO_agg_data_" + config.vstr + ".xlsx", + ) + ) + df_agg_wide.to_csv( + os.path.join( + iso_path, + "ISO_agg_data_" + config.vstr + ".csv", + ), + index=False, + ) + + end = datetime.datetime.now() + print( + "Done! Total time to aggregate variables and process ISO tables: " + + str(end - start) + ) + + def create_climate_outputs(config: "Config", start_time: datetime.datetime): out_path = os.path.join(config.project_path, "out", "version", config.vstr) archetype_path = os.path.join(out_path, "rasters") diff --git a/message_ix_buildings/chilled/run_scratch.py b/message_ix_buildings/chilled/run_scratch.py new file mode 100644 index 0000000..52b1b16 --- /dev/null +++ b/message_ix_buildings/chilled/run_scratch.py @@ -0,0 +1,106 @@ +import datetime +import sys +from argparse import ArgumentParser + +from main.climate import ( + aggregate_urban_rural_files, + make_vdd_total_maps, + process_construction_shares, + process_country_maps, + process_final_maps, + process_floor_area_maps, + process_iso_tables, +) +from utils.config import Config # type: ignore + + +def parse_arguments(arguments): + """ + + :return: + """ + parser = ArgumentParser(add_help=True) + + parser.add_argument( + "-version", + "--version", + default="ALPS2023", + help="Version of inputs to run. Default: ALPS2023.", + ) + parser.add_argument( + "-gcm", + "--gcm", + default="GFDL-ESM4", + help="GCM to run. Options: GFDL-ESM4, IPSL-CM6A-LR, MPI-ESM1-2-HR, MRI-ESM2-0, UKESM1-0-LL. Default: GFDL-ESM4.", + ) + parser.add_argument( + "-rcp", + "--rcp", + default="baseline", + help="RCP to run. Options: ssp126, ssp370, ssp585, baseline. Default: baseline.", + ) + + # Parse arguments + parsed_arguments = parser.parse_known_args(args=arguments)[0] + + return parsed_arguments + + +def print_arguments(parsed_arguments): + """ + :param parsed_arguments: + + """ + + # Print arguments + print("---------- Parsed arguments ------------") + print("Selected version: " + parsed_arguments.version) + print("Selected GCM: " + parsed_arguments.gcm) + print("Selected RCP scenario: " + parsed_arguments.rcp) + + +def create_config(parsed_arguments): + cfg = Config( + vstr=parsed_arguments.version, + gcm=parsed_arguments.gcm, + rcp=parsed_arguments.rcp, + ) + + return cfg + + +def main(args=None): + if args is None: + args = sys.argv[1:] + + parsed_args = parse_arguments(arguments=args) + + # Run the main function + start = datetime.datetime.now() + print_arguments(parsed_arguments=parsed_args) + cfg = create_config(parsed_arguments=parsed_args) + + print("RUNNING aggregate_urban_rural_files()........") + aggregate_urban_rural_files(cfg) + + print("RUNNING make_vdd_total_maps()........") + make_vdd_total_maps(cfg) + + print("RUNNING process_construction_shares()........") + process_construction_shares(cfg) + + print("RUNNING process_floor_area_maps()........") + process_floor_area_maps(cfg) + + print("RUNNING process_country_maps()........") + process_country_maps(cfg) + + print("RUNNING process_final_maps()........") + process_final_maps(cfg) + + print("RUNNING process_iso_tables()........") + process_iso_tables(cfg) + + +if __name__ == "__main__": + main() From 7572964623eded752dc6a00475fe58c8c798e0e9 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:28:17 +0200 Subject: [PATCH 055/114] Fix using raster instead of map --- message_ix_buildings/chilled/main/climate.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 38212ae..5b7e089 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -14,12 +14,6 @@ from functions.buildings_funcs_grid import ( P_f, Q_c_tmax, - calc_gn_sol_tot, - calc_H_tr, - calc_H_v_cl, - calc_H_v_op, - calc_Nd, - calc_Nf, calc_SCDD_m, calc_SHDD_m, calc_t_bal_c, @@ -1229,8 +1223,8 @@ def process_floor_area_maps(config: "Config"): floormap = xr.Dataset( { - "urban": map_reg.MESSAGE11.copy(deep=True), - "rural": map_reg.MESSAGE11.copy(deep=True), + "urban": ras.MESSAGE11.copy(deep=True), + "rural": ras.MESSAGE11.copy(deep=True), } ) @@ -1281,8 +1275,8 @@ def process_floor_area_maps(config: "Config"): floormap = xr.Dataset( { - "urban": map_reg.MESSAGE11.copy(deep=True), - "rural": map_reg.MESSAGE11.copy(deep=True), + "urban": ras.MESSAGE11.copy(deep=True), + "rural": ras.MESSAGE11.copy(deep=True), } ) From 6646bca8216ab385cd4dd59109c69f32ae264eca Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:28:23 +0200 Subject: [PATCH 056/114] Rename file --- message_ix_buildings/chilled/{run_scratch.py => run_agg.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename message_ix_buildings/chilled/{run_scratch.py => run_agg.py} (100%) diff --git a/message_ix_buildings/chilled/run_scratch.py b/message_ix_buildings/chilled/run_agg.py similarity index 100% rename from message_ix_buildings/chilled/run_scratch.py rename to message_ix_buildings/chilled/run_agg.py From 9b5c5480d3317ac14bd818ac5c6d1fcbe88a5e9b Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:39:53 +0200 Subject: [PATCH 057/114] Change output of `create_message_raster()` --- message_ix_buildings/chilled/main/climate.py | 41 ++++++++++++------- .../chilled/preprocess/archetypes.py | 6 +-- .../chilled/preprocess/message_raster.py | 4 ++ 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 5b7e089..dda0964 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -10,10 +10,21 @@ import pandas as pd # type: ignore import xarray as xr from dask.diagnostics import ProgressBar -from functions.buildings_funcs_grid import Q_h # type: ignore from functions.buildings_funcs_grid import ( P_f, Q_c_tmax, + Q_h, + calc_E_c_ac, + calc_E_c_fan, + calc_E_h, + calc_gn_sol, + calc_gn_sol_h, + calc_gn_sol_tot, + calc_H_tr, + calc_H_v_cl, + calc_H_v_op, + calc_Nd, + calc_Nf, calc_SCDD_m, calc_SHDD_m, calc_t_bal_c, @@ -1122,7 +1133,7 @@ def process_construction_shares(config: "Config"): par_var = load_parametric_analysis_data(config) # get raster file and message map - ras, map_reg, iso_attrs = create_message_raster(config) + country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) # If constr_setting == 1, then process construction shares. Otherwise, skip if config.constr_setting == 1: @@ -1139,8 +1150,8 @@ def process_construction_shares(config: "Config"): # build dummy dataset block = np.full((360, 720, 20), np.nan) - lats = ras.lat - lons = ras.lon + lats = country_ras.lat + lons = country_ras.lon coords = {"lat": lats, "lon": lons, "arch": arcs} ds = xr.DataArray(block, coords=coords, dims=["lat", "lon", "arch"]) @@ -1157,7 +1168,7 @@ def process_construction_shares(config: "Config"): ats = conshare.loc[conshare.ISO == row.ISO, :] try: - ta[ras == int(row.Index)] = ats.loc[ + ta[country_ras == int(row.Index)] = ats.loc[ ats.ISO == row.ISO, arch ].values[0] except IndexError: @@ -1213,7 +1224,7 @@ def process_floor_area_maps(config: "Config"): os.makedirs(output_path) par_var = load_parametric_analysis_data(config) - ras, map_reg, iso_attrs = create_message_raster(config) + country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) s_runs = load_all_scenarios_data(config) if config.floor_setting == "std_cap": @@ -1223,8 +1234,8 @@ def process_floor_area_maps(config: "Config"): floormap = xr.Dataset( { - "urban": ras.MESSAGE11.copy(deep=True), - "rural": ras.MESSAGE11.copy(deep=True), + "urban": reg_ras.MESSAGE11.copy(deep=True), + "rural": reg_ras.MESSAGE11.copy(deep=True), } ) @@ -1275,8 +1286,8 @@ def process_floor_area_maps(config: "Config"): floormap = xr.Dataset( { - "urban": ras.MESSAGE11.copy(deep=True), - "rural": ras.MESSAGE11.copy(deep=True), + "urban": reg_ras.MESSAGE11.copy(deep=True), + "rural": reg_ras.MESSAGE11.copy(deep=True), } ) @@ -1341,7 +1352,7 @@ def process_country_maps(config: "Config"): par_var = load_parametric_analysis_data(config) s_runs = load_all_scenarios_data(config) - ras, map_reg, iso_attrs = create_message_raster(config) + country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) for s_run in s_runs.itertuples(): suff = str(s_run.scen) + "_" + str(s_run.year) + "_" + str(s_run.clim) # suffix @@ -1371,9 +1382,9 @@ def process_country_maps(config: "Config"): country_data = country_data.merge(iso_attrs, on="ISO", how="outer") # create dataset four country data - cd_map = xr.Dataset({cols[0]: ras.copy(deep=True).astype("float")}) + cd_map = xr.Dataset({cols[0]: country_ras.copy(deep=True).astype("float")}) for col in cols[1:]: - cd_map[col] = ras.copy(deep=True).astype("float") + cd_map[col] = country_ras.copy(deep=True).astype("float") # Populate the dataset with country data for col in cols: @@ -1428,7 +1439,7 @@ def process_final_maps(config: "Config"): par_var = load_parametric_analysis_data(config) s_runs = load_all_scenarios_data(config) - ras, map_reg, iso_attrs = create_message_raster(config) + # country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) # country_maps_path = os.path.join( # input_dle_path, @@ -1817,7 +1828,7 @@ def process_iso_tables(config: "Config"): par_var = load_parametric_analysis_data(config) s_runs = load_all_scenarios_data(config) - ras, map_reg, iso_attrs = create_message_raster(config) + # ras, map_reg, iso_attrs = create_message_raster(config) updated_urts = config.urts + ["total"] diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index b22727c..f151ea9 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -23,7 +23,7 @@ def create_archetypes(config: "Config"): os.makedirs(archetype_path) # get raster file and message map - ras, map_reg, iso_attrs = create_message_raster(config) + country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) # save MESSAGE regions map msg_file = "map_reg_MESSAGE_" + config.node + ".nc" @@ -42,8 +42,8 @@ def create_archetypes(config: "Config"): # Create map of archetypes based on MESSAGE regions raster arch_map = xr.Dataset( { - "urban": ras.MESSAGE11.copy(deep=True), - "rural": ras.MESSAGE11.copy(deep=True), + "urban": reg_ras.MESSAGE11.copy(deep=True), + "rural": reg_ras.MESSAGE11.copy(deep=True), } ) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 47013dd..c585e7e 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -5,6 +5,7 @@ import datetime import os +import numpy as np import pandas as pd # type: ignore import xarray as xr # type: ignore from utils.config import Config # type: ignore @@ -24,6 +25,9 @@ def create_message_raster(config: "Config"): os.path.join(input_path, "gaul_lvl0_hybrid_05_3.nc") ) + country_ras.values = country_ras.values.astype(float) + country_ras.values[country_ras == -1] = np.nan + iso_attrs = pd.DataFrame([country_ras.attrs]).T.rename(columns={0: "ISO"}) # Region raster From 6622aedff870c22d98bb8d8f0e92d0dd7dea8947 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:42:03 +0200 Subject: [PATCH 058/114] Output `country_ras` in `create_message_raster()` --- message_ix_buildings/chilled/preprocess/message_raster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index c585e7e..fe28f71 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -107,7 +107,7 @@ def create_message_raster(config: "Config"): # + os.path.join(output_path, filename) # ) - return reg_ras, map_reg, iso_attrs + return country_ras, reg_ras, map_reg, iso_attrs else: print("Only R11 is supported at the moment.") From 1db3422571a795bd97bc2d704fa733e158b6fc3a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:48:42 +0200 Subject: [PATCH 059/114] Add comments for debugging --- message_ix_buildings/chilled/main/climate.py | 1 + message_ix_buildings/chilled/run_agg.py | 34 ++++++++------------ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index dda0964..1322656 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -754,6 +754,7 @@ def aggregate_urban_rural_files(config: "Config"): ) par_var = load_parametric_analysis_data(config) + print(par_var) if not os.path.exists(output_path_vdd): os.makedirs(output_path_vdd) diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index 52b1b16..6158fbd 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -2,15 +2,7 @@ import sys from argparse import ArgumentParser -from main.climate import ( - aggregate_urban_rural_files, - make_vdd_total_maps, - process_construction_shares, - process_country_maps, - process_final_maps, - process_floor_area_maps, - process_iso_tables, -) +from main.climate import aggregate_urban_rural_files from utils.config import Config # type: ignore @@ -83,23 +75,23 @@ def main(args=None): print("RUNNING aggregate_urban_rural_files()........") aggregate_urban_rural_files(cfg) - print("RUNNING make_vdd_total_maps()........") - make_vdd_total_maps(cfg) + # print("RUNNING make_vdd_total_maps()........") + # make_vdd_total_maps(cfg) - print("RUNNING process_construction_shares()........") - process_construction_shares(cfg) + # print("RUNNING process_construction_shares()........") + # process_construction_shares(cfg) - print("RUNNING process_floor_area_maps()........") - process_floor_area_maps(cfg) + # print("RUNNING process_floor_area_maps()........") + # process_floor_area_maps(cfg) - print("RUNNING process_country_maps()........") - process_country_maps(cfg) + # print("RUNNING process_country_maps()........") + # process_country_maps(cfg) - print("RUNNING process_final_maps()........") - process_final_maps(cfg) + # print("RUNNING process_final_maps()........") + # process_final_maps(cfg) - print("RUNNING process_iso_tables()........") - process_iso_tables(cfg) + # print("RUNNING process_iso_tables()........") + # process_iso_tables(cfg) if __name__ == "__main__": From b3bc7108a1e3d19581f0b5c58920d1f4722a6f2b Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:51:43 +0200 Subject: [PATCH 060/114] Fix typo using `config.archs` instead of `config.cool` --- message_ix_buildings/chilled/main/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 1322656..9df0eff 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -767,7 +767,7 @@ def aggregate_urban_rural_files(config: "Config"): # Aggregate archetypes into same files. varlist = [] - if config.archs == 1: + if config.cool == 1: varlist.extend( [ "t_bal_c", From 69fd95fee0b22e3cc8e30754db4aada73dbc1323 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:53:11 +0200 Subject: [PATCH 061/114] Remove print line --- message_ix_buildings/chilled/main/climate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 9df0eff..20a3075 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -754,7 +754,6 @@ def aggregate_urban_rural_files(config: "Config"): ) par_var = load_parametric_analysis_data(config) - print(par_var) if not os.path.exists(output_path_vdd): os.makedirs(output_path_vdd) @@ -788,7 +787,7 @@ def aggregate_urban_rural_files(config: "Config"): for parset in par_var.itertuples(): for var in varlist: - print(var) + print("." + var) mds = xr.open_mfdataset( os.path.join( output_path_vdd, From eb2731c405d3a811203b44e3849c92adb6e381a0 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 05:53:42 +0200 Subject: [PATCH 062/114] Uncomment other functions --- message_ix_buildings/chilled/run_agg.py | 34 +++++++++++++++---------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index 6158fbd..52b1b16 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -2,7 +2,15 @@ import sys from argparse import ArgumentParser -from main.climate import aggregate_urban_rural_files +from main.climate import ( + aggregate_urban_rural_files, + make_vdd_total_maps, + process_construction_shares, + process_country_maps, + process_final_maps, + process_floor_area_maps, + process_iso_tables, +) from utils.config import Config # type: ignore @@ -75,23 +83,23 @@ def main(args=None): print("RUNNING aggregate_urban_rural_files()........") aggregate_urban_rural_files(cfg) - # print("RUNNING make_vdd_total_maps()........") - # make_vdd_total_maps(cfg) + print("RUNNING make_vdd_total_maps()........") + make_vdd_total_maps(cfg) - # print("RUNNING process_construction_shares()........") - # process_construction_shares(cfg) + print("RUNNING process_construction_shares()........") + process_construction_shares(cfg) - # print("RUNNING process_floor_area_maps()........") - # process_floor_area_maps(cfg) + print("RUNNING process_floor_area_maps()........") + process_floor_area_maps(cfg) - # print("RUNNING process_country_maps()........") - # process_country_maps(cfg) + print("RUNNING process_country_maps()........") + process_country_maps(cfg) - # print("RUNNING process_final_maps()........") - # process_final_maps(cfg) + print("RUNNING process_final_maps()........") + process_final_maps(cfg) - # print("RUNNING process_iso_tables()........") - # process_iso_tables(cfg) + print("RUNNING process_iso_tables()........") + process_iso_tables(cfg) if __name__ == "__main__": From 1b486c0b6d9a4ebd223feed9d4dcfe879caecf8a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:16:39 +0200 Subject: [PATCH 063/114] Add data files for dle_coolssp version --- .../version/dle_coolssp/arch_input_reg.xlsx | Bin 0 -> 23116 bytes .../version/dle_coolssp/arch_regions.xlsx | Bin 0 -> 22902 bytes .../chilled/version/dle_coolssp/par_var.csv | 3 +++ .../data/chilled/version/dle_coolssp/runs.csv | 11 +++++++++++ 4 files changed, 14 insertions(+) create mode 100644 message_ix_buildings/data/chilled/version/dle_coolssp/arch_input_reg.xlsx create mode 100644 message_ix_buildings/data/chilled/version/dle_coolssp/arch_regions.xlsx create mode 100755 message_ix_buildings/data/chilled/version/dle_coolssp/par_var.csv create mode 100755 message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv diff --git a/message_ix_buildings/data/chilled/version/dle_coolssp/arch_input_reg.xlsx b/message_ix_buildings/data/chilled/version/dle_coolssp/arch_input_reg.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..69dcfe97dc7d157f36cb6af76ba393a662f1d99a GIT binary patch literal 23116 zcmeFZWpE_Rk}fD_W@cuo#mrKRnVFfHnVFfHrEW1ZwODE~GgFIc>zp&YZ|2==yZe66 zgjr^#Wkgm*xPPC!E7DyG(x6~yKoCGsKtMpmK!v42CON=BK-iE#K&U`aAlf4Kb}puN zF8V5-4yMk!3?8;NL`7gAR0TjFfbsv+{u@i+XR56HJ`+;dHSH}SiN50gfRshE)kI)C zX*8Im_ru!4NLBAartsT!CTFQuZ3q3VLuBg8eNVhO@AQGwq3#15wk=#NXZ2`NP(g8{ z;Z{WX==vO@B5|cbN;EJ|BLrIdLb84Gs4GYfC$|BqR?#12sYQB^P*)iw4>OD(>O=LO z49WAbY>=M(1p1Qrph5-6t~f^A?O~Z(+*NjJ@9mW1I|?f59|P0X$TZ~U%_J15GyU)T zENh&Lc$&WrtWon=!V-A!J2Jm;ZT9>et(w>rHmhaaC%%R0aJ``1@5#qRd-aYXOmJpv z!c&};9>XnWuuuil19_^aH$F~;aa`$s;`!to3(FaY#iMo|Rz?$$V+6@yv}CTGkCAhF zP0pgP2E0_X>XC@~|MX?Nm%Ep(l-5;9+qK!ra+j!tx~AoFMry_QGqaBzwE`?s(hQ3C z8iF||GF>}iKtOd*&dS-hy#~qo)9JP9&<>9iT6@#?^MmW-GWRD~59|A_>voizSNNMB z)=zpNy6bMyDvBp(AO6zkivfi=9KZ-g45*e!P^FHla*(IzjU}VO99-o~=l&u#~L7!EfR;V&aX&7?glg>m&c< z+Imh&Nt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ZMlnlPM-`}xHUPnel^2IDM5jFQRnwD!uTin(il zZJx-kW)p~3^tCAHCZH~JKkjmWyMSt03$G*&=^m*@tdPcb2kkh2B* zA7#P`T{r5q4ni*j!waBpL=y?#I6^l7b^Za_fCk`15~=}+*$8w~P)F>MO_}0=ZVI?| zMmGR;Bplg*T1RvPz|O#G3hLM~vMCdt&`kl?4(QH6ZFeIZFwGa;0I)N#nu6L=MK)!X zAF?Uf+O6m=LT&FLo3$YTyIF|V54u^Xl_s)T+k>#1g{VRUyjg+E!x$Jufv^HtCGQIX F@c>`N9*h70 literal 0 HcmV?d00001 diff --git a/message_ix_buildings/data/chilled/version/dle_coolssp/arch_regions.xlsx b/message_ix_buildings/data/chilled/version/dle_coolssp/arch_regions.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..4a86d65e74899f74aee25719f8f06135410a8477 GIT binary patch literal 22902 zcmeHvRdgK5vaP^kW@csviLG+j245%Pvbe~7-sH+kN0!$ z)LKbN3CsW=bn5q_Kcw7jMinB~fcwZ^ zlI=I2BGr;}N60jLvz9Jh7gAPkjMi$oAieAL;j=sL{Y#wEM+~YQS$Uw-q17$04l{7{XX+t+pf36m}Q+)V76xOcJojYbha|U z2+#~*J-M*6><(~z^8i^eEjgNkQq?dityK;#gNXh3RkW;7S#?m52+(OjNEDuTXW){% ziUd;$FEPuUI^zSnTuTL+E?c@xmc1mTXCTAC5DsJ(0=iU#IvyHbuf63@P|b3#YEqN3 zTeZF<_#z6v$*Bazw;1M1QZc>lYwO{q6UhpeAIBeku0Hd{-tyVZc075%XL74#l*)}I zs)5znKJr2M_U$~OpL>4F^TaA(yT$27O!r_Z2hMC(eC6!Q4qdX?YP(twi?3G*kKS#w zjW8B>NWT6O&lm3=)S#1r4$dC4J$LNE7SOdvqsJl|Dc2CM`2|wM2V#jVlSb5)!S%9h{&wOu13!zA-UyP6yyzo^P#pt*mU) zpUg(wZH5YnsA39*#$wdJ#ViUOUb5t>{c0lr3P8IRoqilQ z3P`P+f~l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zn8jL`Zd0Jy7UJmGk?L?|u|fA6=SlSq$d~xrIfdP{@uuML5wbr$jf^^Q zZ+D*qpe96FM%o%Mm6P^FhIY15im4sOtn-mONQ-K{sKDiXcnV^Qou+}>H>f=c8o`CT z^NaApt-AQ7!h-01Vxy@aD{*4WoEZ1VH7XGH_dtuTp{zxQvPxy`edLbbRgTwkiL2M~pT z+RsLQd_Qhb_d#~6_A|-o;B$r8%R#I^f1nrv`BfK;LQNQ4g{kz(2)(vy zJz^P26e*_s9qa5h3p7r3s+gpr67VFrNf$;5^QZMj{mz88>54GP`genQnXm%{$h&Bp z@d3{gB1Du~7hp~_9hcd_%!!cq;p*}F`e7UxN$+;;A$fyzk60E8qtT6oowN@c56-P? zZcE7Wa$UG_&}lt5=$CIC^%_qOI&Igsd>br<4NGzq_cv-j&Ku0Ud7^?~4+ch6?q9;- zY+2MW#n=alh`{YN%W&?P6{^5U&F6}kRF~0sr`?hEaPuQ)3lNCrHO>0(_sRTePWb)y zZ+6X;ll&Fn*KPTJ2AFycPW-e<-|vFIZ%+0@6y$Y9_-|X4{Vx3L=1D(90RVDeGt&O+ zt(1Pp`F&TMA4mwV3*!E(J#v0W`F$&lA1DS0e~a>c2Kqb7?~CDopcJBfNBMne{OZm_(}X-%ES<~!lk}f{{y)M*zXSXl5%?M4koV^{_`CSP z?^wV3m4C)MpT$R6L{p#WR8S7d2XRJS>A3xFThvEO# h5%V)Zis#~$TQen^mI9~5a76175zW@X<+#Ub` literal 0 HcmV?d00001 diff --git a/message_ix_buildings/data/chilled/version/dle_coolssp/par_var.csv b/message_ix_buildings/data/chilled/version/dle_coolssp/par_var.csv new file mode 100755 index 0000000..fef10f5 --- /dev/null +++ b/message_ix_buildings/data/chilled/version/dle_coolssp/par_var.csv @@ -0,0 +1,3 @@ +id_run,name_run,cop,eff,t_sp_c,t_sp_c_max,t_sp_h,f_c,f_f,f_h +0,tm23ts23,1,1,23,23,21,0.333,0.333,1 +1,tm26ts26,1,1,26,26,20,0.333,0.333,1 \ No newline at end of file diff --git a/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv b/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv new file mode 100755 index 0000000..813cc1e --- /dev/null +++ b/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv @@ -0,0 +1,11 @@ +id,scen,year,clim +1,ssp2,2015,2015 +2,ssp2,2020,2020 +3,ssp2,2030,2030 +4,ssp2,2040,2040 +5,ssp2,2050,2050 +6,ssp2,2060,2060 +7,ssp2,2070,2070 +8,ssp2,2080,2080 +9,ssp2,2090,2090 +10,ssp2,2100,2100 From 782993640db955c484415680fd6a19479c2f7118 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:17:26 +0200 Subject: [PATCH 064/114] Add "low" arch to config --- message_ix_buildings/chilled/utils/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 4b9b0f3..81d5534 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -98,7 +98,7 @@ class Config: arch_setting = "regional" # options: ["fixed", "regional"] # URBAN/RURAL DISAGGREGATIONS - urts = ["urban", "rural"] # options (mult): "urban", "rural" + urts = ["low", "urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES archs = ["new", "exist"] From e0de8a4be9e0d44930f017c68274181df6b9ca33 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:20:42 +0200 Subject: [PATCH 065/114] Fix error where "low" got placed with urts --- message_ix_buildings/chilled/utils/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 81d5534..81d6709 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -98,10 +98,10 @@ class Config: arch_setting = "regional" # options: ["fixed", "regional"] # URBAN/RURAL DISAGGREGATIONS - urts = ["low", "urban", "rural"] # options (mult): "urban", "rural" + urts = ["urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES - archs = ["new", "exist"] + archs = ["low", "new", "exist"] # PARAMETERS FOR STEP 2 SCRIPT verbose = True From 6302168201c2c3248d2989c76a6eba19a8606c55 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:28:49 +0200 Subject: [PATCH 066/114] Add arch_regions data for low arch --- .../version/dle_coolssp/arch_regions.xlsx | Bin 22902 -> 21428 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/message_ix_buildings/data/chilled/version/dle_coolssp/arch_regions.xlsx b/message_ix_buildings/data/chilled/version/dle_coolssp/arch_regions.xlsx index 4a86d65e74899f74aee25719f8f06135410a8477..e318634c909d6d76f0c22607d728544a35f10ded 100644 GIT binary patch delta 11151 zcmZ8{1yo$ivi9KaPH+nvB)AjY-Q5}7CCK0q90rHr?(Xgq+}$k+?iPN|dGGz_+}pEe zP3`IGz1FVUUv>3Ybyo+`Pz-^uBnt(N4S)r}0{{SWfU;3sVKxK+KnGuoPYwzCkt8n* z#flz!9{6TFs@?{~5i3|DDI-x=>a~$8+L-o9k#zKlIK1F3r|| zIh($VLt%YR&q@1S0r=QCYp+pTJe;u!!w?s&+UE&}qYF`YdHi7Y(1PeM9^tN4n@+3e z98(9&P;&#Jm!9@y1yi`hy(a=1X-$O?I=!E2y@}~jjwM9lBsAz%V?@ST8o%+9$Lu9z zp!pRNtvM(LFCi=PEwP*TcB1fpN2zF}1J;K4g36d>^XK%B7uyRAj}#TG#=uw-tSm$+EdW><4Px$wuK}_oCfU0^cqX#nRAsm^sO-K1~werLs@5#C?e%Y zH(oY4g+2+7jBY(LuV-77CFncBC;yFKT^M#ZWC@`Y9E#qr@$hcrSaT}EV z3OKX1-6!j7*h;cDtg@p1k#hVWX%s)RxFt)4k)rJ2hO*Tbfg)Y59H8@H{%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_buildings/chilled/utils/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 81d6709..9d8693a 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -101,7 +101,7 @@ class Config: urts = ["urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES - archs = ["low", "new", "exist"] + archs: list = ["new", "exist"] # PARAMETERS FOR STEP 2 SCRIPT verbose = True From eb9528434c689f025ff4c99747a688f6c6320ddc Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:31:37 +0200 Subject: [PATCH 068/114] Remove class for archs in config --- message_ix_buildings/chilled/utils/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 9d8693a..4b9b0f3 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -101,7 +101,7 @@ class Config: urts = ["urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES - archs: list = ["new", "exist"] + archs = ["new", "exist"] # PARAMETERS FOR STEP 2 SCRIPT verbose = True From 7ec5359a7e0cdd0b00bd40443e3f6552c2ec66df Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:35:20 +0200 Subject: [PATCH 069/114] Change to using function to get archs from input data --- .../chilled/preprocess/archetypes.py | 13 ++++++++++--- message_ix_buildings/chilled/utils/config.py | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index f151ea9..e681873 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -11,7 +11,8 @@ from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore -from utils.util import read_arch_inputs_df, read_arch_reg_df # type: ignore +from utils.util import get_archs, read_arch_inputs_df, read_arch_reg_df # type: ignore + read_arch_reg_df) def create_archetypes(config: "Config"): @@ -25,6 +26,9 @@ def create_archetypes(config: "Config"): # get raster file and message map country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) + # get archs + vers_archs = get_archs(config) + # save MESSAGE regions map msg_file = "map_reg_MESSAGE_" + config.node + ".nc" map_reg.to_netcdf(os.path.join(archetype_path, msg_file)) @@ -36,7 +40,7 @@ def create_archetypes(config: "Config"): ) ) - for arch in config.archs: + for arch in vers_archs: arch_reg = read_arch_reg_df(config, arch) # Create map of archetypes based on MESSAGE regions raster @@ -92,6 +96,9 @@ def create_archetype_variables(config: "Config"): out_path = os.path.join(config.project_path, "out", "version") archetype_path = os.path.join(out_path, config.vstr, "rasters") + # get archs + vers_archs = get_archs(config) + def map_archetype_variables(args): arch_setting, arch, varname = args @@ -141,6 +148,6 @@ def map_archetype_variables(args): # create archetype variables maps - func_inputs = product([config.arch_setting], config.archs, VARS_ARCHETYPES) + func_inputs = product([config.arch_setting], vers_archs, VARS_ARCHETYPES) list(map(map_archetype_variables, func_inputs)) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 4b9b0f3..ba0ecff 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -101,7 +101,7 @@ class Config: urts = ["urban", "rural"] # options (mult): "urban", "rural" # ARCHETYPES - archs = ["new", "exist"] + # archs = ["new", "exist"] # PARAMETERS FOR STEP 2 SCRIPT verbose = True From 705899e8bc4259ad0330bef05a070ea3c1c8df13 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:36:26 +0200 Subject: [PATCH 070/114] Fix import lines typo --- message_ix_buildings/chilled/preprocess/archetypes.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index e681873..0cf46ad 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -11,8 +11,7 @@ from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore -from utils.util import get_archs, read_arch_inputs_df, read_arch_reg_df # type: ignore - read_arch_reg_df) +from utils.util import get_archs, read_arch_inputs_df, read_arch_reg_df def create_archetypes(config: "Config"): From a899cc8bfe1bd2974b883793abbfa14410e86680 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:40:07 +0200 Subject: [PATCH 071/114] Switch to using `get_archs()` --- message_ix_buildings/chilled/main/climate.py | 25 +++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 20a3075..a6f2b25 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -42,7 +42,7 @@ ) from preprocess.message_raster import create_message_raster # type: ignore from utils.config import Config # type: ignore -from utils.util import load_all_scenarios_data, load_parametric_analysis_data +from utils.util import get_archs, load_all_scenarios_data, load_parametric_analysis_data def create_climate_variables_maps(config: "Config", start_time: datetime.datetime): @@ -59,6 +59,7 @@ def create_climate_variables_maps(config: "Config", start_time: datetime.datetim if not os.path.exists(output_path_vdd): os.makedirs(output_path_vdd) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) def map_calculated_variables(args): @@ -736,7 +737,7 @@ def read_netcdf_files(input_args): # print('Finished!') print(datetime.datetime.now() - start_time) - inputs = product(config.clims, config.archs, par_var.itertuples(), config.urts) + inputs = product(config.clims, vers_archs, par_var.itertuples(), config.urts) list(map(map_calculated_variables, inputs)) # mypool = Pool(4) @@ -753,13 +754,14 @@ def aggregate_urban_rural_files(config: "Config"): config.rcp, ) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) if not os.path.exists(output_path_vdd): os.makedirs(output_path_vdd) for clim in config.clims: - for arch in config.archs: + for arch in vers_archs: suff = clim + "_" + arch # suffix print("Aggregating results for " + suff) @@ -829,6 +831,7 @@ def make_vdd_total_maps(config: "Config"): config.rcp, ) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) # TODO: (meas) the original code does not query for clims, @@ -839,7 +842,7 @@ def make_vdd_total_maps(config: "Config"): s_runs = load_all_scenarios_data(config) for s_run in s_runs.itertuples(): - for arch in config.archs: + for arch in vers_archs: for urt in config.urts: suff = str(s_run.clim) + "_" + arch # suffix @@ -1130,6 +1133,7 @@ def process_construction_shares(config: "Config"): if not os.path.exists(output_path): os.makedirs(output_path) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) # get raster file and message map @@ -1223,6 +1227,7 @@ def process_floor_area_maps(config: "Config"): if not os.path.exists(output_path): os.makedirs(output_path) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) s_runs = load_all_scenarios_data(config) @@ -1350,6 +1355,7 @@ def process_country_maps(config: "Config"): if not os.path.exists(output_path): os.makedirs(output_path) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) s_runs = load_all_scenarios_data(config) country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) @@ -1437,6 +1443,7 @@ def process_final_maps(config: "Config"): if not os.path.exists(finalmaps_path): os.makedirs(finalmaps_path) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) s_runs = load_all_scenarios_data(config) # country_ras, reg_ras, map_reg, iso_attrs = create_message_raster(config) @@ -1491,7 +1498,7 @@ def process_final_maps(config: "Config"): s_runs = s_runs.query("clim in @clims_int") for s_run in s_runs.itertuples(): - for arch in config.archs: + for arch in vers_archs: suff = ( str(s_run.scen) + "_" @@ -1826,6 +1833,7 @@ def process_iso_tables(config: "Config"): if not os.path.exists(iso_path): os.makedirs(iso_path) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) s_runs = load_all_scenarios_data(config) # ras, map_reg, iso_attrs = create_message_raster(config) @@ -1930,14 +1938,14 @@ def process_iso_tables(config: "Config"): # then convert the map object to a list inputs_cool = product( s_runs.itertuples(), - config.archs, + vers_archs, updated_urts, par_var.itertuples(), varlist_cool, ) inputs_heat = product( s_runs.itertuples(), - config.archs, + vers_archs, updated_urts, par_var.itertuples(), varlist_heat, @@ -2133,6 +2141,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): if not os.path.exists(output_path_vdd): os.makedirs(output_path_vdd) + vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) for clim in config.clims: @@ -2219,7 +2228,7 @@ def create_climate_outputs(config: "Config", start_time: datetime.datetime): # Start Degree Days calculations # ============================================================================= - for arch in config.archs: + for arch in vers_archs: # Read in archetype parameters if config.arch_setting == "regional": xr.open_dataset( From 79c28654fcc5f43c088c855c150179139ee13d78 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:41:43 +0200 Subject: [PATCH 072/114] Add other functions to `run_main.py` --- message_ix_buildings/chilled/run_main.py | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 8367405..abf3d60 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -2,7 +2,16 @@ import sys from argparse import ArgumentParser -from main.climate import create_climate_variables_maps # type: ignore +from main.climate import ( + aggregate_urban_rural_files, + create_climate_variables_maps, + make_vdd_total_maps, + process_construction_shares, + process_country_maps, + process_final_maps, + process_floor_area_maps, + process_iso_tables, +) from utils.config import Config # type: ignore @@ -72,8 +81,31 @@ def main(args=None): start = datetime.datetime.now() print_arguments(parsed_arguments=parsed_args) cfg = create_config(parsed_arguments=parsed_args) + + print("RUNNING create_climate_variables_maps()........") create_climate_variables_maps(cfg, start) + print("RUNNING aggregate_urban_rural_files()........") + aggregate_urban_rural_files(cfg) + + print("RUNNING make_vdd_total_maps()........") + make_vdd_total_maps(cfg) + + print("RUNNING process_construction_shares()........") + process_construction_shares(cfg) + + print("RUNNING process_floor_area_maps()........") + process_floor_area_maps(cfg) + + print("RUNNING process_country_maps()........") + process_country_maps(cfg) + + print("RUNNING process_final_maps()........") + process_final_maps(cfg) + + print("RUNNING process_iso_tables()........") + process_iso_tables(cfg) + if __name__ == "__main__": main() From f2e8bf982db4255aa3960796bf568101ae57b070 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:48:49 +0200 Subject: [PATCH 073/114] Fix filename --- message_ix_buildings/chilled/main/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index a6f2b25..e8d2cd6 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -1882,7 +1882,7 @@ def process_iso_tables(config: "Config"): # Read country data dfd = pd.read_csv( - os.path.join(input_path, "gaul_lvl0_raster0.5.csv"), index_col="ID" + os.path.join(input_path, "GAUL_lvl0_raster0.5"), index_col="ID" ).assign(ISONUM=lambda x: x.index) # Import MESSAGE regions and North/South classification From 5a7308be6ea98d522f19269e5fd4cfb5da87cf3f Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:48:54 +0200 Subject: [PATCH 074/114] Only run last function --- message_ix_buildings/chilled/run_agg.py | 34 ++++++++++--------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index 52b1b16..345cb1d 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -2,15 +2,7 @@ import sys from argparse import ArgumentParser -from main.climate import ( - aggregate_urban_rural_files, - make_vdd_total_maps, - process_construction_shares, - process_country_maps, - process_final_maps, - process_floor_area_maps, - process_iso_tables, -) +from main.climate import process_iso_tables from utils.config import Config # type: ignore @@ -80,23 +72,23 @@ def main(args=None): print_arguments(parsed_arguments=parsed_args) cfg = create_config(parsed_arguments=parsed_args) - print("RUNNING aggregate_urban_rural_files()........") - aggregate_urban_rural_files(cfg) + # print("RUNNING aggregate_urban_rural_files()........") + # aggregate_urban_rural_files(cfg) - print("RUNNING make_vdd_total_maps()........") - make_vdd_total_maps(cfg) + # print("RUNNING make_vdd_total_maps()........") + # make_vdd_total_maps(cfg) - print("RUNNING process_construction_shares()........") - process_construction_shares(cfg) + # print("RUNNING process_construction_shares()........") + # process_construction_shares(cfg) - print("RUNNING process_floor_area_maps()........") - process_floor_area_maps(cfg) + # print("RUNNING process_floor_area_maps()........") + # process_floor_area_maps(cfg) - print("RUNNING process_country_maps()........") - process_country_maps(cfg) + # print("RUNNING process_country_maps()........") + # process_country_maps(cfg) - print("RUNNING process_final_maps()........") - process_final_maps(cfg) + # print("RUNNING process_final_maps()........") + # process_final_maps(cfg) print("RUNNING process_iso_tables()........") process_iso_tables(cfg) From 736c3591ef61d558f571f1312a6a07484c3141ab Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 06:50:07 +0200 Subject: [PATCH 075/114] Add file extension --- message_ix_buildings/chilled/main/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index e8d2cd6..5b9d7b8 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -1882,7 +1882,7 @@ def process_iso_tables(config: "Config"): # Read country data dfd = pd.read_csv( - os.path.join(input_path, "GAUL_lvl0_raster0.5"), index_col="ID" + os.path.join(input_path, "GAUL_lvl0_raster0.5.csv"), index_col="ID" ).assign(ISONUM=lambda x: x.index) # Import MESSAGE regions and North/South classification From 345171d353530a35f2e6effd930e386109cba9eb Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 07:19:03 +0200 Subject: [PATCH 076/114] Reduce number of run years --- .../data/chilled/version/dle_coolssp/runs.csv | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv b/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv index 813cc1e..c890d0f 100755 --- a/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv +++ b/message_ix_buildings/data/chilled/version/dle_coolssp/runs.csv @@ -1,11 +1,5 @@ id,scen,year,clim 1,ssp2,2015,2015 2,ssp2,2020,2020 -3,ssp2,2030,2030 -4,ssp2,2040,2040 -5,ssp2,2050,2050 -6,ssp2,2060,2060 -7,ssp2,2070,2070 -8,ssp2,2080,2080 -9,ssp2,2090,2090 -10,ssp2,2100,2100 +3,ssp2,2050,2050 +4,ssp2,2100,2100 \ No newline at end of file From 5fbc9e35618d8bd60031c40b118e19b990f37acf Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 07:21:31 +0200 Subject: [PATCH 077/114] Reduce yearsdic in Config --- message_ix_buildings/chilled/utils/config.py | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index ba0ecff..b6d2caf 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -53,26 +53,26 @@ class Config: yeardic = { "2015": ("2015", "2020"), "2020": ("2015", "2020"), - "2030": ("2015", "2020"), - "2040": ("2015", "2020"), + # "2030": ("2015", "2020"), + # "2040": ("2015", "2020"), "2050": ("2015", "2020"), - "2060": ("2015", "2020"), - "2070": ("2015", "2020"), - "2080": ("2015", "2020"), - "2090": ("2015", "2020"), + # "2060": ("2015", "2020"), + # "2070": ("2015", "2020"), + # "2080": ("2015", "2020"), + # "2090": ("2015", "2020"), "2100": ("2015", "2020"), } else: yeardic = { "2015": ("2015", "2020"), "2020": ("2015", "2025"), - "2030": ("2015", "2045"), - "2040": ("2025", "2055"), + # "2030": ("2015", "2045"), + # "2040": ("2025", "2055"), "2050": ("2035", "2065"), - "2060": ("2045", "2075"), - "2070": ("2055", "2085"), - "2080": ("2065", "2095"), - "2090": ("2080", "2100"), + # "2060": ("2045", "2075"), + # "2070": ("2055", "2085"), + # "2080": ("2065", "2095"), + # "2090": ("2080", "2100"), "2100": ("2095", "2100"), } From d2571c5bc08e1d73ea4a8fbf1b79c099a43f88f6 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:11:10 +0200 Subject: [PATCH 078/114] Change so that any clims/years not in s_runs is not run --- message_ix_buildings/chilled/main/climate.py | 26 +++++++++++--------- message_ix_buildings/chilled/utils/config.py | 26 ++++++++++---------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 5b9d7b8..9e7ab83 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -737,7 +737,8 @@ def read_netcdf_files(input_args): # print('Finished!') print(datetime.datetime.now() - start_time) - inputs = product(config.clims, vers_archs, par_var.itertuples(), config.urts) + s_runs = load_all_scenarios_data(config).clim + inputs = product(s_runs, vers_archs, par_var.itertuples(), config.urts) list(map(map_calculated_variables, inputs)) # mypool = Pool(4) @@ -756,11 +757,12 @@ def aggregate_urban_rural_files(config: "Config"): vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) + runs_clims = load_all_scenarios_data(config).clim if not os.path.exists(output_path_vdd): os.makedirs(output_path_vdd) - for clim in config.clims: + for clim in runs_clims: for arch in vers_archs: suff = clim + "_" + arch # suffix @@ -833,13 +835,13 @@ def make_vdd_total_maps(config: "Config"): vers_archs = get_archs(config) par_var = load_parametric_analysis_data(config) + s_runs = load_all_scenarios_data(config) + run_clims = s_runs.clim # TODO: (meas) the original code does not query for clims, # but without it the code will crash if not all years have been run - clims_int = list(map(int, config.clims)) - print(clims_int) - - s_runs = load_all_scenarios_data(config) + # clims_int = list(map(int, run_clims)) + # print(clims_int) for s_run in s_runs.itertuples(): for arch in vers_archs: @@ -1493,9 +1495,9 @@ def process_final_maps(config: "Config"): # TODO: (meas) the original code does not query for clims, # but without it the code will crash if not all years have been run - clims_int = list(map(int, config.clims)) - print("Years of data available: " + str(clims_int)) - s_runs = s_runs.query("clim in @clims_int") + # clims_int = list(map(int, config.clims)) + # print("Years of data available: " + str(clims_int)) + # s_runs = s_runs.query("clim in @clims_int") for s_run in s_runs.itertuples(): for arch in vers_archs: @@ -1873,9 +1875,9 @@ def process_iso_tables(config: "Config"): # TODO: (meas) the original code does not query for clims, # but without it the code will crash if not all years have been run - clims_int = list(map(int, config.clims)) - print("Years of data available: " + str(clims_int)) - s_runs = s_runs.query("clim in @clims_int") + # clims_int = list(map(int, config.clims)) + # print("Years of data available: " + str(clims_int)) + # s_runs = s_runs.query("clim in @clims_int") # Read raster data raster = xr.open_dataarray(os.path.join(input_path, "gaul_lvl0_hybrid_05_3.nc")) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index b6d2caf..6a3aa28 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -53,32 +53,32 @@ class Config: yeardic = { "2015": ("2015", "2020"), "2020": ("2015", "2020"), - # "2030": ("2015", "2020"), - # "2040": ("2015", "2020"), + "2030": ("2015", "2020"), + "2040": ("2015", "2020"), "2050": ("2015", "2020"), - # "2060": ("2015", "2020"), - # "2070": ("2015", "2020"), - # "2080": ("2015", "2020"), - # "2090": ("2015", "2020"), + "2060": ("2015", "2020"), + "2070": ("2015", "2020"), + "2080": ("2015", "2020"), + "2090": ("2015", "2020"), "2100": ("2015", "2020"), } else: yeardic = { "2015": ("2015", "2020"), "2020": ("2015", "2025"), - # "2030": ("2015", "2045"), - # "2040": ("2025", "2055"), + "2030": ("2015", "2045"), + "2040": ("2025", "2055"), "2050": ("2035", "2065"), - # "2060": ("2045", "2075"), - # "2070": ("2055", "2085"), - # "2080": ("2065", "2095"), - # "2090": ("2080", "2100"), + "2060": ("2045", "2075"), + "2070": ("2055", "2085"), + "2080": ("2065", "2095"), + "2090": ("2080", "2100"), "2100": ("2095", "2100"), } # climatic inputs for sensitivity runs # clims = ["hist"] # options: "hist", "1p5" - clims = list(yeardic.keys()) + # clims = list(yeardic.keys()) # POPULATION SETTINGS popfix = True # If True, fix to SSP2, else.... (see script 4/5) From ce887f5220ad4626888890c868388077c1ac9c16 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:12:17 +0200 Subject: [PATCH 079/114] Add test version --- .../chilled/version/test/arch_input_reg.xlsx | Bin 0 -> 27580 bytes .../data/chilled/version/test/arch_regions.xlsx | Bin 0 -> 22870 bytes .../data/chilled/version/test/par_var.csv | 4 ++++ .../data/chilled/version/test/runs.csv | 2 ++ 4 files changed, 6 insertions(+) create mode 100755 message_ix_buildings/data/chilled/version/test/arch_input_reg.xlsx create mode 100755 message_ix_buildings/data/chilled/version/test/arch_regions.xlsx create mode 100755 message_ix_buildings/data/chilled/version/test/par_var.csv create mode 100755 message_ix_buildings/data/chilled/version/test/runs.csv diff --git a/message_ix_buildings/data/chilled/version/test/arch_input_reg.xlsx b/message_ix_buildings/data/chilled/version/test/arch_input_reg.xlsx new file mode 100755 index 0000000000000000000000000000000000000000..a97cff8e31305203dbd0dded98421574481d818b GIT binary patch literal 27580 zcmeFZWpo|OmL@1>S0j2rGP<@0l)wt0000805WEz*8fu92cM4klz^!fas<9{#$ZSgWvzzpyK7d{_)!zwMNR6*j6xUcLb zSw4$N(yiG~giQ1I8>uq&L1pDeXmnVPu`U~AOv9(Uwnj2nUKVL&^b{_ii6euI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NDcu5CkFe0J@;d4>bOG!2|GyQ zL1*AEZ(g|$t1cDYL%40ljmTyOjk593pVp%*K-eVI!oHGw;O?lU`~LQ$4m-*+Q&H zrluig_$e)!CCrtZO?q8n?Kc&ai5BBgVqEFif$~W@;{1yDR6yZH&J%cZ^{)$oU#65P z-AzVi1N^5q4b>BpM=4&>J~)(?kGg)W&U$aP z6ax2pM1rqhxBC_cOk@R47HEekAl+6HZz6tiR>rV4em(teo^6y>scU$el{R4d@Kt6v zC0b&nmpy$i&uHPUG{^em^Z$DO5fT1hb)CUVLSYbv#~>Hc14z))poJvvBufY)LV}i| zyC7&0xQSjOe2JDlOON2fmvC+WKljp{bDRW07w2=3dj;=&Gq-avDD!vuU03v9UUCnX z#~B0oRu2gHDKZ1x_(6lZ@IIouVjs%-dkyn`?ueSLN+aX{ZQaVz{mVhx9{&}ww~bjT zx)3QS-=|K|^+*cPl@0+o?>itCJZMzMDkHiXG*KP0RDwAOge zhx@a5`q`|yN7n3UY?;IB{{XWZst{eDwTTsvvrDSM6=|)3&Ed$JO($s$etkeGEXN|{ z>q;r!S5*K@rwI7GR)EWsDTPf-q^!&IWSB#(cd13NDTndJ4a8e-PSY$ZVfy42(v5dg zwIv0xp@M+tJNynZUqxB$IUwuxK4*pXpe$~dBWpR!S_oer+k400o}O*+LP_D{2o`SzGtKI>iwm@`vn3l`&9q{ literal 0 HcmV?d00001 diff --git a/message_ix_buildings/data/chilled/version/test/arch_regions.xlsx b/message_ix_buildings/data/chilled/version/test/arch_regions.xlsx new file mode 100755 index 0000000000000000000000000000000000000000..803bbe6a99e1bb792fd61705843350f23881d19f GIT binary patch literal 22870 zcmeIaWq2IRvLz~JW{cTkCW{#@W@d{mX0n)>(PG(RW@fOMnOPR2MX&9B&NZBU=gs_> zKX-P0Uv*b^R;Q=qkC|7~5;pxmZ~e=751vWC4Ky?*Hfbe^>)O3DQ!aj7Wi}zAyTN%1vg}!Q%D! zj~qo=zH`ZMo3rnUnP+a+(xhvHOG=F~TP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Ox6iPgx)!A-2D*!;c~LpD4diU;m1t z%K`MuOw7L~v;P$TefsfN@m0XE{=X)2{xuo-r}Xa=Kfg-n@cbhEa~kMRfZrqjzXBZc z{i=h%i~s+L^?Tg-SFAIEzsLF+Mg9}(_u%8NShqrdkM%PY`6t%z5v*Uao<)Ae`aZky n3(bBu{J#fUeg#Mt`xD?_903O`JNcgKf(670xPnmp{^|b%uhRco literal 0 HcmV?d00001 diff --git a/message_ix_buildings/data/chilled/version/test/par_var.csv b/message_ix_buildings/data/chilled/version/test/par_var.csv new file mode 100755 index 0000000..adb40a3 --- /dev/null +++ b/message_ix_buildings/data/chilled/version/test/par_var.csv @@ -0,0 +1,4 @@ +id_run,name_run,cop,eff,t_sp_c,t_sp_c_max,t_sp_h,f_c,f_f,f_h +0,tm23ts23,1,1,23,23,21,0.333,0.333,1 +1,tm28ts26,1,1,26,28,20,0.333,0.333,1 +2,tm26ts26,1,1,26,26,20,0.333,0.333,1 diff --git a/message_ix_buildings/data/chilled/version/test/runs.csv b/message_ix_buildings/data/chilled/version/test/runs.csv new file mode 100755 index 0000000..804c723 --- /dev/null +++ b/message_ix_buildings/data/chilled/version/test/runs.csv @@ -0,0 +1,2 @@ +id,scen,year,clim +1,ssp2,2070,2070 \ No newline at end of file From 5ca7e56a53ef3b2a600b5f5ee75378f16de24a80 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:14:41 +0200 Subject: [PATCH 080/114] Convert clim years to string --- message_ix_buildings/chilled/main/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 9e7ab83..295defb 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -65,9 +65,9 @@ def create_climate_variables_maps(config: "Config", start_time: datetime.datetim def map_calculated_variables(args): clim, arch, parset, urt = args - print(clim + " + " + arch + " + " + parset.name_run + " + " + urt) + print(str(clim) + " + " + arch + " + " + parset.name_run + " + " + urt) - years_clim = config.yeardic[clim] + years_clim = config.yeardic[str(clim)] # << this selects the correct years. # But when testing you’ll want to use just say 3 years data, # so set years manually, e.g. From 9a88b8266663caec3615fb325838e84dfbcf802e Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:16:10 +0200 Subject: [PATCH 081/114] Convert clim to string --- message_ix_buildings/chilled/main/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 295defb..872200d 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -143,7 +143,7 @@ def map_calculated_variables(args): dfa = pd.DataFrame(columns=["H_v_cl", "H_v_op", "H_tr"], index=par_var.index) - suff = clim + "_" + arch # suffix + suff = str(clim) + "_" + arch # suffix # suff = clim+'_'+arch+'_'+str(parset.name_run) #suffix suff1 = arch # only arch (for imports arch data) @@ -764,7 +764,7 @@ def aggregate_urban_rural_files(config: "Config"): for clim in runs_clims: for arch in vers_archs: - suff = clim + "_" + arch # suffix + suff = str(clim) + "_" + arch # suffix print("Aggregating results for " + suff) # Aggregate archetypes into same files. From 7cd70b4f01bc3dd0cd6527862a31d76d67ec485b Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:22:40 +0200 Subject: [PATCH 082/114] Move older code to `archive` folder --- message_ix_buildings/chilled/archive/__init__.py | 0 .../chilled/{preprocess => archive}/preprocess.py | 0 message_ix_buildings/chilled/{functions => archive}/setup.py | 0 .../chilled/{functions => archive}/vdd_functions.py | 0 message_ix_buildings/chilled/{ => archive}/z1_VDD_ene_calcs.py | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 message_ix_buildings/chilled/archive/__init__.py rename message_ix_buildings/chilled/{preprocess => archive}/preprocess.py (100%) rename message_ix_buildings/chilled/{functions => archive}/setup.py (100%) rename message_ix_buildings/chilled/{functions => archive}/vdd_functions.py (100%) rename message_ix_buildings/chilled/{ => archive}/z1_VDD_ene_calcs.py (100%) diff --git a/message_ix_buildings/chilled/archive/__init__.py b/message_ix_buildings/chilled/archive/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/message_ix_buildings/chilled/preprocess/preprocess.py b/message_ix_buildings/chilled/archive/preprocess.py similarity index 100% rename from message_ix_buildings/chilled/preprocess/preprocess.py rename to message_ix_buildings/chilled/archive/preprocess.py diff --git a/message_ix_buildings/chilled/functions/setup.py b/message_ix_buildings/chilled/archive/setup.py similarity index 100% rename from message_ix_buildings/chilled/functions/setup.py rename to message_ix_buildings/chilled/archive/setup.py diff --git a/message_ix_buildings/chilled/functions/vdd_functions.py b/message_ix_buildings/chilled/archive/vdd_functions.py similarity index 100% rename from message_ix_buildings/chilled/functions/vdd_functions.py rename to message_ix_buildings/chilled/archive/vdd_functions.py diff --git a/message_ix_buildings/chilled/z1_VDD_ene_calcs.py b/message_ix_buildings/chilled/archive/z1_VDD_ene_calcs.py similarity index 100% rename from message_ix_buildings/chilled/z1_VDD_ene_calcs.py rename to message_ix_buildings/chilled/archive/z1_VDD_ene_calcs.py From ee3096266005684852674419ee4ae17a168a49e6 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:26:16 +0200 Subject: [PATCH 083/114] Move running scripts to `run` subdirectory --- message_ix_buildings/chilled/{run_agg.py => run/agg.py} | 0 message_ix_buildings/chilled/{run_main.py => run/main.py} | 0 .../chilled/{run_preprocess.py => run/preprocess.py} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename message_ix_buildings/chilled/{run_agg.py => run/agg.py} (100%) rename message_ix_buildings/chilled/{run_main.py => run/main.py} (100%) rename message_ix_buildings/chilled/{run_preprocess.py => run/preprocess.py} (100%) diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run/agg.py similarity index 100% rename from message_ix_buildings/chilled/run_agg.py rename to message_ix_buildings/chilled/run/agg.py diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run/main.py similarity index 100% rename from message_ix_buildings/chilled/run_main.py rename to message_ix_buildings/chilled/run/main.py diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run/preprocess.py similarity index 100% rename from message_ix_buildings/chilled/run_preprocess.py rename to message_ix_buildings/chilled/run/preprocess.py From 580b164e54dd02274afa6f68cc97ff025e7fc214 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 10 Jul 2024 11:27:36 +0200 Subject: [PATCH 084/114] Move postproces script into its own `postprocess` subdirectory --- message_ix_buildings/chilled/{ => postprocess}/postprocess.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename message_ix_buildings/chilled/{ => postprocess}/postprocess.py (100%) diff --git a/message_ix_buildings/chilled/postprocess.py b/message_ix_buildings/chilled/postprocess/postprocess.py similarity index 100% rename from message_ix_buildings/chilled/postprocess.py rename to message_ix_buildings/chilled/postprocess/postprocess.py From 5dfc231206f4c8d17e20977fd88c3c94132cd123 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 11 Jul 2024 11:37:34 +0200 Subject: [PATCH 085/114] Add extensions and sys.path for automodule recognition --- doc/conf.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 8e0a5df..b892c07 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -3,6 +3,12 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +import os +import sys + + +sys.path.insert(0, os.path.abspath("..")) + # -- Project information --------------------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -14,9 +20,17 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.coverage", + "sphinx.ext.autosummary", + "sphinx.ext.extlinks", "sphinx.ext.intersphinx", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", ] + templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] From 3c4e48aacb4b9d0598039aab494cc669993c44fc Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 11 Jul 2024 11:38:00 +0200 Subject: [PATCH 086/114] Add docstrings for `create_message_raster()` --- .../chilled/preprocess/message_raster.py | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index fe28f71..40437b1 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -12,6 +12,28 @@ def create_message_raster(config: "Config"): + """ + Process global raster into MESSAGE regions + + Parameters + ---------- + config : .Config + The function responds to, or passes on to other functions, the fields: + :attr:`~.Config.dle_path` and + :attr:`~.Config.node`, + + Returns + ------- + country_ras : xarray.DataArray + Raster of countries + reg_ras : xarray.Dataset + Raster of regions + map_reg : xarray.DataArray + Map of regions + iso_attrs : pd.DataFrame + ISO attributes in a dataframe + + """ input_path = os.path.join(config.dle_path) if config.node == "R11": @@ -98,15 +120,6 @@ def create_message_raster(config: "Config"): "contact": "byers@iiasa.ac.at; mastrucc@iiasa.ac.at", } - # filename = "map_reg_MESSAGE_" + config.node + ".nc" - - # map_reg.to_netcdf(os.path.join(output_path, filename)) - - # print( - # "Saved MESSAGE and raster map data to " - # + os.path.join(output_path, filename) - # ) - return country_ras, reg_ras, map_reg, iso_attrs else: From c8a3783a637687618217d4102c259c17c3259426 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 11 Jul 2024 11:38:24 +0200 Subject: [PATCH 087/114] Create barebones docs for CHILLED module --- doc/chilled.rst | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 doc/chilled.rst diff --git a/doc/chilled.rst b/doc/chilled.rst new file mode 100644 index 0000000..78991ea --- /dev/null +++ b/doc/chilled.rst @@ -0,0 +1,67 @@ +.. currentmodule:: message_ix_buildings.chilled + +CHILLED (:mod:`.chilled`) +************************* + +:mod:`.chilled` (Cooling and Heating gLobaL Energy Demand) is a model that assesses the impacts of climate change (temperature change) + +Methods +======= + + +Data +==== + +Input data +---------- + + +Parameters +---------- + +In this module, the "version" refers to the version of the model, not the version of the data. For example, the "ALPS2023" version refers to the set of scenario inputs/parameters for the "ALPS2023" run. +When specifying a version, CHILLED will look in the `/data/chilled/version` directory that the version name exists and that the following files exist as well: +- `arch_input_reg.xlsx` (or `arch_input.xlsx`) +- `arch_regions.xlsx` +- `par_var.csv` +- `runs.csv` + +Usage +===== + +The preprocessing (preparing MESSAGE region rasters and country codes) happens without specifying GCM or RCP scenario. Therefore, it can be run first on its own using the following command (from the within :mod:`chilled.run`): + +.. code-block:: bash + + python -m preprocess.py -version "version_name" + +If the `-version` command is not provided, then the default version is "ALPS2023". + +The main model can be run using the following command: + +.. code-block:: bash + + python -m main.py -version "version_name" -gcm "gcm_name" -rcp "rcp_name" + +If the `-version` command is not provided, then the default version is "ALPS2023". +If the `-gcm` and `-rcp` commands are not provided, then the default GCM is "GFDL-ESM2M" and the default RCP is "baseline". + + +.. Code reference +.. ============== + +.. .. automodule:: message_ix_buildings.chilled +.. :members: + +.. .. currentmodule:: message_ix_buildings.chilled.preprocess.message_raster + +.. Create raster of MESSAGE regions (:mod:`~.chilled.preprocess.message_raster`) +.. ----------------------------------------------------------------------------- + +.. .. automodule:: message_ix_buildings.chilled.preprocess.message_raster +.. :members: + +.. .. autosummary:: + +.. create_message_raster + From 9b703dcf3861db7772be2e2c869c0b384e3c5eb3 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 11 Jul 2024 11:39:05 +0200 Subject: [PATCH 088/114] Add CHILLED to doc/index --- doc/index.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 31f16a0..7416b57 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -9,18 +9,19 @@ Welcome to MESSAGEix-Buildings's documentation! “MESSAGEix-Buildings” refers to a collection of linked models, including: - ACCESS -- CHILLED +- :doc:`chilled` - :doc:`sturm` …and their integration with the :doc:`MESSAGEix-GLOBIOM model family `. -At present, the package :mod:`message_ix_buildings` contains STURM only. +At present, the package :mod:`message_ix_buildings` contains STURM and CHILLED only. .. toctree:: :maxdepth: 2 :hidden: sturm + chilled dev Indices and tables From e0513a3dd26b8722cc130928b67a00ec8215ed85 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 17 Jul 2024 15:28:56 +0200 Subject: [PATCH 089/114] Add `__init__.py` files for submodules --- message_ix_buildings/chilled/main/__init__.py | 0 message_ix_buildings/chilled/postprocess/__init__.py | 0 message_ix_buildings/chilled/run/__init__.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 message_ix_buildings/chilled/main/__init__.py create mode 100644 message_ix_buildings/chilled/postprocess/__init__.py create mode 100644 message_ix_buildings/chilled/run/__init__.py diff --git a/message_ix_buildings/chilled/main/__init__.py b/message_ix_buildings/chilled/main/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/message_ix_buildings/chilled/postprocess/__init__.py b/message_ix_buildings/chilled/postprocess/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/message_ix_buildings/chilled/run/__init__.py b/message_ix_buildings/chilled/run/__init__.py new file mode 100644 index 0000000..e69de29 From b30fa4060a24f7db5a88b1803319e4206ba2980d Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 17 Jul 2024 15:46:44 +0200 Subject: [PATCH 090/114] Rename run files --- message_ix_buildings/chilled/run/{agg.py => run_agg.py} | 0 message_ix_buildings/chilled/run/{main.py => run_main.py} | 0 .../chilled/run/{preprocess.py => run_preprocess.py} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename message_ix_buildings/chilled/run/{agg.py => run_agg.py} (100%) rename message_ix_buildings/chilled/run/{main.py => run_main.py} (100%) rename message_ix_buildings/chilled/run/{preprocess.py => run_preprocess.py} (100%) diff --git a/message_ix_buildings/chilled/run/agg.py b/message_ix_buildings/chilled/run/run_agg.py similarity index 100% rename from message_ix_buildings/chilled/run/agg.py rename to message_ix_buildings/chilled/run/run_agg.py diff --git a/message_ix_buildings/chilled/run/main.py b/message_ix_buildings/chilled/run/run_main.py similarity index 100% rename from message_ix_buildings/chilled/run/main.py rename to message_ix_buildings/chilled/run/run_main.py diff --git a/message_ix_buildings/chilled/run/preprocess.py b/message_ix_buildings/chilled/run/run_preprocess.py similarity index 100% rename from message_ix_buildings/chilled/run/preprocess.py rename to message_ix_buildings/chilled/run/run_preprocess.py From ccd2f158ee877a4f3caad0d0bcc390c927796414 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 18 Jul 2024 09:25:01 +0200 Subject: [PATCH 091/114] Move run files --- message_ix_buildings/chilled/{run => }/run_agg.py | 0 message_ix_buildings/chilled/{run => }/run_main.py | 0 message_ix_buildings/chilled/{run => }/run_preprocess.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename message_ix_buildings/chilled/{run => }/run_agg.py (100%) rename message_ix_buildings/chilled/{run => }/run_main.py (100%) rename message_ix_buildings/chilled/{run => }/run_preprocess.py (100%) diff --git a/message_ix_buildings/chilled/run/run_agg.py b/message_ix_buildings/chilled/run_agg.py similarity index 100% rename from message_ix_buildings/chilled/run/run_agg.py rename to message_ix_buildings/chilled/run_agg.py diff --git a/message_ix_buildings/chilled/run/run_main.py b/message_ix_buildings/chilled/run_main.py similarity index 100% rename from message_ix_buildings/chilled/run/run_main.py rename to message_ix_buildings/chilled/run_main.py diff --git a/message_ix_buildings/chilled/run/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py similarity index 100% rename from message_ix_buildings/chilled/run/run_preprocess.py rename to message_ix_buildings/chilled/run_preprocess.py From 1ab9b5f60039c4716950d54e2bddb5cedaa9748d Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 18 Jul 2024 09:28:11 +0200 Subject: [PATCH 092/114] Remove `run` submodule --- message_ix_buildings/chilled/run/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 message_ix_buildings/chilled/run/__init__.py diff --git a/message_ix_buildings/chilled/run/__init__.py b/message_ix_buildings/chilled/run/__init__.py deleted file mode 100644 index e69de29..0000000 From c52c31413f17bd9bc8386aded7895f386877b866 Mon Sep 17 00:00:00 2001 From: meas Date: Wed, 24 Jul 2024 10:47:38 +0200 Subject: [PATCH 093/114] Update doc/chilled.rst Co-authored-by: Fridolin Glatter <83776373+glatterf42@users.noreply.github.com> --- doc/chilled.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/chilled.rst b/doc/chilled.rst index 78991ea..df17e86 100644 --- a/doc/chilled.rst +++ b/doc/chilled.rst @@ -3,7 +3,7 @@ CHILLED (:mod:`.chilled`) ************************* -:mod:`.chilled` (Cooling and Heating gLobaL Energy Demand) is a model that assesses the impacts of climate change (temperature change) +:mod:`.chilled` (Cooling and HeatIng gLobaL Energy Demand) is a model that assesses the impacts of climate change (temperature change). Methods ======= From 8b10f9b31ed34bed6a346b33af5784fc01cda75e Mon Sep 17 00:00:00 2001 From: meas Date: Wed, 24 Jul 2024 10:47:54 +0200 Subject: [PATCH 094/114] Update doc/chilled.rst Co-authored-by: Fridolin Glatter <83776373+glatterf42@users.noreply.github.com> --- doc/chilled.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/chilled.rst b/doc/chilled.rst index df17e86..bafa41f 100644 --- a/doc/chilled.rst +++ b/doc/chilled.rst @@ -29,7 +29,7 @@ When specifying a version, CHILLED will look in the `/data/chilled/version` dire Usage ===== -The preprocessing (preparing MESSAGE region rasters and country codes) happens without specifying GCM or RCP scenario. Therefore, it can be run first on its own using the following command (from the within :mod:`chilled.run`): +The preprocessing (preparing MESSAGE region rasters and country codes) happens without specifying GCM or RCP scenario. Therefore, it can be run first on its own using the following command (from within :mod:`chilled.run`): .. code-block:: bash From 9d20b9857e9840d0498921c91a74ace64ff8a0b1 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 24 Jul 2024 14:32:59 +0200 Subject: [PATCH 095/114] Clean up `config` with additional comments and removing unused parts --- message_ix_buildings/chilled/utils/config.py | 258 +++++++++---------- 1 file changed, 123 insertions(+), 135 deletions(-) diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/utils/config.py index 6a3aa28..693bfe2 100644 --- a/message_ix_buildings/chilled/utils/config.py +++ b/message_ix_buildings/chilled/utils/config.py @@ -10,45 +10,139 @@ class Config: """Configuration for :mod:`.message_ix_buildings.chilled`.""" - # SPECIFY USER + #: Select user to set the paths to the project and data directories. + #: + #: One of: "ALE", "ED", "MEAS", "MEAS_EBRO", "MEAS_UNICC". user: Literal["ALE", "ED", "MEAS", "MEAS_EBRO", "MEAS_UNICC"] = "MEAS_UNICC" - # print(f"USER: {user}") - project_path = DICT_USER_SETTINGS[user]["project_path"] - dle_path = DICT_USER_SETTINGS[user]["dle_path"] - message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] - isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] - isimip_ewemib_path = DICT_USER_SETTINGS[user]["isimip_ewembi_path"] - chunk_size = DICT_USER_SETTINGS[user]["chunk_size"] - - # RUN SETTINGS - paranalysis_mode = 1 # 1 = run entire parametric analysis; 0 = run only ref case - runsdd = 0 # 1= run simple (standard) degree days calculation; 0 = don't run - - # Netcdf settings - netcdf4_format = "NETCDF4_CLASSIC" - comp = dict(zlib=True, complevel=5) # Compression between 0 and 9 (highest) + #: Set the version of the module run. + #: + #: This is used to name the output files and directories. + vstr: str = "ALPS2023" - # TESTING MODE - testing_mode = 0 # 1= selects only two years for testing; 0= select all years (full calculation) - - # VERSION SETTINGS - vstr: str = "ALPS2023" # version input data - vstrcntry = "v4" # version string for country data and floor surface + #: Select the climate model. + #: + #: One of: "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0-LL". gcm: Literal[ "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0-LL" ] = "GFDL-ESM4" - # SCENARIO SETTINGS - rcps = ["ssp126", "ssp370", "ssp585", "baseline"] # list all possible scenarios + #: Select RCP scenario. + #: + #: One of: "ssp126", "ssp370", "ssp585", "baseline". rcp: Literal["ssp126", "ssp370", "ssp585", "baseline"] = "baseline" + #: List all possible RCP scenarios. + rcps = ["ssp126", "ssp370", "ssp585", "baseline"] + + #: Set what data to use for the RCP scenario. + #: If rcp is "baseline", then use "ssp126" data. + #: Otherwise, use the data corresponding to the RCP scenario selected. if rcp == "baseline": rcpdata = "ssp126" else: rcpdata = rcp - # CLIMATIC DATA INPUTS + #: Select the version of the country data and floor surface. + vstrcntry = "v4" # version string for country data and floor surface + + #: Set paranalysys mode + #: + #: 1 = run entire parametric analysis + #: 0 = run only ref case + paranalysis_mode = 1 # 1 = run entire parametric analysis; 0 = run only ref case + + #: Select whether to run simple (standard) degree days calculation. + #: + #: 1 = run simple (standard) degree days calculation + #: 0 = don't run + runsdd = 0 # 1= run simple (standard) degree days calculation; 0 = don't run + + #: Select whether to run testing mode. + #: + #: 1 = selects only two years for testing + #: 0 = select all years (full calculation) + testing_mode = 0 + + #: Select whether to fix population to SSP2. + popfix = True # If True, fix to SSP2, else.... (see script 4/5) + + #: Select construction setting. + constr_setting = 0 + + #: Select floor setting. One of: + #: + #: - "std_cap": standard capacity + #: - "per_cap": per capita + floor_setting: Literal["std_cap", "per_cap"] = "std_cap" + + #: Select building archetypes setting. One of: + #: + #: - "fixed": fixed values (same for all regions) + #: - "regional": different values by MESSAGE region + arch_setting: Literal["fixed", "regional"] = "regional" + + #: Select urban/rural disaggregations. + #: Multiple options are allowed. Options: + #: + #: - "urban": urban areas + #: - "rural": rural areas + urts = ["urban", "rural"] + + #: Select option whether to have verbose output + verbose = True + + #: Select whether to run cooling calculations. + #: + #: 1 = calculate + #: 0 = skip + cool = 1 + + #: Select whether to run heating calculations. + #: + #: 1 = calculate + #: 0 = skip + heat = 0 + + #: Select solar gain calculation. One of: + #: + #: - "TOT": from windows and roof + #: - "VERT": from windows only + #: - "HOR": from windows only + solar_gains: Literal["TOT", "VERT", "HOR"] = "TOT" + + #: Select temperature variable. One of: + #: + #: - "tas": near-surface air temperature + #: - "twb": wet-bulb temperature + var: Literal["tas", "twb"] = "tas" + + #: Set variable based on temperature variable. + if var == "tas": + davar = "tas" + elif var == "twb": + davar = "twb" + + overwrite = 0 + + #: Spatial resolution + #: Currently only "R11" is supported. + #: TODO: In the future, support "R12". + node: Literal["R11"] = "R11" + + #: Paths settings by user + project_path = DICT_USER_SETTINGS[user]["project_path"] + dle_path = DICT_USER_SETTINGS[user]["dle_path"] + message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] + isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] + isimip_ewemib_path = DICT_USER_SETTINGS[user]["isimip_ewembi_path"] + chunk_size = DICT_USER_SETTINGS[user]["chunk_size"] + + #: NetCDF settings + netcdf4_format = "NETCDF4_CLASSIC" + comp = dict(zlib=True, complevel=5) # Compression between 0 and 9 (highest) + + #: Climate years dictionary settings. if rcp == "baseline": yeardic = { "2015": ("2015", "2020"), @@ -76,58 +170,7 @@ class Config: "2100": ("2095", "2100"), } - # climatic inputs for sensitivity runs - # clims = ["hist"] # options: "hist", "1p5" - # clims = list(yeardic.keys()) - - # POPULATION SETTINGS - popfix = True # If True, fix to SSP2, else.... (see script 4/5) - - # BUILDING SCENARIO SETTINGS - - # CONMSTRUCTION MATERIAL SHARES - constr_setting = 0 - - # FLOOR_SETTING CHOICE - # Choose per_cap for different values by MESSAGE region or std_cap for fixed values - floor_setting = "std_cap" # v16; options: "std_cap", "per_cap" - - # BUILDING ARCHETYPE SETTINGS - # Choose "regional" for different values by MESSAGE region or "fixed" for fixed values - # (same for all regions) - arch_setting = "regional" # options: ["fixed", "regional"] - - # URBAN/RURAL DISAGGREGATIONS - urts = ["urban", "rural"] # options (mult): "urban", "rural" - - # ARCHETYPES - # archs = ["new", "exist"] - - # PARAMETERS FOR STEP 2 SCRIPT - verbose = True - - ## SWITCH COOLING/HEATING CALCULATIONS - ## 1=calculate; 0=skip - heat = 0 - cool = 1 - - # CHOICE: SOLAR GAIN CALCULATION - solar_gains = "TOT" # from windows and roof - # solar_gains = 'VERT' #from windows only - # solar_gains = 'HOR' #from windows only - - # SELECT VAR - var = "tas" - - if var == "tas": - davar = "tas" - elif var == "twb": - davar = "twb" - - overwrite = 0 - - # BULDING PARAMETERS - # Fixed values + #: Fixed values for buildings settings. bal_temps = [18.3, 21.1, 26] # [21.1] # For simple cooling degree days arb_fan = 2 t_sp_h = np.int8(20) # Indoor setpoint temperature for heating @@ -135,6 +178,7 @@ class Config: area_fan = 25 # Numer of m2 per fan gridshape2 = (360, 720) + #: Attributes for netCDF files y2_attrs_dic = { "title": "map_area_env", "authors": "Alessio Mastrucci & Edward Byers", @@ -144,62 +188,6 @@ class Config: "arch_setting": arch_setting, } - # Final maps (y4) parameters + #: Threshold for number of days (?) + #: TODO: check if this is the correct description. nd_thresh = 5 - - # # Load scenarios data - # s_runs = load_all_scenarios_data( - # input_dle_path=DICT_USER_SETTINGS[user]["dle_path"], input_version_name=vstr - # ) - - # # Load paramtric analysis data - # par_var = load_parametric_analysis_data( - # input_dle_path=DICT_USER_SETTINGS[user]["dle_path"], - # input_version_name=vstr, - # input_paranalysis_mode=paranalysis_mode, - # ) - - # #: Base year for projections. - # base_year: int = BASE_YEAR - - # #: Year of convergence; used when :attr:`.method` is "convergence". See - # #: :func:`.create_projections_converge`. - # convergence_year: int = 2050 - - # #: Rate of increase/decrease of fixed operating and maintenance costs. - # fom_rate: float = 0.025 - - # #: Format of output. One of: - # #: - # #: - "iamc": IAMC time series data structure. - # #: - "message": :mod:`message_ix` parameter data. - # format: Literal["iamc", "message"] = "message" - - #: Spatial resolution - node: Literal["R11", "R12", "R20"] = "R11" - - # #: Projection method; one of: - # #: - # #: - "convergence": uses :func:`.create_projections_converge` - # #: - "gdp": :func:`.create_projections_gdp` - # #: - "learning": :func:`.create_projections_converge` - # method: Literal["convergence", "gdp", "learning"] = "gdp" - - # #: Model variant to prepare data for. - # module: Literal["base", "materials"] = "base" - - # #: Reference region; default "{node}_NAM". - # ref_region: Optional[str] = None - - # #: Set of SSPs referenced by :attr:`scenario`. One of: - # #: - # #: - "original": :obj:`SSP_2017` - # #: - "updated": :obj:`SSP_2024` - # scenario_version: Literal["original", "updated"] = "updated" - - # #: Scenario(s) for which to create data. - # scenario: Literal["all", "LED", "SSP1", "SSP2", "SSP3", "SSP4", "SSP5"] = "all" - - # def __post_init__(self): - # if self.ref_region is None: - # self.ref_region = f"{self.node}_NAM" From 47052d02dfdc85847de9ea861b5696157b697761 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 24 Jul 2024 14:33:20 +0200 Subject: [PATCH 096/114] Remove `type: ignore` from pandas import --- message_ix_buildings/chilled/analysis/aggregate.py | 2 +- message_ix_buildings/chilled/analysis/check_pop.py | 3 +-- message_ix_buildings/chilled/archive/vdd_functions.py | 2 +- message_ix_buildings/chilled/functions/regression.py | 2 +- message_ix_buildings/chilled/main/climate.py | 2 +- message_ix_buildings/chilled/postprocess/postprocess.py | 2 +- message_ix_buildings/chilled/preprocess/message_raster.py | 4 ++-- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/message_ix_buildings/chilled/analysis/aggregate.py b/message_ix_buildings/chilled/analysis/aggregate.py index 538b997..9e6edbe 100644 --- a/message_ix_buildings/chilled/analysis/aggregate.py +++ b/message_ix_buildings/chilled/analysis/aggregate.py @@ -1,7 +1,7 @@ import glob import os -import pandas as pd # type: ignore +import pandas as pd from sklearn.utils.fixes import parse_version, sp_version # type: ignore from message_ix_buildings.chilled.variable_dicts import SCENARIO_NAMES diff --git a/message_ix_buildings/chilled/analysis/check_pop.py b/message_ix_buildings/chilled/analysis/check_pop.py index fea6029..97fd736 100644 --- a/message_ix_buildings/chilled/analysis/check_pop.py +++ b/message_ix_buildings/chilled/analysis/check_pop.py @@ -1,7 +1,7 @@ import os from itertools import product -import pandas as pd # type: ignore +import pandas as pd import xarray as xr from message_ix_buildings.chilled.functions.variable_dicts import ( @@ -10,7 +10,6 @@ VARUNDICT_COOL, VARUNDICT_HEAT, ) -from message_ix_buildings.chilled.utils.config import Config vstr = cfg.vstr vstrcntry = cfg.vstrcntry diff --git a/message_ix_buildings/chilled/archive/vdd_functions.py b/message_ix_buildings/chilled/archive/vdd_functions.py index eccdd89..4ab3759 100644 --- a/message_ix_buildings/chilled/archive/vdd_functions.py +++ b/message_ix_buildings/chilled/archive/vdd_functions.py @@ -7,7 +7,7 @@ import cartopy.feature as cfeature # type: ignore import matplotlib.pyplot as plt # type: ignore import numpy as np -import pandas as pd # type: ignore +import pandas as pd import pyam # type: ignore import xarray as xr from dask.diagnostics import ProgressBar diff --git a/message_ix_buildings/chilled/functions/regression.py b/message_ix_buildings/chilled/functions/regression.py index cf06fc6..f49c93d 100644 --- a/message_ix_buildings/chilled/functions/regression.py +++ b/message_ix_buildings/chilled/functions/regression.py @@ -1,6 +1,6 @@ import os -import pandas as pd # type: ignore +import pandas as pd import pyam # type: ignore import statsmodels.formula.api as smf # type: ignore diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/main/climate.py index 872200d..8429de0 100644 --- a/message_ix_buildings/chilled/main/climate.py +++ b/message_ix_buildings/chilled/main/climate.py @@ -7,7 +7,7 @@ import cartopy.feature as cfeature # type: ignore import matplotlib.pyplot as plt # type: ignore import numpy as np -import pandas as pd # type: ignore +import pandas as pd import xarray as xr from dask.diagnostics import ProgressBar from functions.buildings_funcs_grid import ( diff --git a/message_ix_buildings/chilled/postprocess/postprocess.py b/message_ix_buildings/chilled/postprocess/postprocess.py index e99f089..6ea212c 100644 --- a/message_ix_buildings/chilled/postprocess/postprocess.py +++ b/message_ix_buildings/chilled/postprocess/postprocess.py @@ -1,6 +1,6 @@ import os -import pandas as pd # type: ignore +import pandas as pd from message_ix_buildings.chilled.utils.config import Config diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 40437b1..3087728 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -6,8 +6,8 @@ import os import numpy as np -import pandas as pd # type: ignore -import xarray as xr # type: ignore +import pandas as pd +import xarray as xr from utils.config import Config # type: ignore From b8fb3cb7257428377df684ac4e9ce4feaa201a51 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 24 Jul 2024 14:36:39 +0200 Subject: [PATCH 097/114] Untrack user_settings and add to .gitignore --- .gitignore | 5 +- .../chilled/functions/user_settings.py | 49 ------------------- 2 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 message_ix_buildings/chilled/functions/user_settings.py diff --git a/.gitignore b/.gitignore index 358bc77..4aa4bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,7 @@ doc/_build .DS_Store # Scratch code -scratch* \ No newline at end of file +scratch* + +# CHILLED user settings +user_settings.py \ No newline at end of file diff --git a/message_ix_buildings/chilled/functions/user_settings.py b/message_ix_buildings/chilled/functions/user_settings.py deleted file mode 100644 index 2fa1ee2..0000000 --- a/message_ix_buildings/chilled/functions/user_settings.py +++ /dev/null @@ -1,49 +0,0 @@ -DICT_USER_SETTINGS = { - "ALE": { - "chunk_size": 30, - "sys_path": "C:\\Users\\mastrucc\\Documents\\cc_ene_dem", - "dle_path": "C:\\Users\\mastrucc.IIASA2003\\IIASA\\DLE - Climate impacts and space conditioning\\Data\\input_data\\", - "isimip_bias_adj_path": "P:\\watxene\\ISIMIP\\ISIMIP3b\\InputData\\climate_updated\\bias-adjusted\\", - "isimip_ewembi_path": "P:\\watxene\\ISIMIP\\ISIMIP2a_hist\\input\\EWEMBI\\", - "message_region_map_file": "P:\\ene.model3\\data\\powerplants\\MESSAGE data\\MESSAGEix_country_region_map.xlsx", - "ar6_snapshot_file": "path\\to\\AR6_Scenarios_Database_World_v1.1.csv", - }, - "ED": { - "chunk_size": 360, - "sys_path": "C:\\github\\cc_ene_dem", - "dle_path": "C:\\Users\\byers\\IIASA\\DLE - Climate impacts and space conditioning\\Data\\input_data", - "isimip_bias_adj_path": "P:\\watxene\\ISIMIP\\ISIMIP3b\\InputData\\climate_updated\\bias-adjusted\\", - "isimip_ewembi_path": "P:\\watxene\\ISIMIP\\ISIMIP2a_hist\\input\\EWEMBI\\", - "message_region_map_file": "P:\\ene.model\\data\\powerplants\\MESSAGE data\\MESSAGEix_country_region_map.xlsx", - "ar6_snapshot_file": "C:\\Users\\byers\\IIASA\\IPCC WG3 Chapter 3 - Documents\\IPCC_AR6DB\\snapshots\\snapshot_ar6_public_v1.1\\uploaded\\AR6_Scenarios_Database_World_v1.1.csv", - }, - "MEAS": { - "chunk_size": 125, - "sys_path": "/Users/meas/iiasagit/cc_ene_dem", - "chilled_data_path": "/Users/meas/Library/CloudStorage/OneDrive-SharedLibraries-IIASA/DLE - Analysis/Climate impacts and space conditioning/Data/chilled", - "dle_path": "/Users/meas/Library/CloudStorage/OneDrive-SharedLibraries-IIASA/DLE - Analysis/Climate impacts and space conditioning/Data", - "isimip_bias_adj_path": "/Volumes/mengm.pdrv/watxene/ISIMIP/ISIMIP3b/InputData/climate_updated/bias-adjusted", - "isimip_ewembi_path": "/Volumes/mengm.pdrv/watxene/ISIMIP/ISIMIP2a_hist/input/EWEMBI", - "message_region_map_file": "/Volumes/mengm.pdrv/ene.model/data/powerplants/MESSAGE data/MESSAGEix_country_region_map.xlsx", - "ar6_snapshot_file": "/Users/meas/Documents/data/ar6/1668008312256-AR6_Scenarios_Database_World_v1.1.csv/AR6_Scenarios_Database_World_v1.1.csv", - }, - "MEAS_EBRO": { - "chunk_size": 360, - "sys_path": "H:\\MyDocuments\\repos\\cc_ene_dem", - "dle_path": "D:\\mengm\\IIASA\\DLE - Data", - "isimip_bias_adj_path": "P:\\watxene\\ISIMIP\\ISIMIP3b\\InputData\\climate_updated\\bias-adjusted", - "isimip_ewembi_path": "P:\\watxene\\ISIMIP\\ISIMIP2a_hist\\input\\EWEMBI", - "message_region_map_file": "P:\\ene.model\\data\\powerplants\\MESSAGE data\\MESSAGEix_country_region_map.xlsx", - "ar6_snapshot_file": "D:\\mengm\\IIASA\\DLE - Data\\input_data\\AR6_Scenarios_Database_World\\AR6_Scenarios_Database_World_v1.1.csv", - }, - "MEAS_UNICC": { - "chunk_size": 450, - "sys_path": "/home/mengm/repo/message-ix-buildings", - "project_path": "/projects/chilled", - "dle_path": "/projects/chilled/data/input_data/", - "isimip_bias_adj_path": "/pdrive/projects/watxene/ISIMIP/ISIMIP3b/InputData/climate_updated/bias-adjusted", - "isimip_ewembi_path": "/pdrive/projects/watxene/ISIMIP/ISIMIP2a_hist/input/EWEMBI", - "message_region_map_file": "/pdrive/projects/ene.model3/data/powerplants/MESSAGE data/MESSAGEix_country_region_map.xlsx", - "ar6_snapshot_file": "/projects/chilled/data/ar6/1668008312256-AR6_Scenarios_Database_World_v1.1.csv/AR6_Scenarios_Database_World_v1.1.csv", - }, -} From f71860338623859f4a302c5410d7998836e9c2f4 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 25 Jul 2024 11:31:51 +0200 Subject: [PATCH 098/114] Rename `main` submodule to `core` --- message_ix_buildings/chilled/{main => core}/__init__.py | 0 message_ix_buildings/chilled/{main => core}/climate.py | 0 message_ix_buildings/chilled/run_agg.py | 2 +- message_ix_buildings/chilled/run_main.py | 4 +++- 4 files changed, 4 insertions(+), 2 deletions(-) rename message_ix_buildings/chilled/{main => core}/__init__.py (100%) rename message_ix_buildings/chilled/{main => core}/climate.py (100%) diff --git a/message_ix_buildings/chilled/main/__init__.py b/message_ix_buildings/chilled/core/__init__.py similarity index 100% rename from message_ix_buildings/chilled/main/__init__.py rename to message_ix_buildings/chilled/core/__init__.py diff --git a/message_ix_buildings/chilled/main/climate.py b/message_ix_buildings/chilled/core/climate.py similarity index 100% rename from message_ix_buildings/chilled/main/climate.py rename to message_ix_buildings/chilled/core/climate.py diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index 345cb1d..573c178 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -2,7 +2,7 @@ import sys from argparse import ArgumentParser -from main.climate import process_iso_tables +from core.climate import process_iso_tables from utils.config import Config # type: ignore diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index abf3d60..1e7968e 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -2,7 +2,7 @@ import sys from argparse import ArgumentParser -from main.climate import ( +from core.climate import ( aggregate_urban_rural_files, create_climate_variables_maps, make_vdd_total_maps, @@ -109,3 +109,5 @@ def main(args=None): if __name__ == "__main__": main() +if __name__ == "__main__": + main() From 278d0874956c91cbad356a0d8d8135cb6492c871 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 25 Jul 2024 11:36:45 +0200 Subject: [PATCH 099/114] Rename `utils` submodule to `util` --- message_ix_buildings/chilled/archive/preprocess.py | 4 ++-- message_ix_buildings/chilled/core/climate.py | 4 ++-- message_ix_buildings/chilled/postprocess/postprocess.py | 2 +- message_ix_buildings/chilled/preprocess/archetypes.py | 4 ++-- message_ix_buildings/chilled/preprocess/message_raster.py | 2 +- message_ix_buildings/chilled/run_agg.py | 2 +- message_ix_buildings/chilled/run_main.py | 2 +- message_ix_buildings/chilled/run_preprocess.py | 2 +- message_ix_buildings/chilled/{utils => util}/__init__.py | 0 message_ix_buildings/chilled/{utils => util}/config.py | 0 message_ix_buildings/chilled/{utils => util}/util.py | 8 ++------ 11 files changed, 13 insertions(+), 17 deletions(-) rename message_ix_buildings/chilled/{utils => util}/__init__.py (100%) rename message_ix_buildings/chilled/{utils => util}/config.py (100%) rename message_ix_buildings/chilled/{utils => util}/util.py (93%) diff --git a/message_ix_buildings/chilled/archive/preprocess.py b/message_ix_buildings/chilled/archive/preprocess.py index 6fce54d..a8b79d4 100644 --- a/message_ix_buildings/chilled/archive/preprocess.py +++ b/message_ix_buildings/chilled/archive/preprocess.py @@ -3,11 +3,11 @@ from itertools import product import numpy as np -import pandas as pd # type: ignore +import pandas as pd import xarray as xr from dask.diagnostics import ProgressBar -from message_ix_buildings.chilled.utils.config import Config +from message_ix_buildings.chilled.util.config import Config from message_ix_buildings.chilled.functions.buildings_funcs_grid import ( P_f, Q_c_tmax, diff --git a/message_ix_buildings/chilled/core/climate.py b/message_ix_buildings/chilled/core/climate.py index 8429de0..d614751 100644 --- a/message_ix_buildings/chilled/core/climate.py +++ b/message_ix_buildings/chilled/core/climate.py @@ -41,8 +41,8 @@ VARUNDICT_HEAT, ) from preprocess.message_raster import create_message_raster # type: ignore -from utils.config import Config # type: ignore -from utils.util import get_archs, load_all_scenarios_data, load_parametric_analysis_data +from util.config import Config # type: ignore +from util.util import get_archs, load_all_scenarios_data, load_parametric_analysis_data def create_climate_variables_maps(config: "Config", start_time: datetime.datetime): diff --git a/message_ix_buildings/chilled/postprocess/postprocess.py b/message_ix_buildings/chilled/postprocess/postprocess.py index 6ea212c..9b061c4 100644 --- a/message_ix_buildings/chilled/postprocess/postprocess.py +++ b/message_ix_buildings/chilled/postprocess/postprocess.py @@ -2,7 +2,7 @@ import pandas as pd -from message_ix_buildings.chilled.utils.config import Config +from message_ix_buildings.chilled.util.config import Config cfg = Config() diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index 0cf46ad..c5d60e1 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -10,8 +10,8 @@ import xarray as xr from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from preprocess.message_raster import create_message_raster # type: ignore -from utils.config import Config # type: ignore -from utils.util import get_archs, read_arch_inputs_df, read_arch_reg_df +from util.config import Config # type: ignore +from util.util import get_archs, read_arch_inputs_df, read_arch_reg_df def create_archetypes(config: "Config"): diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index 3087728..ebb611f 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -8,7 +8,7 @@ import numpy as np import pandas as pd import xarray as xr -from utils.config import Config # type: ignore +from util.config import Config # type: ignore def create_message_raster(config: "Config"): diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index 573c178..bcafbf1 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -3,7 +3,7 @@ from argparse import ArgumentParser from core.climate import process_iso_tables -from utils.config import Config # type: ignore +from util.config import Config # type: ignore def parse_arguments(arguments): diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 1e7968e..ba3e02a 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -12,7 +12,7 @@ process_floor_area_maps, process_iso_tables, ) -from utils.config import Config # type: ignore +from util.config import Config # type: ignore def parse_arguments(arguments): diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 8105198..014405d 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -2,7 +2,7 @@ from argparse import ArgumentParser from preprocess.archetypes import create_archetype_variables, create_archetypes -from utils.config import Config # type: ignore +from util.config import Config # type: ignore def parse_arguments(arguments): diff --git a/message_ix_buildings/chilled/utils/__init__.py b/message_ix_buildings/chilled/util/__init__.py similarity index 100% rename from message_ix_buildings/chilled/utils/__init__.py rename to message_ix_buildings/chilled/util/__init__.py diff --git a/message_ix_buildings/chilled/utils/config.py b/message_ix_buildings/chilled/util/config.py similarity index 100% rename from message_ix_buildings/chilled/utils/config.py rename to message_ix_buildings/chilled/util/config.py diff --git a/message_ix_buildings/chilled/utils/util.py b/message_ix_buildings/chilled/util/util.py similarity index 93% rename from message_ix_buildings/chilled/utils/util.py rename to message_ix_buildings/chilled/util/util.py index ad007ba..ea7c825 100644 --- a/message_ix_buildings/chilled/utils/util.py +++ b/message_ix_buildings/chilled/util/util.py @@ -1,8 +1,8 @@ import os from pathlib import Path -import pandas as pd # type: ignore -from utils.config import Config # type: ignore +import pandas as pd +from util.config import Config # type: ignore def get_project_root() -> Path: @@ -44,10 +44,6 @@ def get_archs(config: "Config"): + " does not exist! Please create file for input." ) - # if config.arch_setting == "fixed", then get sheet names of file (these will be the archetypes) - - # if config.arch_setting == "regional", then read in the single file and get the unique values of the "arch" column - def read_arch_inputs_df(config: "Config", suff: str): root_path = get_project_root() From 062a280b71ec8db824f033f60b63cd2745c28243 Mon Sep 17 00:00:00 2001 From: meas Date: Thu, 25 Jul 2024 11:57:46 +0200 Subject: [PATCH 100/114] Update doc/chilled.rst Co-authored-by: Fridolin Glatter <83776373+glatterf42@users.noreply.github.com> --- doc/chilled.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/chilled.rst b/doc/chilled.rst index bafa41f..fd7e40d 100644 --- a/doc/chilled.rst +++ b/doc/chilled.rst @@ -21,6 +21,7 @@ Parameters In this module, the "version" refers to the version of the model, not the version of the data. For example, the "ALPS2023" version refers to the set of scenario inputs/parameters for the "ALPS2023" run. When specifying a version, CHILLED will look in the `/data/chilled/version` directory that the version name exists and that the following files exist as well: + - `arch_input_reg.xlsx` (or `arch_input.xlsx`) - `arch_regions.xlsx` - `par_var.csv` From f28d58bccef499cd7dad3e39ffb259dee1ddea69 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 25 Jul 2024 12:09:33 +0200 Subject: [PATCH 101/114] Use `rich.progress` to loop through functions --- message_ix_buildings/chilled/run_main.py | 40 ++++++++++-------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index ba3e02a..5a9661f 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -12,6 +12,7 @@ process_floor_area_maps, process_iso_tables, ) +from rich.progress import track # type: ignore from util.config import Config # type: ignore @@ -77,34 +78,25 @@ def main(args=None): parsed_args = parse_arguments(arguments=args) - # Run the main function + # Run the core functions start = datetime.datetime.now() print_arguments(parsed_arguments=parsed_args) cfg = create_config(parsed_arguments=parsed_args) - print("RUNNING create_climate_variables_maps()........") - create_climate_variables_maps(cfg, start) - - print("RUNNING aggregate_urban_rural_files()........") - aggregate_urban_rural_files(cfg) - - print("RUNNING make_vdd_total_maps()........") - make_vdd_total_maps(cfg) - - print("RUNNING process_construction_shares()........") - process_construction_shares(cfg) - - print("RUNNING process_floor_area_maps()........") - process_floor_area_maps(cfg) - - print("RUNNING process_country_maps()........") - process_country_maps(cfg) - - print("RUNNING process_final_maps()........") - process_final_maps(cfg) - - print("RUNNING process_iso_tables()........") - process_iso_tables(cfg) + steps = [ + create_climate_variables_maps(cfg, start), + aggregate_urban_rural_files(cfg), + make_vdd_total_maps(cfg), + process_construction_shares(cfg), + process_floor_area_maps(cfg), + process_country_maps(cfg), + process_final_maps(cfg), + process_iso_tables(cfg), + ] + + for step in track(steps, description="Running functions: "): + print(f"RUNNING {step.__name__}()........") + step() if __name__ == "__main__": From a07aae6610a0b113b45e63c7e32cb9138c13b9db Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 25 Jul 2024 12:27:09 +0200 Subject: [PATCH 102/114] Reconfigure progress tracking --- message_ix_buildings/chilled/run_main.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index 5a9661f..e57e156 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -83,20 +83,15 @@ def main(args=None): print_arguments(parsed_arguments=parsed_args) cfg = create_config(parsed_arguments=parsed_args) - steps = [ - create_climate_variables_maps(cfg, start), - aggregate_urban_rural_files(cfg), - make_vdd_total_maps(cfg), - process_construction_shares(cfg), - process_floor_area_maps(cfg), - process_country_maps(cfg), - process_final_maps(cfg), - process_iso_tables(cfg), - ] - - for step in track(steps, description="Running functions: "): - print(f"RUNNING {step.__name__}()........") - step() + for step in track([cfg], description="Running core functions..."): + (create_climate_variables_maps(step, start),) + (aggregate_urban_rural_files(step),) + (make_vdd_total_maps(step),) + (process_construction_shares(step),) + (process_floor_area_maps(step),) + (process_country_maps(step),) + (process_final_maps(step),) + (process_iso_tables(step),) if __name__ == "__main__": From 0e67f2bcf7e7046c4bb5645dfcceaa74681485fd Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 25 Jul 2024 16:37:21 +0200 Subject: [PATCH 103/114] Fix input data path --- message_ix_buildings/chilled/core/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/core/climate.py b/message_ix_buildings/chilled/core/climate.py index d614751..20f1546 100644 --- a/message_ix_buildings/chilled/core/climate.py +++ b/message_ix_buildings/chilled/core/climate.py @@ -1216,7 +1216,7 @@ def process_construction_shares(config: "Config"): def process_floor_area_maps(config: "Config"): - input_path = config.dle_path + input_path = os.path.join(config.dle_path, "input_data") out_path = os.path.join(config.project_path, "out", "version", config.vstr) save_path = os.path.join(out_path, "floorarea_country") From d68f29b41d00f1fcc2c6219116c45becc528a3ec Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 25 Jul 2024 16:46:07 +0200 Subject: [PATCH 104/114] Switch path adjustment to user_settings --- message_ix_buildings/chilled/core/climate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/core/climate.py b/message_ix_buildings/chilled/core/climate.py index 20f1546..d614751 100644 --- a/message_ix_buildings/chilled/core/climate.py +++ b/message_ix_buildings/chilled/core/climate.py @@ -1216,7 +1216,7 @@ def process_construction_shares(config: "Config"): def process_floor_area_maps(config: "Config"): - input_path = os.path.join(config.dle_path, "input_data") + input_path = config.dle_path out_path = os.path.join(config.project_path, "out", "version", config.vstr) save_path = os.path.join(out_path, "floorarea_country") From 2021291fdb4d8f7e467e7f10256f1c1b6b15e5dd Mon Sep 17 00:00:00 2001 From: Fridolin Glatter Date: Thu, 25 Jul 2024 18:05:26 +0200 Subject: [PATCH 105/114] Fix imports to enable doc-building * Address linting issues --- .../chilled/preprocess/message_raster.py | 11 ++++++----- message_ix_buildings/chilled/util/config.py | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index ebb611f..f8bfad6 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -8,7 +8,8 @@ import numpy as np import pandas as pd import xarray as xr -from util.config import Config # type: ignore + +from message_ix_buildings.chilled.util.config import Config def create_message_raster(config: "Config"): @@ -59,10 +60,10 @@ def create_message_raster(config: "Config"): for row in iso_attrs.itertuples(): code = row.ISO # get country ISO code regval = msgregions.loc[msgregions.iso_code == code, "RegNum"] - if regval.values.size != 0: - reg_ras.MESSAGE11.values[country_ras.values == float(row.Index)] = ( - regval - ) + if len(regval.values) != 0: + reg_ras.MESSAGE11.values[ + country_ras.values == float(str(row.Index)) + ] = regval else: print(row.Index) print() diff --git a/message_ix_buildings/chilled/util/config.py b/message_ix_buildings/chilled/util/config.py index 693bfe2..2646b52 100644 --- a/message_ix_buildings/chilled/util/config.py +++ b/message_ix_buildings/chilled/util/config.py @@ -3,7 +3,8 @@ from typing import Literal import numpy as np -from functions.user_settings import DICT_USER_SETTINGS # type: ignore + +from message_ix_buildings.chilled.user_settings import DICT_USER_SETTINGS @dataclass @@ -22,7 +23,7 @@ class Config: #: Select the climate model. #: - #: One of: "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0-LL". + #: One of: "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0-LL" gcm: Literal[ "GFDL-ESM4", "IPSL-CM6A-LR", "MPI-ESM1-2-HR", "MRI-ESM2-0", "UKESM1-0-LL" ] = "GFDL-ESM4" @@ -132,7 +133,7 @@ class Config: #: Paths settings by user project_path = DICT_USER_SETTINGS[user]["project_path"] - dle_path = DICT_USER_SETTINGS[user]["dle_path"] + dle_path: str = str(DICT_USER_SETTINGS[user]["dle_path"]) message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] isimip_ewemib_path = DICT_USER_SETTINGS[user]["isimip_ewembi_path"] From 3d485496356cb8d0d97db85ae349a01da5318c2d Mon Sep 17 00:00:00 2001 From: Fridolin Glatter Date: Thu, 25 Jul 2024 18:06:28 +0200 Subject: [PATCH 106/114] Add ruff and required dependencies --- pyproject.toml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 52bae6b..6350c50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,11 @@ repository = "https://github.com/iiasa/message-ix-buildings" documentation = "https://docs.messageix.org/buildings/" [project.optional-dependencies] +chilled = [ + "numpy", + "pandas", + "xarray", +] docs = [ "Sphinx", # required for sphinx-rtd-theme 1.2.2, remove support is added @@ -35,3 +40,32 @@ tests = [ find = {} [tool.setuptools_scm] + +[tool.ruff] +exclude = [ + ".git", + "__pycache__", + "*.egg-info", + ".pytest_cache", + ".mypy_cache", + ".venv", + "example.py", + "import.py", +] +line-length = 88 + +[tool.ruff.format] +# Enable reformatting of code snippets in docstrings. +docstring-code-format = true + +[tool.ruff.lint] +select = ["C9", "E", "F", "I", "W"] +ignore = ["B008"] + +[tool.ruff.lint.per-file-ignores] +# Ignore unused imports: +"__init__.py" = ["F401"] +"user_settings.py" = ["E501"] + +[tool.ruff.lint.mccabe] +max-complexity = 10 From 217e4921fbe967aacda6b56935517004398396b0 Mon Sep 17 00:00:00 2001 From: Fridolin Glatter Date: Thu, 25 Jul 2024 18:06:57 +0200 Subject: [PATCH 107/114] Enable code reference in docs :) --- doc/chilled.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/chilled.rst b/doc/chilled.rst index fd7e40d..2029f8f 100644 --- a/doc/chilled.rst +++ b/doc/chilled.rst @@ -48,21 +48,21 @@ If the `-version` command is not provided, then the default version is "ALPS2023 If the `-gcm` and `-rcp` commands are not provided, then the default GCM is "GFDL-ESM2M" and the default RCP is "baseline". -.. Code reference -.. ============== +Code reference +============== -.. .. automodule:: message_ix_buildings.chilled -.. :members: +.. automodule:: message_ix_buildings.chilled + :members: -.. .. currentmodule:: message_ix_buildings.chilled.preprocess.message_raster +.. currentmodule:: message_ix_buildings.chilled.preprocess.message_raster -.. Create raster of MESSAGE regions (:mod:`~.chilled.preprocess.message_raster`) -.. ----------------------------------------------------------------------------- +Create raster of MESSAGE regions (:mod:`~.chilled.preprocess.message_raster`) +----------------------------------------------------------------------------- -.. .. automodule:: message_ix_buildings.chilled.preprocess.message_raster -.. :members: +.. automodule:: message_ix_buildings.chilled.preprocess.message_raster + :members: -.. .. autosummary:: + .. autosummary:: -.. create_message_raster + create_message_raster From c992902864fda4ca9a204da593bf607c96acbe64 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 1 Aug 2024 11:49:10 +0200 Subject: [PATCH 108/114] Update import paths; specify directories as strings --- message_ix_buildings/chilled/util/config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/message_ix_buildings/chilled/util/config.py b/message_ix_buildings/chilled/util/config.py index 2646b52..cc750ca 100644 --- a/message_ix_buildings/chilled/util/config.py +++ b/message_ix_buildings/chilled/util/config.py @@ -4,7 +4,7 @@ import numpy as np -from message_ix_buildings.chilled.user_settings import DICT_USER_SETTINGS +from message_ix_buildings.chilled.functions.user_settings import DICT_USER_SETTINGS @dataclass @@ -132,11 +132,11 @@ class Config: node: Literal["R11"] = "R11" #: Paths settings by user - project_path = DICT_USER_SETTINGS[user]["project_path"] + project_path: str = str(DICT_USER_SETTINGS[user]["project_path"]) dle_path: str = str(DICT_USER_SETTINGS[user]["dle_path"]) - message_region_file = DICT_USER_SETTINGS[user]["message_region_map_file"] - isimip_bias_adj_path = DICT_USER_SETTINGS[user]["isimip_bias_adj_path"] - isimip_ewemib_path = DICT_USER_SETTINGS[user]["isimip_ewembi_path"] + message_region_file: str = str(DICT_USER_SETTINGS[user]["message_region_map_file"]) + isimip_bias_adj_path: str = str(DICT_USER_SETTINGS[user]["isimip_bias_adj_path"]) + isimip_ewemib_path: str = str(DICT_USER_SETTINGS[user]["isimip_ewembi_path"]) chunk_size = DICT_USER_SETTINGS[user]["chunk_size"] #: NetCDF settings From ee595b441baa199ac54bfd11b86c27b51db79f90 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 1 Aug 2024 11:49:24 +0200 Subject: [PATCH 109/114] Update import paths to absolute --- message_ix_buildings/chilled/core/climate.py | 17 ++++++++++++----- .../chilled/preprocess/archetypes.py | 9 +++++++-- message_ix_buildings/chilled/run_agg.py | 4 ++-- message_ix_buildings/chilled/run_main.py | 7 ++++--- message_ix_buildings/chilled/run_preprocess.py | 7 +++++-- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/message_ix_buildings/chilled/core/climate.py b/message_ix_buildings/chilled/core/climate.py index d614751..5b5cec2 100644 --- a/message_ix_buildings/chilled/core/climate.py +++ b/message_ix_buildings/chilled/core/climate.py @@ -10,7 +10,8 @@ import pandas as pd import xarray as xr from dask.diagnostics import ProgressBar -from functions.buildings_funcs_grid import ( + +from message_ix_buildings.chilled.functions.buildings_funcs_grid import ( P_f, Q_c_tmax, Q_h, @@ -33,16 +34,22 @@ calc_vdd_h, calc_vdd_tmax_c, ) -from functions.variable_dicts import ( +from message_ix_buildings.chilled.functions.variable_dicts import ( VARDICT_COOL, VARDICT_HEAT, VARS_ARCHETYPES, VARUNDICT_COOL, VARUNDICT_HEAT, ) -from preprocess.message_raster import create_message_raster # type: ignore -from util.config import Config # type: ignore -from util.util import get_archs, load_all_scenarios_data, load_parametric_analysis_data +from message_ix_buildings.chilled.preprocess.message_raster import ( + create_message_raster, # type: ignore +) +from message_ix_buildings.chilled.util.config import Config # type: ignore +from message_ix_buildings.chilled.util.util import ( + get_archs, + load_all_scenarios_data, + load_parametric_analysis_data, +) def create_climate_variables_maps(config: "Config", start_time: datetime.datetime): diff --git a/message_ix_buildings/chilled/preprocess/archetypes.py b/message_ix_buildings/chilled/preprocess/archetypes.py index c5d60e1..9dbf41b 100644 --- a/message_ix_buildings/chilled/preprocess/archetypes.py +++ b/message_ix_buildings/chilled/preprocess/archetypes.py @@ -10,8 +10,13 @@ import xarray as xr from functions.variable_dicts import VARS_ARCHETYPES # type: ignore from preprocess.message_raster import create_message_raster # type: ignore -from util.config import Config # type: ignore -from util.util import get_archs, read_arch_inputs_df, read_arch_reg_df + +from message_ix_buildings.chilled.util.config import Config # type: ignore +from message_ix_buildings.chilled.util.util import ( + get_archs, + read_arch_inputs_df, + read_arch_reg_df, +) def create_archetypes(config: "Config"): diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index bcafbf1..f32a2b6 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -2,8 +2,8 @@ import sys from argparse import ArgumentParser -from core.climate import process_iso_tables -from util.config import Config # type: ignore +from message_ix_buildings.chilled.core.climate import process_iso_tables +from message_ix_buildings.chilled.util.config import Config # type: ignore def parse_arguments(arguments): diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index e57e156..c57c9f0 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -2,7 +2,9 @@ import sys from argparse import ArgumentParser -from core.climate import ( +from rich.progress import track # type: ignore + +from message_ix_buildings.chilled.core.climate import ( aggregate_urban_rural_files, create_climate_variables_maps, make_vdd_total_maps, @@ -12,8 +14,7 @@ process_floor_area_maps, process_iso_tables, ) -from rich.progress import track # type: ignore -from util.config import Config # type: ignore +from message_ix_buildings.chilled.util.config import Config # type: ignore def parse_arguments(arguments): diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 014405d..818112c 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -1,8 +1,11 @@ import sys from argparse import ArgumentParser -from preprocess.archetypes import create_archetype_variables, create_archetypes -from util.config import Config # type: ignore +from message_ix_buildings.chilled.preprocess.archetypes import ( + create_archetype_variables, + create_archetypes, +) +from message_ix_buildings.chilled.util.config import Config def parse_arguments(arguments): From 841637ff614fbe90226004d7a76f3a2b0eca905a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 21 Aug 2024 08:55:35 +0200 Subject: [PATCH 110/114] Remove duplicated lines of code --- message_ix_buildings/chilled/run_main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/message_ix_buildings/chilled/run_main.py b/message_ix_buildings/chilled/run_main.py index c57c9f0..365874e 100644 --- a/message_ix_buildings/chilled/run_main.py +++ b/message_ix_buildings/chilled/run_main.py @@ -97,5 +97,3 @@ def main(args=None): if __name__ == "__main__": main() -if __name__ == "__main__": - main() From 4f0acbced8421d481e17a78c87729d9ccb8952a5 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 21 Aug 2024 08:56:05 +0200 Subject: [PATCH 111/114] Uncomment lines of code --- message_ix_buildings/chilled/run_agg.py | 36 ++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/message_ix_buildings/chilled/run_agg.py b/message_ix_buildings/chilled/run_agg.py index f32a2b6..7c472d0 100644 --- a/message_ix_buildings/chilled/run_agg.py +++ b/message_ix_buildings/chilled/run_agg.py @@ -1,8 +1,15 @@ -import datetime import sys from argparse import ArgumentParser -from message_ix_buildings.chilled.core.climate import process_iso_tables +from message_ix_buildings.chilled.core.climate import ( + aggregate_urban_rural_files, + make_vdd_total_maps, + process_construction_shares, + process_country_maps, + process_final_maps, + process_floor_area_maps, + process_iso_tables, +) from message_ix_buildings.chilled.util.config import Config # type: ignore @@ -68,27 +75,26 @@ def main(args=None): parsed_args = parse_arguments(arguments=args) # Run the main function - start = datetime.datetime.now() print_arguments(parsed_arguments=parsed_args) cfg = create_config(parsed_arguments=parsed_args) - # print("RUNNING aggregate_urban_rural_files()........") - # aggregate_urban_rural_files(cfg) + print("RUNNING aggregate_urban_rural_files()........") + aggregate_urban_rural_files(cfg) - # print("RUNNING make_vdd_total_maps()........") - # make_vdd_total_maps(cfg) + print("RUNNING make_vdd_total_maps()........") + make_vdd_total_maps(cfg) - # print("RUNNING process_construction_shares()........") - # process_construction_shares(cfg) + print("RUNNING process_construction_shares()........") + process_construction_shares(cfg) - # print("RUNNING process_floor_area_maps()........") - # process_floor_area_maps(cfg) + print("RUNNING process_floor_area_maps()........") + process_floor_area_maps(cfg) - # print("RUNNING process_country_maps()........") - # process_country_maps(cfg) + print("RUNNING process_country_maps()........") + process_country_maps(cfg) - # print("RUNNING process_final_maps()........") - # process_final_maps(cfg) + print("RUNNING process_final_maps()........") + process_final_maps(cfg) print("RUNNING process_iso_tables()........") process_iso_tables(cfg) From be8513c93a904b4a68b22ba5d78fb2c4b6f8cf8f Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 21 Aug 2024 08:56:47 +0200 Subject: [PATCH 112/114] Remove commented lines of code --- message_ix_buildings/chilled/run_preprocess.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/message_ix_buildings/chilled/run_preprocess.py b/message_ix_buildings/chilled/run_preprocess.py index 818112c..f4541ca 100644 --- a/message_ix_buildings/chilled/run_preprocess.py +++ b/message_ix_buildings/chilled/run_preprocess.py @@ -65,18 +65,3 @@ def main(args=None): if __name__ == "__main__": main() - - -# check to see if "map_reg_MESSAGE_{config.node}.nc" exists -# if not, create the file -# if not os.path.exists( -# os.path.join(cfg.dle_path, "out", "raster", "map_reg_MESSAGE_" + cfg.node + ".nc") -# ): -# create_message_raster(cfg) -# else: -# print(f"map_reg_MESSAGE_{cfg.node}.nc already exists. Using existing file.") - -# run create_archetypes - - -# create maps of archetype variables From 8f17c97770ed1ba401a25be34478a42728bb8f8a Mon Sep 17 00:00:00 2001 From: meas Date: Wed, 21 Aug 2024 10:07:41 +0200 Subject: [PATCH 113/114] Edit `rcpdata` specification code Co-authored-by: Fridolin Glatter <83776373+glatterf42@users.noreply.github.com> --- message_ix_buildings/chilled/util/config.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/message_ix_buildings/chilled/util/config.py b/message_ix_buildings/chilled/util/config.py index cc750ca..f8ba6cb 100644 --- a/message_ix_buildings/chilled/util/config.py +++ b/message_ix_buildings/chilled/util/config.py @@ -39,10 +39,7 @@ class Config: #: Set what data to use for the RCP scenario. #: If rcp is "baseline", then use "ssp126" data. #: Otherwise, use the data corresponding to the RCP scenario selected. - if rcp == "baseline": - rcpdata = "ssp126" - else: - rcpdata = rcp + rcpdata = "ssp126" if rcp == "baseline" else rcp #: Select the version of the country data and floor surface. vstrcntry = "v4" # version string for country data and floor surface From f83883edca808fec7e917c5736a4d8dfb67ac992 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Wed, 21 Aug 2024 10:12:32 +0200 Subject: [PATCH 114/114] Change `print()` statement to `raise TypeError()` --- message_ix_buildings/chilled/preprocess/message_raster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_ix_buildings/chilled/preprocess/message_raster.py b/message_ix_buildings/chilled/preprocess/message_raster.py index f8bfad6..60b3c17 100644 --- a/message_ix_buildings/chilled/preprocess/message_raster.py +++ b/message_ix_buildings/chilled/preprocess/message_raster.py @@ -124,4 +124,4 @@ def create_message_raster(config: "Config"): return country_ras, reg_ras, map_reg, iso_attrs else: - print("Only R11 is supported at the moment.") + raise TypeError("Only R11 is supported at the moment.")