@@ -29,18 +29,18 @@ def update_damage_function_library(
2929
3030
3131def 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 )
0 commit comments