Skip to content
Snippets Groups Projects
Commit 1823a1fc authored by Jérémy AUCLAIR's avatar Jérémy AUCLAIR
Browse files

Small changes before 2nd otpimization.

parent e15ab885
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,7 @@ def rasterize_samir_parameters(csv_param_file: str, land_cover_raster: str, irri
# Loop through parameters to count them
count = 0
for parameter in table_param.table.index[1:]:
if parameter == 'Irrig_auto' and table_param.table.at[parameter, 'load_raster'] == 1:
if parameter == 'Irrig_auto' or parameter == 'Init_RU':
pass
else:
count+=1
......@@ -101,11 +101,8 @@ def rasterize_samir_parameters(csv_param_file: str, land_cover_raster: str, irri
elif parameter == 'Init_RU' and table_param.table.at[parameter, 'load_raster'] == 1:
param_list.append(parameter)
# Load initial soil water content
Init_RU = (xr.open_dataarray(init_RU_raster) / 1000).astype(np.float32).values
i+=1
continue
......@@ -813,8 +810,7 @@ def calculate_memory_requirement(x_size: int, y_size: int, time_size: int, nb_in
output_memory_requirement = (x_size * y_size * time_size * nb_outputs * nb_bytes) / (1024**3)
# Total memory requirement
# TODO : add adjustment factor elsewhere
total_memory_requirement = (input_memory_requirement + calculation_memory_requirement + output_memory_requirement) * 1.05 # 5% adjustment factor
total_memory_requirement = (input_memory_requirement + calculation_memory_requirement + output_memory_requirement)
return total_memory_requirement
......@@ -1177,7 +1173,6 @@ def samir_daily(NDVI: np.ndarray, ET0: np.ndarray, Rain: np.ndarray, Wfc: np.nda
Foffset = params[find_index(param_list, 'Foffset')]
Fslope = params[find_index(param_list, 'Fslope')]
frac_TAW = params[find_index(param_list, 'frac_TAW')]
Init_RU = params[find_index(param_list, 'Init_RU')]
Kcbmax = params[find_index(param_list, 'Kcbmax')]
Kcmax = params[find_index(param_list, 'Kcmax')]
Kslope = params[find_index(param_list, 'Kslope')]
......@@ -1448,7 +1443,7 @@ def run_samir(csv_param_file: str, ndvi_cube_path: str, weather_path: str, soil_
nb_outputs = 6 + len(additional_outputs) # DP, E, Irr, SWCe, SWCr, Tr
else:
nb_outputs = 6 # DP, E, Irr, SWCe, SWCr, Tr
nb_variables = 38 # calculation variables (e.g: Dd, Diff_rei, FCov, etc.)
nb_variables = 39 # calculation variables (e.g: Dd, Diff_rei, FCov, etc.)
nb_params = parameter_array.shape[0]
# Get total memory requirement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment