Coordinate Transformations (pygeoid.coordinates.transform)
This module contains functions for coordinate transformations
- pygeoid.coordinates.transform.geodetic_to_cartesian(lat, lon, height, ell)[source]
Convert geodetic to 3D cartesian coordinates.
Convert geodetic coordinates (lat, lon, height) given w.r.t. ellipsoid ell to 3D cartesian coordinates (x, y, z).
- Parameters:
lat (Quantity) – Geodetic latitude.
lon (Quantity) – Geodetic longitude.
height (Quantity) – Geodetic height.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
x, y, z – Cartesian coordinates.
- Return type:
Quantity
- pygeoid.coordinates.transform.cartesian_to_geodetic(x, y, z, ell)[source]
Convert 3D cartesian to geodetic coordinates.
- Parameters:
x (Quantity) – Cartesian coordinates.
y (Quantity) – Cartesian coordinates.
z (Quantity) – Cartesian coordinates.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
lat (~astropy.units.Quantity) – Geodetic latitude.
lon (~astropy.units.Quantity) – Geodetic longitude.
height (float or array_like of floats) – Geodetic height.
Notes
The algorithm of H. Vermeille is used for this transformation [1].
References
into geodetic coordinates. Journal of Geodesy, 85(2), pp.105-117.
- pygeoid.coordinates.transform.cartesian_to_spherical(x, y, z)[source]
Convert 3D cartesian to spherical coordinates.
- Parameters:
x (Quantity) – Cartesian coordinates.
y (Quantity) – Cartesian coordinates.
z (Quantity) – Cartesian coordinates.
- Returns:
lat (~astropy.units.Quantity) – Spherical latitude.
lon (~astropy.units.Quantity) – Spherical longitude.
r (~astropy.units.Quantity) – Radius.
- pygeoid.coordinates.transform.spherical_to_cartesian(lat, lon, radius)[source]
Convert spherical to 3D cartesian coordinates.
- Parameters:
lat (Quantity) – Spherical latitude.
lon (Quantity) – Spherical longitude.
r (Quantity) – Radius.
radius (Unit("m"))
- Returns:
x, y, z – Cartesian coordinates.
- Return type:
Quantity
- pygeoid.coordinates.transform.cartesian_to_ellipsoidal(x, y, z, ell)[source]
Convert 3D cartesian to ellipsoidal-harmonic coordinates.
Note that point (x, y, z) must be on or outside of the sphere with the radius equals to the linear eccentricity of the reference ellipsoid ell, i. e. (x**2 + y**2 + z**2) >= E**2.
- Parameters:
x (Quantity) – Cartesian coordinates.
y (Quantity) – Cartesian coordinates.
z (Quantity) – Cartesian coordinates.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which ellipsoidal coordinates are referenced to.
- Returns:
rlat (~astropy.units.Quantity) – Reduced latitude.
lon (~astropy.units.Quantity) – Longitude.
u_ax (~astropy.units.Quantity) – Polar axis of the ellipsoid passing through the given point.
- pygeoid.coordinates.transform.ellipsoidal_to_cartesian(rlat, lon, u_ax, ell)[source]
Convert ellipsoidal-harmonic coordinates to 3D cartesian coordinates.
- Parameters:
rlat (Quantity) – Reduced latitude.
lon (Quantity) – Longitude.
u_ax (Quantity) – Polar axis of the ellipsoid passing through the given point.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
x, y, z – Cartesian coordinates.
- Return type:
Quantity
- pygeoid.coordinates.transform.geodetic_to_spherical(lat, lon, height, ell)[source]
Convert from geodetic to spherical coordinates.
- Parameters:
lat (Quantity) – Geodetic latitude.
lon (Quantity) – Geodetic longitude.
height (Quantity) – Geodetic height.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
lat, lon (~astropy.units.Quantity) – Spherical latitude and longitude.
r (~astropy.units.Quantity) – Radius.
- pygeoid.coordinates.transform.spherical_to_geodetic(lat, lon, radius, ell)[source]
Convert spherical to geodetic coordinates.
- Parameters:
lat (Quantity) – Spherical latitude and longitude.
lon (Quantity) – Spherical latitude and longitude.
r (Quantity) – Radius.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
radius (Unit("m"))
- Returns:
lat (~astropy.units.Quantity) – Geodetic latitude.
lon (~astropy.units.Quantity) – Geodetic longitude.
height (~astropy.units.Quantity) – Geodetic height.
- pygeoid.coordinates.transform.geodetic_to_ellipsoidal(lat, lon, height, ell)[source]
Convert from geodetic to ellipsoidal-harmonic coordinates.
- Parameters:
lat (Quantity) – Geodetic latitude.
lon (Quantity) – Geodetic longitude.
height (Quantity) – Geodetic height.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
rlat (~astropy.units.Quantity) – Reduced latitude.
lon (~astropy.units.Quantity) – Longitude.
u_ax (~astropy.units.Quantity) – Polar axis of the ellipsoid passing through the given point.
- pygeoid.coordinates.transform.ellipsoidal_to_geodetic(rlat, lon, u_ax, ell)[source]
Convert from ellipsoidal-harmonic to geodetic coordinates.
- Parameters:
rlat (Quantity) – Reduced latitude.
lon (Quantity) – Longitude.
u_ax (Quantity) – Polar axis of the ellipsoid passing through the given point.
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
lat, lon (~astropy.units.Quantity) – Geodetic latitude and longitude.
height (~astropy.units.Quantity) – Geodetic height.
- pygeoid.coordinates.transform.ecef_to_enu(x, y, z, origin, ell=None)[source]
Convert geocentric cartesian to local cartesian coordinates.
Convert Earth Centered Earth Fixed (ECEF) cartesian coordinates (x,`y`,`z`) to the local east-north-up (ENU) local cartesian coordinate system with the origin in (lat0, lon0, height0) or in (lat0, lon0, r0).
- Parameters:
x (Quantity) – Geocentric cartesian coordinates.
y (Quantity) – Geocentric cartesian coordinates.
z (Quantity) – Geocentric cartesian coordinates.
origin (tuple of Quantity) – Ggeocentric (spherical) or geodetic coordinates of the origin (lat0, lon0, r0) or (lat0, lon0, h0).
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid, optional) – Reference ellipsoid to which geodetic coordinates are referenced to. Default is None, meaning spherical coordinates instead of geodetic.
- Returns:
x, y, z – Local east-north-up cartesian coordinates.
- Return type:
Quantity
- pygeoid.coordinates.transform.enu_to_ecef(x, y, z, origin, ell=None)[source]
Convert local cartesian to geocentric cartesian coordinates.
Convert local east-north-up (ENU) local cartesian coordinate system with the origin in (lat0, lon0, height0) to the Earth Centered Earth Fixed (ECEF) cartesian coordinates.
- Parameters:
x (Quantity) – Local east-north-uo cartesian coordinates.
y (Quantity) – Local east-north-uo cartesian coordinates.
z (Quantity) – Local east-north-uo cartesian coordinates.
origin (tuple of Quantity) – Ggeocentric (spherical) or geodetic coordinates of the origin (lat0, lon0, r0) or (lat0, lon0, h0).
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to. Default is None, meaning spherical coordinates instead of geodetic.
- Returns:
x, y, z – Geocentric cartesian coordinates, in metres.
- Return type:
Quantity
- pygeoid.coordinates.transform.geodetic_to_enu(lat, lon, height, origin, ell)[source]
Convert geodetic coordinates to local cartesian coordinates.
Convert geodetic coordinates (lat,`lon`,`height`) to the local east-north-up (ENU) local cartesian coordinate system with the origin in (lat0, lon0, height0).
- Parameters:
lat (Quantity) – Geodetic latitude.
lon (Quantity) – Geodetic longitude.
height (Quantity) – Geodetic height.
origin (tuple of Quantity) – Geodetic coordinates of the origin (lat0, lon0, h0).
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
x, y, z – Local east-north-up cartesian coordinates.
- Return type:
Quantity
- pygeoid.coordinates.transform.enu_to_geodetic(x, y, z, origin, ell)[source]
Convert local cartesian coordinates to geodetic coordinates.
Convert the local east-north-up (ENU) local cartesian coordinate system with the origin in (lat0, lon0, height0) to the geodetic coordinates.
- Parameters:
x (Quantity) – Local east-north-uo cartesian coordinates.
y (Quantity) – Local east-north-uo cartesian coordinates.
z (Quantity) – Local east-north-uo cartesian coordinates.
origin (tuple of Quantity) – Geodetic coordinates of the origin (lat0, lon0, h0).
ell (instance of the pygeoid.coordinates.ellipsoid.Ellipsoid) – Reference ellipsoid to which geodetic coordinates are referenced to.
- Returns:
lat (~astropy.units.Quantity) – Geodetic latitude.
lon (~astropy.units.Quantity) – Geodetic longitude.
height (~astropy.units.Quantity) – Geodetic height.
- pygeoid.coordinates.transform.polar_to_cartesian(theta, radius)[source]
Convert polar coordinates to 2D cartesian.
- Parameters:
theta (Quantity) – Polar angle.
radius (Quantity) – Radius.
- Returns:
x, y – Local east-north-uo cartesian coordinates.
- Return type:
Quantity
- pygeoid.coordinates.transform.cartesian_to_polar(x, y)[source]
Convert 2D cartesian coordinates to polar coordinates.
- Parameters:
x (Quantity) – Cartesian coordinates.
y (Quantity) – Cartesian coordinates.
- Returns:
theta (~astropy.units.Quantity) – Polar angle.
radius (~astropy.units.Quantity) – Radius.