CartesianLocalENU¶
- class sargeom.coordinates.CartesianLocalENU(x, y, z, origin=None)[source]¶
Bases:
Cartesian3
A local East-North-Up (ENU) system uses the Cartesian coordinates (xEast, yNorth, zUp) to represent position relative to a local origin. The local origin is described by the geodetic coordinates (lat0, lon0, h0). Note that the origin does not necessarily lie on the surface of the ellipsoid.
- Parameters:
- xEast
float
ornumpy.ndarray
The positive X-axis points east along the parallel of latitude containing lat0, in meters.
- yNorth
float
ornumpy.ndarray
The positive Y-axis points north along the meridian of longitude containing lon0, in meters.
- zUp
float
ornumpy.ndarray
The positive Z-axis points upward along the ellipsoid normal, in meters.
- origin
sargeom.coordinates.Cartographic
The origin position in geodetic coordinates of the East-North-Up (ENU) system.
- xEast
- Attributes:
rotation
scipy.spatial.transform.Rotation
Get the 3D Rotation SciPy instance for transforming geocentric ECEF coordinates of a vector to local ENU coordinates.
Examples
>>> CartesianLocalENU(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) XYZ CartesianLocalENU point [10. 20. 30.]
Attributes Summary
Get the 3D Rotation SciPy instance for transforming geocentric ECEF coordinates of a vector to local ENU coordinates.
Methods Summary
save_csv
(filename)Saves the cartesian ENU coordinates to a CSV file.
to_aer
([degrees])Transforms local East-North-Up (ENU) coordinates to local Azimuth-Elevation-Range (AER) spherical coordinates.
to_ecef
()Converts local East-North-Up (ENU) coordinates to Earth-centered Earth-fixed (ECEF) coordinates.
to_ned
()Converts local East-North-Up (ENU) coordinates to local North-East-Down (NED) coordinates.
Attributes Documentation
- rotation¶
Get the 3D Rotation SciPy instance for transforming geocentric ECEF coordinates of a vector to local ENU coordinates.
- Returns:
scipy.spatial.transform.Rotation
The 3D Rotation SciPy instance.
Examples
>>> enu_coords = CartesianLocalENU(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> enu_coords.rotation.as_matrix() array([[-0.089..., 0.996..., 0. ], [-0.687..., -0.061..., 0.723...], [ 0.721..., 0.064..., 0.689...]]) >>> enu_coords.rotation.as_quat() array([ 0.265..., 0.290..., 0.678..., -0.620...])
Methods Documentation
- save_csv(filename)[source]¶
Saves the cartesian ENU coordinates to a CSV file.
- Parameters:
- filename
str
orpathlib.Path
The name of the file to save the coordinates.
- filename
Examples
>>> positions = CartesianLocalENU(x=10.0, y=20.0, z=30.0, origin=Cartographic.ONERA_SDP()) >>> positions.save_csv("positions.csv")
- to_aer(degrees=True)[source]¶
Transforms local East-North-Up (ENU) coordinates to local Azimuth-Elevation-Range (AER) spherical coordinates. Both coordinate systems use the same local origin.
An azimuth-elevation-range (AER) system uses the spherical coordinates (az, elev, range) to represent position relative to a local origin. The local origin is described by the geodetic coordinates (lat0, lon0, h0). Azimuth, elevation, and slant range are dependent on the local ENU Cartesian system.
- Parameters:
- degreesbool, optional
If True (default), returns the angle in degrees. If False, returns the angle in radians.
- Returns:
- azimuth
numpy.ndarray
The azimuth, the clockwise angle in the xEast-yNorth plane from the positive yNorth-axis to the projection of the object into the plane.
- elevation
numpy.ndarray
The elevation, the angle from the xEast-yNorth plane to the object.
- slant_range
numpy.ndarray
The slant range (in meters), the Euclidean distance between the object and the local origin.
- azimuth
Examples
>>> enu_coords = CartesianLocalENU(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> azimuth, elevation, slant_range = enu_coords.to_aer() >>> print(f"{azimuth}°", f"{elevation}°", f"{slant_range}m") 26.565...° 53.300...° 37.416...m
- to_ecef()[source]¶
Converts local East-North-Up (ENU) coordinates to Earth-centered Earth-fixed (ECEF) coordinates.
- Returns:
sargeom.coordinates.CartesianECEF
The geocentric ECEF coordinates.
Examples
>>> enu_coords = CartesianLocalENU(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> enu_coords.to_ecef() XYZ CartesianECEF point [4606335.623... 412550.865... 4377594.950...]
- to_ned()[source]¶
Converts local East-North-Up (ENU) coordinates to local North-East-Down (NED) coordinates. Both coordinate systems use the same local origin.
- Returns:
sargeom.coordinates.CartesianLocalNED
The local NED coordinates.
Examples
>>> enu_coords = CartesianLocalENU(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> enu_coords.to_ned() XYZ CartesianLocalNED point [ 20. 10. -30.]