earthkit.geo.rotate.unrotate_vector¶
- earthkit.geo.rotate.unrotate_vector(lat, lon, vector_x, vector_y, south_pole_lat, south_pole_lon, south_pole_rotation_angle=0, lat_unrotated=None, lon_unrotated=None)¶
Rotate vectors on a rotated grid back into eastward and northward components.
- Parameters:
lat (
ndarray) – Latitude coordinates of the rotated points (degrees).lon (
ndarray) – Longitude coordinates of the rotated points (degrees).vector_x (
ndarray) – x vector component in the rotated coordinate system at the rotated points.vector_y (
ndarray) – y vector component in the rotated coordinate system at the rotated points.south_pole_lat (
float) – Latitude of the south pole defining the rotation (degrees).south_pole_lon (
float) – Longitude of the south pole defining the rotation (degrees).south_pole_rotation_angle (
float, optional) – Rotation angle around the south pole (degrees). Currently not supported.lat_unrotated (
ndarray, optional) – Latitude coordinates of the points before rotation (degrees).lon_unrotated (
ndarray, optional) – Longitude coordinates of the points before rotation (degrees).
- Returns:
ndarray– x component of the vector rotated back to eastward and northward components.ndarray– y component of the vector rotated back to eastward and northward components.
Use this method when a grid is rotated spherically and the vector components are locally rotated at each target grid point into the new local (rotated) coordinate system.
unrotate_vector()performs the inverse operation, and rotates back the vectors to their original directions at each point. The vector is returned at the same locations (lat,lon) and its magnitude is preserved.