5.1.5. nvector.objects.ECEFvector¶
-
class
ECEFvector
(pvector, frame=None, scalar=None)[source]¶ Geographical position given as cartesian position vector in frame E
- Parameters
- pvector: 3 x n array
Cartesian position vector(s) [m] from E to B, decomposed in E.
- frame: FrameE object
reference ellipsoid. The default ellipsoid model used is WGS84, but other ellipsoids/spheres might be specified.
See also
Notes
The position of B (typically body) relative to E (typically Earth) is given into this function as p-vector, p_EB_E relative to the center of the frame.
Examples
Example 3: “ECEF-vector to geodetic latitude”
Position B is given as an “ECEF-vector” p_EB_E (i.e. a vector from E, the center of the Earth, to B, decomposed in E). Find the geodetic latitude, longitude and height (latEB, lonEB and hEB), assuming WGS-84 ellipsoid.
- Solution:
>>> import numpy as np >>> import nvector as nv >>> wgs84 = nv.FrameE(name='WGS84') >>> position_B = 6371e3 * np.vstack((0.9, -1, 1.1)) # m >>> p_EB_E = wgs84.ECEFvector(position_B) >>> pointB = p_EB_E.to_geo_point()
>>> lat, lon, z = pointB.latlon_deg >>> msg = 'Ex3: Pos B: lat, lon = {:4.2f}, {:4.2f} deg, height = {:9.2f} m' >>> msg.format(lat, lon, -z) 'Ex3: Pos B: lat, lon = 39.38, -48.01 deg, height = 4702059.83 m'
Example 4: “Geodetic latitude to ECEF-vector”
Geodetic latitude, longitude and height are given for position B as latEB, lonEB and hEB, find the ECEF-vector for this position, p_EB_E.
- Solution:
>>> import nvector as nv >>> wgs84 = nv.FrameE(name='WGS84') >>> pointB = wgs84.GeoPoint(latitude=1, longitude=2, z=-3, degrees=True) >>> p_EB_E = pointB.to_ecef_vector()
>>> 'Ex4: p_EB_E = {} m'.format(p_EB_E.pvector.ravel().tolist()) 'Ex4: p_EB_E = [6373290.277218279, 222560.20067473652, 110568.82718178593] m'
-
__init__
(pvector, frame=None, scalar=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(pvector[, frame, scalar])Initialize self.
change_frame
(frame)Converts to Cartesian position vector in another frame
delta_to
(other)Returns cartesian delta vector from positions a to b decomposed in N.
to_ecef_vector
()Returns position as ECEFvector object.
to_geo_point
()Returns position as GeoPoint object.
to_nvector
()Returns position as Nvector object.
Attributes
azimuth
Azimuth in radian
azimuth_deg
Azimuth in degree.
elevation
Elevation in radian.
elevation_deg
Elevation in degree.
length
Length of the pvector.