Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
c87b4fc0
Commit
c87b4fc0
authored
4 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
add some doc str to rotation
parent
af26efb6
No related branches found
No related tags found
1 merge request
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline
#63761
passed
4 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mlair/helpers/geofunctions.py
+16
-17
16 additions, 17 deletions
mlair/helpers/geofunctions.py
with
16 additions
and
17 deletions
mlair/helpers/geofunctions.py
+
16
−
17
View file @
c87b4fc0
...
@@ -186,8 +186,6 @@ class VectorRotate:
...
@@ -186,8 +186,6 @@ class VectorRotate:
:type data:
:type data:
:param interpolation_dim: Dimension name of staged dimension
:param interpolation_dim: Dimension name of staged dimension
:type interpolation_dim:
:type interpolation_dim:
:param constant_values:
:type constant_values:
:return:
:return:
:rtype:
:rtype:
"""
"""
...
@@ -204,8 +202,8 @@ class VectorRotate:
...
@@ -204,8 +202,8 @@ class VectorRotate:
idx_to_backward_transpose
=
[
list
(
orig_dims
).
index
(
i
)
for
i
in
new_dims
]
idx_to_backward_transpose
=
[
list
(
orig_dims
).
index
(
i
)
for
i
in
new_dims
]
# pad data i) left, ii) right for interpolation (mean between two staged values)
# pad data i) left, ii) right for interpolation (mean between two staged values)
d1
=
data
.
pad
({
interpolation_dim
:
(
1
,
0
)},
constant_values
=
constant_values
,
)
d1
=
data
.
pad
({
interpolation_dim
:
(
1
,
0
)},
constant_values
=
constant_values
)
d2
=
data
.
pad
({
interpolation_dim
:
(
0
,
1
)},
constant_values
=
constant_values
,
)
d2
=
data
.
pad
({
interpolation_dim
:
(
0
,
1
)},
constant_values
=
constant_values
)
d
=
(
d1
.
data
+
d2
.
data
)
*
.
5
d
=
(
d1
.
data
+
d2
.
data
)
*
.
5
# drop padding boundary
# drop padding boundary
...
@@ -315,9 +313,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -315,9 +313,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
"""
"""
Rotate u from Lambert conformal to geographic lat/lon.
Rotate u from Lambert conformal to geographic lat/lon.
:param ugrd:
:param ugrd:
Wind
'
s u-component on grid cell center in Lambert conformal
:type ugrd:
:type ugrd:
:param vgrd:
:param vgrd:
Wind
'
s v-component on grid cell center in Lambert conformal
:type vgrd:
:type vgrd:
:return:
:return:
:rtype:
:rtype:
...
@@ -328,9 +326,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -328,9 +326,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
"""
"""
Rotate v from Lambert conformal to geographic lat/lon.
Rotate v from Lambert conformal to geographic lat/lon.
:param ugrd:
:param ugrd:
Wind
'
s u-component on grid cell center in Lambert conformal
:type ugrd:
:type ugrd:
:param vgrd:
:param vgrd:
Wind
'
s v-component on grid cell center in Lambert conformal
:type vgrd:
:type vgrd:
:return:
:return:
:rtype:
:rtype:
...
@@ -341,9 +339,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -341,9 +339,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
"""
"""
Rotate u, v from Lambert conformal to u, v in geographic lat/lon.
Rotate u, v from Lambert conformal to u, v in geographic lat/lon.
:param ugrd:
:param ugrd:
Wind
'
s u-component on grid cell center in Lambert conformal
:type ugrd:
:type ugrd:
:param vgrd:
:param vgrd:
Wind
'
s v-component on grid cell center in Lambert conformal
:type vgrd:
:type vgrd:
:return:
:return:
:rtype:
:rtype:
...
@@ -354,15 +352,16 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -354,15 +352,16 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
"""
"""
First interpolate u, v from staged grid cells to grid center, than rotate u, v from Lambert conformal to u, v
First interpolate u, v from staged grid cells to grid center, than rotate u, v from Lambert conformal to u, v
in geographic lat/lon.
in geographic lat/lon.
:param ustg: wind
'
s u-component on staged (
"
half
"
) grid in Lambert conformal
:param ustg: Wind
'
s u-component on staged (
"
half
"
) grid in Lambert conformal
:type ustg:
:type ustg:
:param vstg:
w
ind
'
s v-component on staged (
"
half
"
) grid in Lambert conformal
:param vstg:
W
ind
'
s v-component on staged (
"
half
"
) grid in Lambert conformal
:type vstg:
:type vstg:
:param ustg_dim: Dimension name of staged u-component
:param ustg_dim: Dimension name of staged u-component
:type ustg_dim:
:type ustg_dim:
:param vstg_dim: Dimension name of staged v-component
:param vstg_dim: Dimension name of staged v-component
:type vstg_dim:
:type vstg_dim:
:return: u, v on grid center in geographic lat/lon direction
:return: u, v on grid
cell
center in geographic lat/lon direction
:rtype:
:rtype:
"""
"""
ugrd
=
self
.
interpolate_to_grid_center
(
ustg
,
ustg_dim
)
ugrd
=
self
.
interpolate_to_grid_center
(
ustg
,
ustg_dim
)
...
@@ -373,9 +372,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -373,9 +372,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
"""
"""
Convert u, v from Lambert conformal to wdspd, wdir in geographic lat/lon.
Convert u, v from Lambert conformal to wdspd, wdir in geographic lat/lon.
:param ugrd:
w
ind
'
s u-component on grid center in Lambert conformal
:param ugrd:
W
ind
'
s u-component on grid center in Lambert conformal
:type ugrd:
:type ugrd:
:param vgrd:
w
ind
'
s v-component on grid center in Lambert conformal
:param vgrd:
W
ind
'
s v-component on grid center in Lambert conformal
:type vgrd:
:type vgrd:
:return:
:return:
:rtype:
:rtype:
...
@@ -388,9 +387,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -388,9 +387,9 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
First interpolate u, v from staged grid cells to grid center, than rotate u, v from Lambert conformal to
First interpolate u, v from staged grid cells to grid center, than rotate u, v from Lambert conformal to
wdspd, wdir in geographic lat/lon.
wdspd, wdir in geographic lat/lon.
:param ustg:
w
ind
'
s u-component on staged (
"
half
"
) grid in Lambert conformal
:param ustg:
W
ind
'
s u-component on staged (
"
half
"
) grid in Lambert conformal
:type ustg:
:type ustg:
:param vstg:
w
ind
'
s v-component on staged (
"
half
"
) grid in Lambert conformal
:param vstg:
W
ind
'
s v-component on staged (
"
half
"
) grid in Lambert conformal
:type vstg:
:type vstg:
:param ustg_dim: Dimension name of staged u-component
:param ustg_dim: Dimension name of staged u-component
:type ustg_dim:
:type ustg_dim:
...
...
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