Skip to content
Snippets Groups Projects
Commit 6f9d8484 authored by Brita Linnestad's avatar Brita Linnestad
Browse files

Use RISK_*tif files to count files to be added in map

parent a3023acd
Branches
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ def create_dataset(): ...@@ -84,7 +84,7 @@ def create_dataset():
def create_warning_status(start_date): def create_warning_status(start_date):
risk_files = glob.glob(f"{outtmp_path}/final_*.nc") risk_files = glob.glob(f"{outfile_path}/RISK_*.nc")
# Classifying warning status for the WHS model # Classifying warning status for the WHS model
# 0 == RISK --> Grey # 0 == RISK --> Grey
...@@ -98,7 +98,7 @@ def create_warning_status(start_date): ...@@ -98,7 +98,7 @@ def create_warning_status(start_date):
subprocess.run(f'cdo -aexpr,"WARNING_STATUS = RISK < 0 ? 0 : -1; WARNING_STATUS = RISK <= 1 && WARNING_STATUS == -1 ? 2 : WARNING_STATUS; WARNING_STATUS = RISK <= 2.5 && WARNING_STATUS == -1 ? 3 : WARNING_STATUS;WARNING_STATUS = RISK >= 2.5 && WARNING_STATUS == -1 ? 4 : WARNING_STATUS" -timmax {file} {tmpfile_path}result_unmasked.nc', shell=True) subprocess.run(f'cdo -aexpr,"WARNING_STATUS = RISK < 0 ? 0 : -1; WARNING_STATUS = RISK <= 1 && WARNING_STATUS == -1 ? 2 : WARNING_STATUS; WARNING_STATUS = RISK <= 2.5 && WARNING_STATUS == -1 ? 3 : WARNING_STATUS;WARNING_STATUS = RISK >= 2.5 && WARNING_STATUS == -1 ? 4 : WARNING_STATUS" -timmax {file} {tmpfile_path}result_unmasked.nc', shell=True)
file_name = os.path.basename(file) file_name = os.path.basename(file)
file_date = file_name[file_name.index("final_")+6:file_name.index("final_")+16] file_date = file_name[file_name.index("RISK_result_")+12:file_name.index("RISK_result_")+22]
timestep_dates.append(file_date) timestep_dates.append(file_date)
# Mask results using a CSV file with polygons # Mask results using a CSV file with polygons
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment