Skip to content

Commit ecc1882

Browse files
author
Kit Schwarz
committed
fixing filepaths for the new mask sublevel
1 parent a3f0e42 commit ecc1882

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dscim/preprocessing/midprocessing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ def update_damage_function_library(
2929

3030

3131
def combine_CAMEL_coefs(
32-
recipe, disc, eta, rho, CAMEL, coastal, AMEL, input_dir, pulse_year=2020, fit=True
32+
recipe, disc, eta, rho, CAMEL, coastal, AMEL, input_dir, mask='unmasked', pulse_year=2020, fit=True
3333
):
3434

3535
print(f"Creating {recipe} {disc} for {CAMEL}...")
36-
os.makedirs(f"{input_dir}/{CAMEL}/{pulse_year}", exist_ok=True)
36+
os.makedirs(f"{input_dir}/{CAMEL}/{pulse_year}/{mask}", exist_ok=True)
3737

3838
coefs, fit = {}, {}
3939

4040
for sector in [coastal, AMEL]:
4141
coefs[
4242
sector
43-
] = f"{input_dir}/{sector}/{pulse_year}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_coefficients.nc4"
43+
] = f"{input_dir}/{sector}/{pulse_year}/{mask}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_coefficients.nc4"
4444

4545
coefs["combined"] = xr.combine_by_coords(
4646
[
@@ -59,15 +59,15 @@ def combine_CAMEL_coefs(
5959
}
6060

6161
coefs["combined"].to_netcdf(
62-
f"{input_dir}/{CAMEL}/{pulse_year}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_coefficients.nc4"
62+
f"{input_dir}/{CAMEL}/{pulse_year}/{mask}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_coefficients.nc4"
6363
)
6464

6565
if fit:
6666

6767
for sector in [coastal, AMEL]:
6868
fit[
6969
sector
70-
] = f"{input_dir}/{sector}/{pulse_year}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_fit.nc4"
70+
] = f"{input_dir}/{sector}/{pulse_year}/{mask}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_fit.nc4"
7171

7272
fit["combined"] = xr.open_dataset(fit[coastal]) + xr.open_dataset(fit[AMEL])
7373

@@ -80,5 +80,5 @@ def combine_CAMEL_coefs(
8080
}
8181

8282
fit["combined"].to_netcdf(
83-
f"{input_dir}/{CAMEL}/{pulse_year}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_fit.nc4"
83+
f"{input_dir}/{CAMEL}/{pulse_year}/{mask}/{recipe}_{disc}_eta{eta}_rho{rho}_damage_function_fit.nc4"
8484
)

dscim/utils/menu_runs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def run_ssps(
9595
if "CAMEL" in sector:
9696
kwargs.update(
9797
{
98-
"damage_function_path": f"{conf['paths']['ssp_damage_function_library']}/{sector}/2020/",
98+
"damage_function_path": f"{conf['paths']['ssp_damage_function_library']}/{sector}/2020/unmasked",
9999
"save_files": [
100100
"damage_function_points",
101101
"marginal_damages",
@@ -213,7 +213,7 @@ def run_rff(
213213
"save_path": save_path,
214214
"eta": eta_rho[0],
215215
"rho": eta_rho[1],
216-
"damage_function_path": f"{conf['paths']['rff_damage_function_library']}/{sector}/2020",
216+
"damage_function_path": f"{conf['paths']['rff_damage_function_library']}/{sector}/2020/unmasked",
217217
"save_files": ["uncollapsed_sccs"],
218218
"ecs_mask_path": None,
219219
"ecs_mask_name": None,

0 commit comments

Comments
 (0)