sasktran2.Geodetic#

class sasktran2.Geodetic(radius: float, flattening: float)[source]#

Bases: object

A geodetic object that can be used to represent a location on the surface of the Earth. The geodetic object is based on the WGS84 ellipsoid.

Parameters:
  • radius (float) – Radius of the ellipsoid in [m]

  • flattening (float) – Flattening of the ellipsoid (1 - b/a)

__init__(radius: float, flattening: float)[source]#

A geodetic object that can be used to represent a location on the surface of the Earth. The geodetic object is based on the WGS84 ellipsoid.

Parameters:
  • radius (float) – Radius of the ellipsoid in [m]

  • flattening (float) – Flattening of the ellipsoid (1 - b/a)

Methods

__init__(radius, flattening)

A geodetic object that can be used to represent a location on the surface of the Earth.

altitude_intercepts(altitude, observer, ...)

Calculate the two intersections of a line of sight and an altitude.

from_lat_lon_alt(latitude, longitude, altitude)

Initializes the Geodetic based on a specifiec latitude, longitude, and altitude.

from_tangent_altitude(altitude, observer, ...)

Initialized the Geodetic from a specified tangent altitude, obsever location, and bore sight plane.

from_tangent_point(observer, look_vector)

Initializes the Geodetic by calculating the tangent point from an observer position and look vector

from_xyz(location)

Initializes the Geodetic from a geocentric location

osculating_spheroid()

Returns the osculating spheroid at the current location.

Attributes

altitude

returns: Altitude in [m] above the surface of the ellipsoid.

latitude

returns: Geodetic latitude in degrees :rtype: float

local_south

returns: A unit vector pointing in the local south direction :rtype: np.ndarray

local_up

returns: A unit vector pointing up (perpindicular to the ellipsoidal surface) :rtype: np.ndarray

local_west

returns: A unit vector pointing in the local west direction :rtype: np.ndarray

location

returns: Geocentric location in cartesian coordinates :rtype: np.ndarray

longitude

returns: Geodetic longitude in degrees :rtype: float

valid

returns: True if the geodetic object has been initialized, False otherwise.

property altitude: float#

returns: Altitude in [m] above the surface of the ellipsoid. :rtype: float

altitude_intercepts(altitude: float, observer: np.ndarray, look_vector: np.ndarray)[source]#

Calculate the two intersections of a line of sight and an altitude.

Parameters:
  • altitude (float) – Altitude in meters.

  • observer (np.ndarray) – Three element array containing the obsever position in geocentric coordinates.

  • look_vector (np.ndarray) – Three element array containing a normalized look vector.

Returns:

  • np.ndarray – Three element array containing the first (entering) intercept in geocentric coordinates.

  • np.ndarray – Three element array containing the second (exiting) intercept in geocentric coordinates.

Examples

>>> import sasktran2 as sk
>>> import numpy as np
>>> geodetic = sk.WGS84()
>>> look = geodetic.from_tangent_altitude(15322, [3.676013154788849600e+005, 1.009976313640051500e+006,                                                     -6.871601202127538600e+006], [0, 0, 1])
>>> obs = geodetic.location
>>> intercept1, intercept2 = geodetic.altitude_intercepts(16000, obs, look)
>>> print(np.array_str(intercept1, precision=3))
[ 1147302.059  3152186.5   -5425360.027]
>>> print(np.array_str(intercept2, precision=3))
[ 1201098.489  3299990.978 -5325574.803]
from_lat_lon_alt(latitude: float, longitude: float, altitude: float)[source]#

Initializes the Geodetic based on a specifiec latitude, longitude, and altitude.

Parameters:
  • latitude (float) – Latitude in degrees (-90 to 90)

  • longitude (float) – Longitude in degrees (0 to 360 or -180 to 180)

  • altitude (float) – Altitude above the geoid in metres

Examples

>>> import sasktran2 as sk
>>> geodetic = sk.WGS84()
>>> geodetic.from_lat_lon_alt(latitude=-15, longitude=-20, altitude=7342)
>>> print(geodetic)
WGS84 Location:
Latitude: -15.0, Longitude: 340.0, Altitude: 7342.0
from_tangent_altitude(altitude: float, observer: ndarray, boresight: ndarray) ndarray[source]#

Initialized the Geodetic from a specified tangent altitude, obsever location, and bore sight plane.

Parameters:
  • altitude (float) – Tangent altitude in meters

  • observer (np.ndarray) – Three element array containing the obsever position in geocentric coordinates

  • boresight (np.ndarray) – Three element array containing a normalized look vector that is within the bore sight plane.

Returns:

Three element array containing the normalized look vector to the tangent point.

Return type:

np.ndarray

Examples

>>> import sasktran2 as sk
>>> geodetic = sk.WGS84()
>>> look = geodetic.from_tangent_altitude(15322, [ 3.676013154788849600e+005, 1.009976313640051500e+006,                                                            -6.871601202127538600e+006], [0, 0, 1])
>>> print(look)
[0.28880556 0.79348676 0.53569591]
>>> print(geodetic)
WGS84 Location:
Latitude: -57.60888188776806, Longitude: 70.00000000000001, Altitude: 15321.971935882739
from_tangent_point(observer, look_vector)[source]#

Initializes the Geodetic by calculating the tangent point from an observer position and look vector

Parameters:
  • observer (np.ndarray) – Three element array containing the observer position in geocentric coordinates

  • look_vector (np.ndarray) – Three element array containing a normalized look vector

Examples

>>> import sasktran2 as sk
>>> geodetic = sk.WGS84()
>>> geodetic.from_tangent_point([ 3.676013154788849600e+005, 1.009976313640051500e+006,                                            -6.871601202127538600e+006], [ 2.884568631765662100e-001,                                            7.925287180643269000e-001,  5.372996083468238900e-001])
>>> print(geodetic)
WGS84 Location:
Latitude: -57.500000192733594, Longitude: 70.0, Altitude: 10002.99586173162
from_xyz(location: ndarray)[source]#

Initializes the Geodetic from a geocentric location

Parameters:

location (np.ndarray) – Three element vector containing a location in geocentric coordinates

Examples

>>> import sasktran2 as sk
>>> geodetic = sk.WGS84()
>>> geodetic.from_xyz([ 5797230.47518212, -2110019.3341472, -1642001.16317228])
>>> print(geodetic)
WGS84 Location:
Latitude: -14.999999973747736, Longitude: 340.00000000000006, Altitude: 7344.999610390202
property latitude: float#

returns: Geodetic latitude in degrees :rtype: float

property local_south: ndarray#

returns: A unit vector pointing in the local south direction :rtype: np.ndarray

property local_up: ndarray#

returns: A unit vector pointing up (perpindicular to the ellipsoidal surface) :rtype: np.ndarray

property local_west: ndarray#

returns: A unit vector pointing in the local west direction :rtype: np.ndarray

property location: ndarray#

returns: Geocentric location in cartesian coordinates :rtype: np.ndarray

property longitude: float#

returns: Geodetic longitude in degrees :rtype: float

osculating_spheroid() tuple[float, ndarray][source]#

Returns the osculating spheroid at the current location.

The osculating spheroid is the best fit sphere to the geoid at the current location.

Returns:

  • float – The radius of the osculating spheroid in meters.

  • np.ndarray – A three element array containing the offset of the center of the geoid to the center of the osculating spheroid in geocentric coordinates.

property valid: bool#

returns: True if the geodetic object has been initialized, False otherwise. :rtype: bool