Geocentric Coordinates
SOFA.eform — Method
eform(model::Symbol)Earth reference ellipsoids.
Input
model– ellipsoid identifier (Note 1)
Output
radius– equatorial radius (meters, Note 2)oblate– oblateness (Note 2)
Examples
julia> eform(:WGS84)
(radius = 6.378137e6, oblate = 0.0033528106647474805)Note
The identifier
modelis a Symbol that specifies the choice of reference ellipsoid. The following are supported::WGS84 :GRS80 :WGS72
Unlike the SOFA C library, which uses a numerical code, the identifier is passed by name; any other value throws an AssertionError.
The ellipsoid parameters are returned in the form of equatorial radius in meters (a) and flattening (f). The latter is a number around 0.00335, i.e. around 1/298.
For the case where an unsupported model is supplied, an AssertionError is thrown.
References
Department of Defense World Geodetic System 1984, National Imagery and Mapping Agency Technical Report 8350.2, Third Edition, p3-2.
Moritz, H., Bull. Geodesique 66-2, 187 (1992).
The Department of Defense World Geodetic System 1972, World Geodetic System Committee, May 1974.
Explanatory Supplement to the Astronomical Almanac, P. Kenneth Seidelmann (ed), University Science Books (1992), p220.
SOFA.gc2gd — Method
gc2gd(model::Symbol, pos::AbstractVector{<:AbstractFloat})Transform geocentric coordinates to geodetic using the specified reference ellipsoid.
Input
model– ellipsoid identifier (Note 1)pos– geocentric vector (Note 2)
Output
ϵ– longitude (radians, east +ve, Note 3)ϕ– latitude (geodetic, radians, Note 3)r– height above ellipsoid (geodetic, Notes 2,3)
Note
The identifier
modelis a Symbol that specifies the choice of reference ellipsoid. The following are supported::WGS84 :GRS80 :WGS72
Unlike the SOFA C library, which uses a numerical code, the identifier is passed by name; any other value throws an AssertionError.
The geocentric vector (xyz, given) and height (height, returned) are in meters.
An unsupported model identifier or degenerate ellipsoid parameters cause an AssertionError to be thrown.
The inverse transformation is performed in the function gd2gc.
SOFA.gc2gde — Method
gc2gde(radius::AbstractFloat, oblate::AbstractFloat, pos::AbstractVector{<:AbstractFloat})Transform geocentric coordinates to geodetic for a reference ellipsoid of specified form.
Input
radius– equatorial radius (Notes 2,4)oblate– oblateness (Note 3)pos– geocentric vector (Note 4)
Output
ϵ– longitude (radians, east +ve)ϕ– latitude (geodetic, radians)r– height above ellipsoid (geodetic, Note 4)
Note
This function is based on the GCONV2H Fortran subroutine by Toshio Fukushima (see reference).
The equatorial radius, a, can be in any units, but meters is the conventional choice.
The flattening, f, is (for the Earth) a value around 0.00335, i.e. around 1/298.
The equatorial radius, a, and the geocentric vector, xyz, must be given in the same units, and determine the units of the returned height, height.
If an error occurs (status < 0), elong, phi and height are unchanged.
The inverse transformation is performed in the function gd2gce.
The transformation for a standard ellipsoid (such as WGS84) can more conveniently be performed by calling gc2gd, which uses a numerical code to identify the required A and F values.
References
Fukushima, T., "Transformation from Cartesian to geodetic coordinates accelerated by Halley's method", J.Geodesy (2006) 79: 689-693
SOFA.gd2gc — Method
gd2gc(model::Symbol, ϵ::AbstractFloat, ϕ::AbstractFloat, r::AbstractFloat)Transform geodetic coordinates to geocentric using the specified reference ellipsoid.
Input
model– ellipsoid identifier (Note 1)ϵ– longitude (radians, east +ve)ϕ– latitude (geodetic, radians, Note 3)r– height above ellipsoid (geodetic, Notes 2,3)
Output
pos– geocentric vector (Note 2)
Examples
julia> gd2gc(:WGS84, 3.1, -0.5, 2500.0)
3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
-5.599000557704994e6
233011.67223479153
-3.040909470698336e6Note
The identifier
modelis a Symbol that specifies the choice of reference ellipsoid. The following are supported::WGS84 :GRS80 :WGS72
Unlike the SOFA C library, which uses a numerical code, the identifier is passed by name; any other value throws an AssertionError.
The height (height, given) and the geocentric vector (xyz, returned) are in meters.
No validation is performed on the arguments ϵ, ϕ and r. An unsupported model identifier or ellipsoid parameters that would lead to arithmetic exceptions cause an AssertionError to be thrown.
The inverse transformation is performed in the function gc2gd.
SOFA.gd2gce — Method
gd2gce(radius::AbstractFloat, oblate::AbstractFloat, ϵ::AbstractFloat, ϕ::AbstractFloat, r::AbstractFloat)Transform geodetic coordinates to geocentric for a reference ellipsoid of specified form.
Input
radius– equatorial radius (Notes 1,4)oblate– oblateness (Notes 2,4)ϵ– longitude (radians, east +ve)ϕ– latitude (geodetic, radians, Note 4)r– height above ellipsoid (geodetic, Notes 3,4)
Output
pos– geocentric vector (Note 3)
Note
The equatorial radius, a, can be in any units, but meters is the conventional choice.
The flattening, f, is (for the Earth) a value around 0.00335, i.e. around 1/298.
The equatorial radius, a, and the height, height, must be given in the same units, and determine the units of the returned geocentric vector, xyz.
No validation is performed on individual arguments. The error status -1 protects against (unrealistic) cases that would lead to arithmetic exceptions. If an error occurs, xyz is unchanged.
The inverse transformation is performed in the function gc2gde.
The transformation for a standard ellipsoid (such as WGS84) can more conveniently be performed by calling gd2gc, which uses a numerical code to identify the required a and f values.
References
Green, R.M., Spherical Astronomy, Cambridge University Press, (1985) Section 4.5, p96.
Explanatory Supplement to the Astronomical Almanac, P. Kenneth Seidelmann (ed), University Science Books (1992), Section 4.22, p202.