Skip to content
Snippets Groups Projects
Commit 97bd405f authored by Felix Kleinert's avatar Felix Kleinert
Browse files

reset attributes to ull and vll after rotation

parent 76beab14
Branches
Tags v2.0.0
1 merge request!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #64208 passed
......@@ -8,6 +8,7 @@ import xarray as xr
from mlair.helpers.helpers import convert2xrda
from typing import Union, Tuple
import logging
xr_int_float = Union[xr.DataArray, xr.Dataset, np.ndarray, int, float]
tuple_of_2xr_int_float = Tuple[xr_int_float, xr_int_float]
......@@ -416,7 +417,12 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
:return:
: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):
"""
......@@ -429,12 +435,12 @@ class VectorRotateLambertConformal2latlon(VectorRotate):
:return:
: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__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment