CartesianLocalNED¶
- class sargeom.coordinates.CartesianLocalNED(x, y, z, origin=None)[source]¶
Bases:
Cartesian3
A North-East-Down (NED) system uses the Cartesian coordinates (xNorth, yEast, zDown) 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:
- xNorth
float
ornumpy.ndarray
The positive X-axis points north along the meridian of longitude containing lon0, in meters.
- yEast
float
ornumpy.ndarray
The positive Y-axis points east along the parallel of latitude containing lat0, in meters.
- zDown
float
ornumpy.ndarray
The positive Z-axis points downward along the ellipsoid normal, in meters.
- origin
sargeom.coordinates.Cartographic
The origin position in geodetic coordinates of the North-East-Down (NED) system.
- xNorth
- Attributes:
rotation
scipy.spatial.transform.Rotation
Get the 3D Rotation SciPy instance for transforming geocentric ECEF coordinates of a vector to local NED coordinates.
Examples
>>> CartesianLocalNED(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) XYZ CartesianLocalNED point [10. 20. 30.]
Attributes Summary
Get the 3D Rotation SciPy instance for transforming geocentric ECEF coordinates of a vector to local NED coordinates.
Methods Summary
save_csv
(filename)Saves the cartesian NED coordinates to a CSV file.
to_aer
([degrees])Transforms local North-East-Down (NED) coordinates to local Azimuth-Elevation-Range (AER) spherical coordinates.
to_ecef
()Converts local North-East-Down (NED) coordinates to Earth-centered Earth-fixed (ECEF) coordinates.
to_enu
()Converts local North-East-Down (NED) coordinates to local East-North-Up (ENU) coordinates.
Attributes Documentation
- rotation¶
Get the 3D Rotation SciPy instance for transforming geocentric ECEF coordinates of a vector to local NED coordinates.
- Returns:
scipy.spatial.transform.Rotation
The 3D Rotation SciPy instance.
Examples
>>> ned_coords = CartesianLocalNED(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> ned_coords.rotation.as_matrix() array([[-0.687..., -0.061..., 0.723...], [-0.089..., 0.996..., 0. ], [-0.721..., -0.064..., -0.689...]]) >>> ned_coords.rotation.as_quat() array([-0.041..., 0.918..., -0.017..., 0.393...])
Methods Documentation
- save_csv(filename)[source]¶
Saves the cartesian NED coordinates to a CSV file.
- Parameters:
- filename
str
orpathlib.Path
The name of the file to save the coordinates.
- filename
Examples
>>> positions = CartesianLocalNED(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 North-East-Down (NED) 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
>>> ned_coords = CartesianLocalNED(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> azimuth, elevation, slant_range = ned_coords.to_aer() >>> print(f"{azimuth}°", f"{elevation}°", f"{slant_range}m") 63.434...° 53.300...° 37.416...m
- to_ecef()[source]¶
Converts local North-East-Down (NED) coordinates to Earth-centered Earth-fixed (ECEF) coordinates.
- Returns:
sargeom.coordinates.CartesianECEF
The geocentric ECEF coordinates.
Examples
>>> ned_coords = CartesianLocalNED(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> ned_coords.to_ecef() XYZ CartesianECEF point [4606298.339... 412557.566... 4377546.319...]
- to_enu()[source]¶
Converts local North-East-Down (NED) coordinates to local East-North-Up (ENU) coordinates. Both coordinate systems use the same local origin.
- Returns:
sargeom.coordinates.CartesianLocalENU
The local NED coordinates.
Examples
>>> ned_coords = CartesianLocalNED(10.0, 20.0, 30.0, origin=Cartographic.ONERA_SDP()) >>> ned_coords.to_enu() XYZ CartesianLocalENU point [ 20. 10. -30.]