Skip to content

Commit

Permalink
Fix issue of Nd1, Ndr, and Nfr only being in cool = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
measrainsey committed Dec 19, 2024
1 parent 3589696 commit de60613
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions message_ix_buildings/chilled/core/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1604,36 +1604,36 @@ def process_final_maps(config: "Config"):
# =============================================================================

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)
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)
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)
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)

if config.cool == 1:
E_c_ac = (
xr.open_dataarray(
os.path.join(
Expand Down

0 comments on commit de60613

Please sign in to comment.