geocentric.jl
Astrometry.SOFA.eform
— Functioneform(model::Symbol)
Earth reference ellipsoids.
Input
model
– ellipsoid identifier (Note 1)
Output
radius
– equatorial radius (meters, Note 2)oblate
– oblateness (Note 2)
Note
The identifier n is a number that specifies the choice of reference ellipsoid. The following are supported:
ellipsoid
:WGS84 :GRS80 :WGS72
The n value has no significance outside the ERFA software. For convenience, symbols ERFA_WGS84 etc. are defined in erfam.h.
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 n value is supplied, zero a and f are returned, as well as error status.
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.
Astrometry.SOFA.gc2gd
— Functiongc2gd(model::Symbol, pos::Vector{Float64})
Transform geocentric coordinates to geodetic using the specified reference ellipsoid.
Input
model::Int
: ellipsoid identifier (Note 1)pos::Vector{Float64}
: geocentric vector (Note 2)
Output
ϵ::Float64
: longitude (radians, east +ve, Note 3)ϕ::Float64
: latitude (geodetic, radians, Note 3)r::Float64
: height above ellipsoid (geodetic, Notes 2,3)
Note
The identifier n is a number that specifies the choice of reference ellipsoid. The following are supported:
ellipsoid
:WGS84 :GRS80 :WGS72
The n value has no significance outside the ERFA software. For convenience, symbols ERFA_WGS84 etc. are defined in erfam.h.
The geocentric vector (xyz, given) and height (height, returned) are in meters.
An error status -1 means that the identifier n is illegal. An error status -2 is theoretically impossible. In all error cases, all three results are set to -1e9.
The inverse transformation is performed in the function eraGd2gc.
Astrometry.SOFA.gc2gde
— Functiongc2gde(radius::Float64, oblate::Float64, pos::Vector{Float64})
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 eraGd2gce.
The transformation for a standard ellipsoid (such as ERFA_WGS84) can more conveniently be performed by calling eraGc2gd, 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
Astrometry.SOFA.gd2gc
— Functiongd2gc(model::Symbol, ϵ::Float64, ϕ::Float64, r::Float64)
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)
Note
The identifier n is a number that specifies the choice of reference ellipsoid. The following are supported:
ellipsoid
:WGS84 :GRS80 :WGS72
The n value has no significance outside the ERFA software. For convenience, symbols ERFA_WGS84 etc. are defined in erfam.h.
The height (height, given) and the geocentric vector (xyz, returned) are in meters.
No validation is performed on the arguments elong, phi and height. An error status -1 means that the identifier n is illegal. An error status -2 protects against cases that would lead to arithmetic exceptions. In all error cases, xyz is set to zeros.
The inverse transformation is performed in the function eraGc2gd.
Astrometry.SOFA.gd2gce
— Functiongd2gce(radius::Float64, oblate::Float64, ϵ::Float64, ϕ::Float64, r::Float64)
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 eraGc2gde.
The transformation for a standard ellipsoid (such as ERFA_WGS84) can more conveniently be performed by calling eraGd2gc, 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.