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
97bd405f
Commit
97bd405f
authored
4 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
reset attributes to ull and vll after rotation
parent
76beab14
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!259
Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline
#64208
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
+13
-7
13 additions, 7 deletions
mlair/helpers/geofunctions.py
with
13 additions
and
7 deletions
mlair/helpers/geofunctions.py
+
13
−
7
View file @
97bd405f
...
@@ -8,6 +8,7 @@ import xarray as xr
...
@@ -8,6 +8,7 @@ import xarray as xr
from
mlair.helpers.helpers
import
convert2xrda
from
mlair.helpers.helpers
import
convert2xrda
from
typing
import
Union
,
Tuple
from
typing
import
Union
,
Tuple
import
logging
xr_int_float
=
Union
[
xr
.
DataArray
,
xr
.
Dataset
,
np
.
ndarray
,
int
,
float
]
xr_int_float
=
Union
[
xr
.
DataArray
,
xr
.
Dataset
,
np
.
ndarray
,
int
,
float
]
tuple_of_2xr_int_float
=
Tuple
[
xr_int_float
,
xr_int_float
]
tuple_of_2xr_int_float
=
Tuple
[
xr_int_float
,
xr_int_float
]
...
@@ -416,7 +417,12 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -416,7 +417,12 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
:return:
:return:
:rtype:
:rtype:
"""
"""
return
vgrd
*
da
.
sin
(
self
.
_alpha
)
+
ugrd
*
da
.
cos
(
self
.
_alpha
)
ull
=
vgrd
*
da
.
sin
(
self
.
_alpha
)
+
ugrd
*
da
.
cos
(
self
.
_alpha
)
try
:
ull
.
attrs
=
ugrd
.
attrs
except
Exception
as
e
:
logging
.
debug
(
f
"
Can not set attrs for ull due to:
{
e
}
"
)
return
ull
def
vgrd2vll
(
self
,
ugrd
,
vgrd
):
def
vgrd2vll
(
self
,
ugrd
,
vgrd
):
"""
"""
...
@@ -429,12 +435,12 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
...
@@ -429,12 +435,12 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
:return:
:return:
:rtype:
:rtype:
"""
"""
return
vgrd
*
da
.
cos
(
self
.
_alpha
)
-
ugrd
*
da
.
sin
(
self
.
_alpha
)
vll
=
vgrd
*
da
.
cos
(
self
.
_alpha
)
-
ugrd
*
da
.
sin
(
self
.
_alpha
)
try
:
vll
.
attrs
=
vgrd
.
attrs
except
Exception
as
e
:
logging
.
debug
(
f
"
Can not set attrs for vll due to:
{
e
}
"
)
return
vll
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
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