Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCore-Python-Common
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
VIPSCore-Python-Common
Commits
fbd9c75a
Commit
fbd9c75a
authored
2 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Add WeatherElements
parent
d23d9f0a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/vipscore_common/entities.py
+52
-0
52 additions, 0 deletions
src/vipscore_common/entities.py
tests/test_entities.py
+4
-1
4 additions, 1 deletion
tests/test_entities.py
with
56 additions
and
1 deletion
src/vipscore_common/entities.py
+
52
−
0
View file @
fbd9c75a
...
...
@@ -162,3 +162,55 @@ class WeatherObservation(BaseModel):
raise
ValueError
(
"
%s must be timezone aware
"
%
v
)
return
v
class
WeatherElements
():
# Mean temp (Celcius)
TEMPERATURE_MEAN
=
"
TM
"
# Minimum temperature (Celcius)
TEMPERATURE_MINIMUM
=
"
TN
"
# Maximum temperature (Celcius)
TEMPERATURE_MAXIMUM
=
"
TX
"
# Instantaneous temperature (Celcius)
TEMPERATURE_INSTANTANEOUS
=
"
TT
"
#Soil temperatures at various depths
SOIL_TEMPERATURE_5CM_MEAN
=
"
TJM5
"
SOIL_TEMPERATURE_10CM_MEAN
=
"
TJM10
"
SOIL_TEMPERATURE_25CM_MEAN
=
"
TJM25
"
SOIL_TEMPERATURE_50CM_MEAN
=
"
TJM50
"
# Dew point temperature (Celcius)
DEW_POINT_TEMPERATURE
=
"
TD
"
# Aggregated rainfall (millimeters)
PRECIPITATION
=
"
RR
"
# Average relative humidity (%)
RELATIVE_HUMIDITY_MEAN
=
"
UM
"
# Instantaneous relative humidity (%)
RELATIVE_HUMIDITY_INSTANTANEOUS
=
"
UU
"
# Global radiation (W/sqm)
GLOBAL_RADIATION
=
"
Q0
"
# Immmediate calculated clear sky solar radiation (clear sky)
GLOBAL_RADIATION_CLEAR_SKY_CALCULATED
=
"
Q0c
"
# Leaf wetness (Minutes per hour)
LEAF_WETNESS_DURATION
=
"
BT
"
# Leaf wetness at ground level (Minutes per hour)
LEAF_WETNESS_DURATION_GROUND_LEVEL
=
"
BTg
"
# Soil water content at various depths
SOIL_WATER_CONTENT_5CM
=
"
VAN5
"
SOIL_WATER_CONTENT_10CM
=
"
VAN10
"
SOIL_WATER_CONTENT_25CM
=
"
VAN25
"
SOIL_WATER_CONTENT_50CM
=
"
VAN50
"
# Soil conductivity at various depths
SOIL_CONDUCTIVITY_5CM
=
"
LEJ5
"
# Average wind speed (meters / second) for the last 60 minutes, measured at 2 meter height
WIND_SPEED_2M
=
"
FM2
"
# Average wind speed (meters / second) for the last 60 minutes, measured at 10 meter height
WIND_SPEED_10M
=
"
FM
"
# Average wind speed (meters / second) for the last 10 minutes, measured at 2 meter height
WIND_SPEED_10MIN_2M
=
"
FF2
"
# Average wind speed (meters / second) for the last 10 minutes, measured at 10 meter height
WIND_SPEED_10MIN_10M
=
"
FF
"
# Average wind direction for the last 10 minutes, measured at 2 meter height
WIND_DIR_10MIN_2M
=
"
DD2
"
# Average wind direction for the last 10 minutes, measured at 10 meter height
WIND_DIR_10MIN_10M
=
"
DD
"
# Potential evapotranspiration by the Penman equation
POTENTIAL_EVAPORATION
=
"
EPP
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/test_entities.py
+
4
−
1
View file @
fbd9c75a
...
...
@@ -20,4 +20,7 @@ class TestEntities(unittest.TestCase):
warning_status
=
2
)
r
.
set_value
(
"
TM
"
,
2
)
\ No newline at end of file
r
.
set_value
(
"
TM
"
,
2
)
def
test_weather_elements
(
self
):
self
.
assertEquals
(
"
TM
"
,
WeatherElements
.
TEMPERATURE_MEAN
)
\ No newline at end of file
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