Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid SEPTREFHUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
Models
GRID
Grid SEPTREFHUM
Commits
9b1e98ed
Commit
9b1e98ed
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Plain Diff
Merge branch 'revised_thresholds' into 'main'
Revised thresholds See merge request
!4
parents
27e54270
6a44d887
Branches
Branches containing commit
No related tags found
1 merge request
!4
Revised thresholds
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SEPTREFHUM.py
+3
-4
3 additions, 4 deletions
SEPTREFHUM.py
mapfile/template.j2
+6
-18
6 additions, 18 deletions
mapfile/template.j2
with
9 additions
and
22 deletions
SEPTREFHUM.py
+
3
−
4
View file @
9b1e98ed
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
mapfile/template.j2
+
6
−
18
View file @
9b1e98ed
...
@@ -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: #
FF000
0;\"
\"legendIconCSS\": \"width: 25px; background-color: #
d9255
0;\"
}
}
]
]
}
}
...
@@ -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 2
55 153 0
COLOR 2
47 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 2
55 0
0
COLOR 2
17 37 8
0
END
END
END
END
END # Layer
END # Layer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment