Ellipsoid¶
- class sargeom.coordinates.Ellipsoid(semi_major_axis, semi_minor_axis=None, flattening=None)[source]¶
Bases:
object
Represents a reference ellipsoid of revolution for geodetic calculations.
The ellipsoid is defined by either: - Equatorial radius (semi-major axis) and polar radius (semi-minor axis), or - Equatorial radius (semi-major axis) and flattening factor (f).
- Parameters:
Methods Summary
conformal_latitude
(phi)Computes the conformal latitude from the geodetic latitude.
Computes the inverse conformal latitude.
Computes the inverse isometric latitude.
isometric_latitude
(phi)Computes the isometric latitude (parameter of the Mercator projection).
Computes the prime vertical curvature radius of a point at latitude φ.
to_cartographic
(X, Y, Z)Converts geocentric cartesian ECEF coordinates to geodetic coordinates.
to_ecef
(lamb, phi[, height_m])Converts geodetic coordinates to geocentric cartesian ECEF coordinates.
Methods Documentation
- conformal_latitude(phi)[source]¶
Computes the conformal latitude from the geodetic latitude.
The conformal latitude is computed using the formula:
\[\chi(\phi)=rcsinig[ anhig(\mathrm{arctanh}(\sin(\phi))- e\mathrm{arctanh}(e\sin(\phi))ig)ig]\]- Parameters:
- phiarray_like
The geodetic latitude in radians.
- Returns:
- chi
numpy.ndarray
The conformal latitude in radians.
- chi
See also
Notes
The conformal latitude preserves angles during the projection of the ellipsoid onto the auxiliary sphere. It is used in conformal map projections such as the Mercator and Lambert Conformal Conic projections.
- inverse_conformal_latitude(chi)[source]¶
Computes the inverse conformal latitude.
The calculation is performed from a harmonic expansion up to order 10 in terms of the third flattening factor \(n\) using the Lagrange inversion formula:
\[\phi(\chi)\simeq\chi+\sum\limits_{p=1}^{10}d_{2p}(n)\sin(2p\chi)\]- Parameters:
- chiarray_like
The conformal latitude in radians.
- Returns:
- phi
numpy.ndarray
The geodetic latitude in radians.
- phi
See also
Notes
This implementation uses a series expansion up to the 10th order for high accuracy. The coefficients d(n) are precomputed during ellipsoid initialization.
- inverse_isometric_latitude(psi)[source]¶
Computes the inverse isometric latitude.
The calculation is performed from the inverse function of the conformal latitude:
\[\phi(\psi)=\chi^{-1}ig[rcsinig( anh(\psi)ig)ig]\]- Parameters:
- psiarray_like
The isometric latitude in radians.
- Returns:
- phi
numpy.ndarray
The geodetic latitude in radians.
- phi
See also
Notes
This function computes the geodetic latitude from the isometric latitude by first converting to conformal latitude and then using the inverse conformal latitude function.
- isometric_latitude(phi)[source]¶
Computes the isometric latitude (parameter of the Mercator projection).
The isometric latitude is computed using the formula:
\[\psi(\phi)=\mathrm{arctanh}ig(\sin(\phi)ig)- e\mathrm{arctanh}ig(e\sin(\phi)ig)\]It can also be computed from the conformal latitude:
\[\psi(\phi)=\mathrm{arctanh}ig[\sinig(\chi(\phi)ig)ig]\]- Parameters:
- phiarray_like
The geodetic latitude in radians.
- Returns:
- psi
numpy.ndarray
The isometric latitude in radians.
- psi
See also
inverse_isometric_latitude
Inverse function
conformal_latitude
Related conformal latitude function
Notes
The isometric latitude is used as a parameter in the Mercator projection and other conformal map projections. It represents the latitude on an auxiliary sphere that preserves angles.
- prime_vertical_curvature_radius(phi)[source]¶
Computes the prime vertical curvature radius of a point at latitude φ.
The prime vertical curvature radius is computed using the formula:
\[\]u(phi)=dfrac{a}{sqrt{1-e^2sin^2phi}}
where \(a\) is the semi-major axis and \(e\) is the eccentricity of the ellipsoid.
- Parameters:
- phiarray_like
The geodetic latitude in radians.
- Returns:
- nu
numpy.ndarray
Prime vertical curvature radius in meters.
- nu
Notes
The prime vertical curvature radius is the radius of curvature in the plane of the prime vertical, which is perpendicular to the meridian and contains the normal to the ellipsoid.
- to_cartographic(X, Y, Z)[source]¶
Converts geocentric cartesian ECEF coordinates to geodetic coordinates.
Converts geocentric cartesian ECEF coordinates \((X,Y,Z)\) of a point to geodetic coordinates \((\lambda,\phi, H)\).
- Parameters:
- Xarray_like
The X cartesian ECEF coordinate in meters.
- Yarray_like
The Y cartesian ECEF coordinate in meters.
- Zarray_like
The Z cartesian ECEF coordinate in meters.
- Returns:
- lamb
numpy.ndarray
The geographic longitude in radians.
- phi
numpy.ndarray
The geographic latitude in radians.
- height_m
numpy.ndarray
The geodetic height in meters.
- lamb
See also
Notes
Conversion is made using the algorithm proposed by Vermeille (2002) but with limited application to the case where the evolute sign test is not performed, that is this algorithm is valid for points not “too deep” towards the center of the Earth (height > -6314 km for WGS84 ellipsoid), which is the case for our applications.
References
[1]Vermeille, H. Direct transformation from geocentric coordinates to geodetic coordinates. Journal of Geodesy 76, 451–454 (2002). https://doi.org/10.1007/s00190-002-0273-6
- to_ecef(lamb, phi, height_m=0)[source]¶
Converts geodetic coordinates to geocentric cartesian ECEF coordinates.
Converts geodetic coordinates \((\lambda,\phi, H)\) of a point to geocentric cartesian ECEF coordinates \((X,Y,Z)\).
The conversion is made through the relationships:
\[\left\{egin{array}{rcl} X & = & ig(\]- u(phi) + Hig)cos(phi)cos(lambda)
Y & = & ig(
- u(phi) + Hig)cos(phi)sin(lambda)
Z & = & ig((1-e^2)
- u(phi) + Hig)sin(phi)
end{array}
ight.
where :math:`
- u(phi)` is the prime vertical curvature radius
of the point with latitude \(\phi\).
- Parameters:
- lambarray_like
The geographic longitude of the point in radians.
- phiarray_like
The geographic latitude of the point in radians.
- height_marray_like, optional
The geodetic height of the point in meters. Default is 0.
- Returns:
- X
numpy.ndarray
The X cartesian ECEF coordinate in meters.
- Y
numpy.ndarray
The Y cartesian ECEF coordinate in meters.
- Z
numpy.ndarray
The Z cartesian ECEF coordinate in meters.
- X