clouddrift.kinematics.residual_position_from_displacement#
- clouddrift.kinematics.residual_position_from_displacement(longitude: float | ndarray | DataArray, latitude: float | ndarray | DataArray, x: float | ndarray, y: float | ndarray) tuple[float] | tuple[ndarray] [source]#
Return residual longitudes and latitudes along a trajectory on the spherical Earth after correcting for zonal and meridional displacements x and y in meters.
This is applicable as an example when one seeks to correct a trajectory for horizontal oscillations due to inertial motions, tides, etc.
Parameters#
- longitudefloat or array-like
Longitude in degrees.
- latitudefloat or array-like
Latitude in degrees.
- xfloat or np.ndarray
Zonal displacement in meters.
- yfloat or np.ndarray
Meridional displacement in meters.
Returns#
- residual_longitudefloat or np.ndarray
Residual longitude after correcting for zonal displacement, in degrees.
- residual_latitudefloat or np.ndarray
Residual latitude after correcting for meridional displacement, in degrees.
Examples#
Obtain the new geographical position for a displacement of 1/360-th of the circumference of the Earth from original position (longitude,latitude) = (1,0):
>>> from clouddrift.sphere import EARTH_RADIUS_METERS >>> residual_position_from_displacement(1,0,2 * np.pi * EARTH_RADIUS_METERS / 360,0) (0.0, 0.0)