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.

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”

https://raw.githubusercontent.com/pbrod/Nvector/master/docs/tutorials/images/ex3img.png

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
>>> 'Ex3: Pos B: lat, lon = {:4.4f}, {:4.4f} deg, height = {:9.3f} m'.format(lat, lon, -z)
'Ex3: Pos B: lat, lon = 39.3787, -48.0128 deg, height = 4702059.834 m'

Example 4: “Geodetic latitude to ECEF-vector”

https://raw.githubusercontent.com/pbrod/Nvector/master/docs/tutorials/images/ex4img.png

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 clockwise relative to the x-axis.

azimuth_deg

Azimuth in degree clockwise relative to the x-axis.

elevation

Elevation in radian relative to the xy-plane.

elevation_deg

Elevation in degree relative to the xy-plane.

length

Length of the pvector.