Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid ADASMELIAE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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 ADASMELIAE
Commits
55f965c0
Commit
55f965c0
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
feat: Change to two warning statuses - green and red
parent
8c7453f9
No related branches found
No related tags found
No related merge requests found
Pipeline
#3793
passed
1 year ago
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ADASMELIAE.cfg
+2
-4
2 additions, 4 deletions
ADASMELIAE.cfg
ADASMELIAE.py
+4
-7
4 additions, 7 deletions
ADASMELIAE.py
mapfile/template.j2
+6
-18
6 additions, 18 deletions
mapfile/template.j2
with
12 additions
and
29 deletions
ADASMELIAE.cfg
+
2
−
4
View file @
55f965c0
...
@@ -3,13 +3,11 @@
...
@@ -3,13 +3,11 @@
languages
=
en,nb
languages
=
en,nb
[i18n.en]
[i18n.en]
low_risk
=
Low migration risk
low_risk
=
Low risk of migration of adult pollen beetle
medium_risk
=
Medium migration risk
high_risk
=
High risk of migration of adult pollen beetle
high_risk
=
High migration risk
temperature
=
Maximum air temperature
temperature
=
Maximum air temperature
[i18n.nb]
[i18n.nb]
low_risk
=
Lav migreringsrisiko
low_risk
=
Lav migreringsrisiko
medium_risk
=
Middels migreringsrisiko
high_risk
=
Høy migreringsrisiko
high_risk
=
Høy migreringsrisiko
temperature
=
Maksimum lufttemperatur
temperature
=
Maksimum lufttemperatur
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ADASMELIAE.py
+
4
−
7
View file @
55f965c0
...
@@ -74,8 +74,7 @@ logging.basicConfig(
...
@@ -74,8 +74,7 @@ logging.basicConfig(
tm_max
=
"
air_temperature_2m_max
"
tm_max
=
"
air_temperature_2m_max
"
THRESHOLD_HIGH
=
15
THRESHOLD
=
15
THRESHOLD_MEDIUM
=
12
# Run given command using subprocess.run. Handle logging.
# Run given command using subprocess.run. Handle logging.
...
@@ -190,12 +189,10 @@ if __name__ == "__main__":
...
@@ -190,12 +189,10 @@ if __name__ == "__main__":
)
)
# Classifying warning status for the model
# Classifying warning status for the model
# temperature < 12 --> 2 (Yellow)
# temperature < 15 --> 2 (Green)
# 12 <= temperature < 15 --> 3 (Orange)
# temperature >= 15 --> 4 (Red)
# temperature >= 15 --> 4 (Red)
logging
.
info
(
f
"
Calculate warning status by checking
{
tm_max
}
"
)
run_command
(
run_command
(
command
=
f
"
cdo -s -aexpr,
'
WARNING_STATUS =
{
tm_max
}
<
{
THRESHOLD
_MEDIUM
}
? 2 :
-1; WARNING_STATUS =
{
tm_max
}
<
{
THRESHOLD_HIGH
}
&& WARNING_STATUS == -1 ? 3 : WARNING_STATUS ; WARNING_STATUS =
{
tm_max
}
>=
{
THRESHOLD_HIGH
}
&& WARNING_STATUS == -1 ? 4 : WARNING_STATUS
'
{
max_temp_in_period_file
}
{
unmasked_result_file
}
"
,
command
=
f
'
cdo -s -aexpr,
"
WARNING_STATUS =
{
tm_max
}
<
{
THRESHOLD
}
? 2 :
4
"
{
max_temp_in_period_file
}
{
unmasked_result_file
}
'
,
)
)
# Mask results using a CSV file with polygons. Env variable MASK_FILE must be set, or else we use the file as it is.
# Mask results using a CSV file with polygons. Env variable MASK_FILE must be set, or else we use the file as it is.
...
...
This diff is collapsed.
Click to expand it.
mapfile/template.j2
+
6
−
18
View file @
55f965c0
...
@@ -122,17 +122,12 @@ LAYER
...
@@ -122,17 +122,12 @@ LAYER
{
{
\"classification\": 2,
\"classification\": 2,
\"legendLabel\": \"{{ language.low_risk }}\",
\"legendLabel\": \"{{ language.low_risk }}\",
\"legendIconCSS\": \"width: 25px; background-color: #FFDF00;\"
\"legendIconCSS\": \"width: 25px; background-color: #3ac47d;\"
},
{
\"classification\": 3,
\"legendLabel\": \"{{ language.medium_risk }}\",
\"legendIconCSS\": \"width: 25px; background-color: #FF8C00;\"
},
},
{
{
\"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;\"
}
}
]
]
}
}
...
@@ -145,23 +140,16 @@ LAYER
...
@@ -145,23 +140,16 @@ LAYER
CLASS
CLASS
NAME "Low infection risk"
NAME "Low infection risk"
EXPRESSION ([pixel] >= 0 AND [pixel] <= 2)
EXPRESSION ([pixel] >= 0 AND [pixel] < 15)
STYLE
COLOR 255 223 0 # Yellow
END
END
CLASS
NAME "Medium infection risk"
EXPRESSION ([pixel] > 2 AND [pixel] <= 3)
STYLE
STYLE
COLOR
255 140 0 # Orange
COLOR
58 196 125 # Green
END
END
END
END
CLASS
CLASS
NAME "High infection risk"
NAME "High infection risk"
EXPRESSION ([pixel] >
3
)
EXPRESSION ([pixel] >
= 15
)
STYLE
STYLE
COLOR
255 0
0 # Red
COLOR
217 37 8
0 # Red
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