utils.geoPack

Module: utils.geoPack

This module contains the following functions:
  • utils.geoPack.geodToGeoc():

    converts from geodetic to geocentric (and vice-versa)

  • utils.geoPack.geodToGeocAzEl():

    converts azimuth and elevation from geodetic to geocentric (and vice-versa)

  • utils.geoPack.gspToGcar():

    converts global spherical coordinates to global cartesian coordinates (and vice-versa)

  • utils.geoPack.gcarToLcar():

    converts from global cartesian coordinates to local cartesian coordinates (and vice-versa)

  • utils.geoPack.lspToLcar():

    converts from local spherical coordinates to local cartesian coordinates (and vice-versa)

  • utils.geoPack.calcDistPnt():

    calculates the coordines|distance,elevation,azimuth of a point given a point of origin and distance,elevation,azimuth|distant point coordinates

  • func:utils.geoPack.greatCircleMove: Calculates the coordinates of an end point along a great circle path given the original coordinates, distance, azimuth, and altitude.
  • func:utils.geoPack.greatCircleAzm: Calculates the azimuth from the coordinates of a start point to and end point along a great circle path.
  • func:utils.geoPack.greatCircleDist: Calculates the distance in radians along a great circle path between two points.

Based on J.M. Ruohoniemi’s geopack Based on R.J. Barnes radar.pro

utils.geoPack.calcDistPnt(origLat, origLon, origAlt, dist=None, el=None, az=None, distLat=None, distLon=None, distAlt=None)[source]

Calculate: - the coordinates and altitude of a distant point given a point of origin, distance, azimuth and elevation, or

  • the coordinates and distance of a distant point given a point of origin, altitude, azimuth and elevation, or
  • the distance, azimuth and elevation between a point of origin and a distant point or
  • the distance, azimuth between a point of origin and a distant point and the altitude of said distant point given

a point of origin, distant point and elevation angle.

Input/output is in geodetic coordinates, distances are in km and angles in degrees.

Args:
  • origLat: geographic latitude of point of origin [degree]
  • origLon: geographic longitude of point of origin [degree]
  • origAlt: altitude of point of origin [km]
  • [dist]: distance to point [km]
  • [el]: azimuth [degree]
  • [az]: elevation [degree]
  • [distLat]: latitude [degree] of distant point
  • [distLon]: longitude [degree] of distant point
  • [distAlt]: altitide [km] of distant point
Returns:
  • dict: a dictionary containing all the information about origin and distant points and their relative positions
utils.geoPack.gcarToLcar(X, Y, Z, lat, lon, rho, inverse=False)[source]

Converts a position from global cartesian to local cartesian (and vice-versa). The global cartesian coordinate system is defined as:

  • origin: center of the Earth
  • Z axis in the direction of the rotational axis and through the North pole
  • X axis in the equatorial plane and through the prime meridian.
The local cartesian coordinate system is defined as:
  • origin: local position
  • X: East
  • Y: North
  • Z: up

The meaning of the input (X,Y,Z) depends on the direction of the conversion (to global cartesian or to global spherical).

Args:
  • X: global cartesian X [km] or local cartesian X [km]
  • Y: global cartesian Y [km] or local cartesian Y [km]
  • Z: global cartesian Z [km] or local cartesian Z [km]
  • lat: geocentric latitude [degree] of local cartesian system origin
  • lon: geocentric longitude [degree] of local cartesian system origin
  • rho: distance from center of the Earth [km] of local cartesian system origin
  • [inverse]: inverse conversion
Returns:
  • X: local cartesian X [km] or global cartesian X [km]
  • Y: local cartesian Y [km] or global cartesian Y [km]
  • Z: local cartesian Z [km] or global cartesian Z [km]
utils.geoPack.geodToGeoc(lat, lon, inverse=False)[source]

Converts position from geodetic to geocentric and vice-versa. Based on the IAU 1964 oblate spheroid model of the Earth.

Args:
  • lat: latitude [degree]
  • lon: longitude [degree]
  • [inverse]: inverse conversion
Returns:
  • lat: latitude [degree]
  • lon: longitude [degree]
  • Re: Earth radius [km]
utils.geoPack.geodToGeocAzEl(lat, lon, az, el, inverse=False)[source]

Converts pointing azimuth and elevation measured with respect to the local horizon to azimuth and elevation with respect to the horizon defined by the plane perpendicular to the Earth-centered radial vector drawn through a user defined point.

Args:
  • lat: latitude [degree]
  • lon: longitude [degree]
  • az: azimuth [degree, N]
  • el: elevation [degree]
  • [inverse]: inverse conversion
Returns:
  • lat: latitude [degree]
  • lon: longitude [degree]
  • Re: Earth radius [km]
  • az: azimuth [degree, N]
  • el: elevation [degree]
utils.geoPack.greatCircleAzm(lat1, lon1, lat2, lon2)[source]

Calculates the azimuth from the coordinates of a start point to and end point along a great circle path.

Args:
  • lat1: latitude [deg]
  • lon1: longitude [deg]
  • lat2: latitude [deg]
  • lon2: longitude [deg]
Returns:
  • azm: azimuth [deg]
utils.geoPack.greatCircleDist(lat1, lon1, lat2, lon2)[source]

Calculates the distance in radians along a great circle path between two points.

Args:
  • lat1: latitude [deg]
  • lon1: longitude [deg]
  • lat2: latitude [deg]
  • lon2: longitude [deg]
Returns:
  • radDist: distance [radians]
utils.geoPack.greatCircleMove(origLat, origLon, dist, az, alt=0)[source]

Calculates the coordinates of an end point along a great circle path given the original coordinates, distance, azimuth, and altitude.

Args:
  • origLat: latitude [degree]
  • origLon: longitude [degree]
  • dist: distance [km]
  • az: azimuth [deg]
  • alt: altitude [km] (added to default Re = 6378.1 km)
Returns:
  • list: [latitude, longitude] [deg]
utils.geoPack.gspToGcar(X, Y, Z, inverse=False)[source]

Converts a position from global spherical (geocentric) to global cartesian (and vice-versa). The global cartesian coordinate system is defined as:

  • origin: center of the Earth
  • X axis in the equatorial plane and through the prime meridian.
  • Z axis in the direction of the rotational axis and through the North pole

The meaning of the input (X,Y,Z) depends on the direction of the conversion (to global cartesian or to global spherical).

Args:
  • X: latitude [degree] or global cartesian X [km]
  • Y: longitude [degree] or global cartesian Y [km]
  • Z: distance from center of the Earth [km] or global cartesian Z [km]
  • [inverse]: inverse conversion
Returns:
  • X: global cartesian X [km] or latitude [degree]
  • Y: global cartesian Y [km] or longitude [degree]
  • Z: global cartesian Z [km] or distance from center of the Earth [km]
utils.geoPack.lspToLcar(X, Y, Z, inverse=False)[source]

Converts a position from local spherical to local cartesian (and vice-versa). The local spherical coordinate system is defined as:

  • origin: local position
  • azimuth (with respect to North)
  • Elevation (with respect to horizon)
  • Altitude
The local cartesian coordinate system is defined as:
  • origin: local position
  • X: East
  • Y: North
  • Z: up

The meaning of the input (X,Y,Z) depends on the direction of the conversion (to global cartesian or to global spherical).

Args:
  • X: azimuth [degree, N] or local cartesian X [km]
  • Y: elevation [degree] or local cartesian Y [km]
  • Z: distance origin [km] or local cartesian Z [km]
  • [inverse]: inverse conversion
Returns:
  • X: local cartesian X [km] or azimuth [degree, N]
  • Y: local cartesian Y [km] or elevation [degree]
  • Z: local cartesian Z [km] or distance from origin [km]
utils.geoPack

alias of utils.geoPack

Previous topic

utils.plotUtils

Next topic

utils.calcSun

This Page