Skip to content
Snippets Groups Projects
Commit 9b1e98ed authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Merge branch 'revised_thresholds' into 'main'

Revised thresholds

See merge request !4
parents 27e54270 6a44d887
Branches
No related tags found
1 merge request!4Revised thresholds
...@@ -172,11 +172,10 @@ subprocess.run(f'cdo -s -seltimestep,1/{number_of_timesteps_to_keep} {tmpfile_pa ...@@ -172,11 +172,10 @@ subprocess.run(f'cdo -s -seltimestep,1/{number_of_timesteps_to_keep} {tmpfile_pa
# Classifying warning status for the WHS model # Classifying warning status for the WHS model
# 0 == WHS --> Grey # 0 =< WHS < 20 --> Green
# 0 < WHS < 20 --> Yellow # 20 <= WHS < 40 --> Yellow
# 20 <= WHS < 40 --> Orange
# 40 <= WHS --> Red # 40 <= WHS --> Red
subprocess.run(f'cdo -s -aexpr,"WARNING_STATUS = WHS <= 0 ? 0 : -1; WARNING_STATUS = WHS < 20 && WARNING_STATUS == -1 ? 2 : WARNING_STATUS; WARNING_STATUS = WHS < 40 && WARNING_STATUS == -1 ? 3 : WARNING_STATUS; WARNING_STATUS = WHS >= 40 && WARNING_STATUS == -1 ? 4 : WARNING_STATUS" {tmpfile_path}wh_3daysum.nc {tmpfile_path}result_unmasked.nc', shell=True) subprocess.run(f'cdo -s -aexpr,"WARNING_STATUS = WHS < 0 ? 0 : -1; WARNING_STATUS = WHS < 20 && WARNING_STATUS == -1 ? 2 : WARNING_STATUS; WARNING_STATUS = WHS < 40 && WARNING_STATUS == -1 ? 3 : WARNING_STATUS; WARNING_STATUS = WHS >= 40 && WARNING_STATUS == -1 ? 4 : WARNING_STATUS" {tmpfile_path}wh_3daysum.nc {tmpfile_path}result_unmasked.nc', shell=True)
subprocess.run(f"rm {tmpfile_path}result.nc", shell=True) subprocess.run(f"rm {tmpfile_path}result.nc", shell=True)
......
...@@ -111,25 +111,20 @@ LAYER ...@@ -111,25 +111,20 @@ LAYER
{ {
\"isWarningStatus\": true, \"isWarningStatus\": true,
\"legendItems\": [ \"legendItems\": [
{
\"classification\": 0,
\"legendLabel\": \"{{ language.no_risk }}\",
\"legendIconCSS\": \"width: 25px; background-color: #707070;\"
},
{ {
\"classification\": 2, \"classification\": 2,
\"legendLabel\": \"{{ language.low_risk }}\", \"legendLabel\": \"{{ language.low_risk }}\",
\"legendIconCSS\": \"width: 25px; background-color: #FFCC00;\" \"legendIconCSS\": \"width: 25px; background-color: #3ac47d;\"
}, },
{ {
\"classification\": 3, \"classification\": 3,
\"legendLabel\": \"{{ language.medium_risk }}\", \"legendLabel\": \"{{ language.medium_risk }}\",
\"legendIconCSS\": \"width: 25px; background-color: #FFCC99;\" \"legendIconCSS\": \"width: 25px; background-color: #f7b924;\"
}, },
{ {
\"classification\": 4, \"classification\": 4,
\"legendLabel\": \"{{ language.high_risk }}\", \"legendLabel\": \"{{ language.high_risk }}\",
\"legendIconCSS\": \"width: 25px; background-color: #FF0000;\" \"legendIconCSS\": \"width: 25px; background-color: #d92550;\"
} }
] ]
} }
...@@ -140,32 +135,25 @@ LAYER ...@@ -140,32 +135,25 @@ LAYER
# class using simple string comparison, equivalent to ([pixel] = 0) # class using simple string comparison, equivalent to ([pixel] = 0)
CLASS
NAME "No infection risk"
EXPRESSION ([pixel] >= 0 AND [pixel] < 2)
STYLE
COLOR 112 112 112
END
END
CLASS CLASS
NAME "Low infection risk" NAME "Low infection risk"
EXPRESSION ([pixel] >= 2 AND [pixel] < 3) EXPRESSION ([pixel] >= 2 AND [pixel] < 3)
STYLE STYLE
COLOR 255 204 0 COLOR 58 196 125
END END
END END
CLASS CLASS
NAME "Medium infection risk" NAME "Medium infection risk"
EXPRESSION ([pixel] >= 3 AND [pixel] < 4) EXPRESSION ([pixel] >= 3 AND [pixel] < 4)
STYLE STYLE
COLOR 255 153 0 COLOR 247 185 36
END END
END END
CLASS CLASS
NAME "High infection risk" NAME "High infection risk"
EXPRESSION ([pixel] >= 4) EXPRESSION ([pixel] >= 4)
STYLE STYLE
COLOR 255 0 0 COLOR 217 37 80
END END
END END
END # Layer END # Layer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment