geotess.lib.geotessutils#

class geotess.lib.geotessutils.GeoTessUtils#

Bases: object

Collection of static functions to manipulate geographic information.

The Utils class provides basic static utility functions for GeoTess to manipulate geographic information.

static getEarthRadius(double[:] v)#

Retrieve the radius of the Earth in km at the position specified by an Earth-centered unit vector. Uses the WGS84 ellipsoid.

Parameters:

v (array_like) – 3-element unit vector

Returns:

Radius of the Earth in km at specified position.

Return type:

float

static getGreatCircle(double[:] v0, double azimuth)#

This method returns a great circle that is defined by an initial point and an azimuth.

A great circle is defined by two unit vectors that are 90 degrees apart. A great circle is stored in a double[2][3] array, which is the structure returned by this method. A great circle can be passed to the method getGreatCirclePoint() to retrieve a unit vector that is on the great circle and located some distance from the first point of the great circle.

This method returns a great circle that is defined by an initial point and an azimuth.

Parameters:
  • v0 (3-element array of floats) – a unit vector that will be the first point on the great circle.

  • azimuth (float) – a direction, in radians, in which to move relative to v in order to define the great circle

Returns:

gc – unit vector v0 passed as first argument to this method. The second is located 90 degrees away from v0.

Return type:

a 2 x 3 array specifying two unit vectors. The first one is a clone of

Raises:

GeoTessException – if v is located at north or south pole.

static getGreatCirclePoint(double[:, :] greatCircle, double distance)#

A great circle is defined by two unit vectors that are 90 degrees apart. A great circle is stored in a double[2][3] array and one can be obtained by calling one of the getGreatCircle() methods.

In this method, a great circle and a distance are specified and a point is returned which is on the great circle path and is the specified distance away from the first point of the great circle.

Parameters:
  • greatCircle (array-like 2x3 of floats) – a great circle structure

  • distance (float) – distance in radians from first point of great circle

Returns:

  • unit vector of point which is on great circle and located specified

  • distance away from first point of great circle.

static getLatDegrees(double[:] v)#

Convert a 3-component unit vector to geographic latitude, in degrees. Uses the WGS84 ellipsoid.

Parameters:

v (array_like) – 3-component unit vector of floats

Returns:

Geographic latitude in degrees.

Return type:

float

Notes

Input arrays longer than length three ignore the remaining values.

static getLonDegrees(double[:] v)#

Convert a 3-component unit vector to geographic longitude, in degrees. Uses the WGS84 ellipsoid.

Parameters:

v (array_like) – 3-component unit vector

Returns:

Geographic longitude in degrees.

Return type:

float

Notes

Input arrays longer than length three ignore the remaining values.

static getVectorDegrees(double lat, double lon)#

Convert geographic lat, lon into a geocentric unit vector.

The x-component points toward lat,lon = 0, 0. The y-component points toward lat,lon = 0, 90. The z-component points toward north pole. Uses the WGS84 ellipsoid.

Parameters:
  • lat (float)

  • lon (float)

Returns:

x, y, z floats

Return type:

numpy.ndarray