emp.geometry
Copyright (C) 2023 by The RAND Corporation See LICENSE and README.md for information on usage and licensing.
Contains the Point class describe locations in a coordinate-independent manner.
Functions
|
The angle A b/w the line of sight radial vector and the vertical/origin-burst vector. |
|
Get the position vector in geographic cartesian coordinates to a point mid-way between the upper and lower absorption layers, along the line of sight ray. |
|
Rotation matrix for angle theta and axis (vx, vy, vz). |
|
Compute the vector pointing from A to B in geographic cartesian coordinates. |
|
Computes the great-circle distance bewteen points A, B on the sphere. |
|
Given a burst and target point, compute the vector pointing from B to T and confirm that this vector's length is less than the length of the tangent vector pointing from B to a point on the surface. |
Classes
|
A point class used to handle the many different coordinate transformations used. |
- emp.geometry.get_rotation_matrix(theta, axis)[source]
Rotation matrix for angle theta and axis (vx, vy, vz). https://en.wikipedia.org/wiki/Rotation_matrix#Conversion_from_rotation_matrix_to_axis%E2%80%93angle
- Parameters:
theta (float) – Rotation angle, in radians.
- Returns:
Rotation matrix.
- Return type:
NDArray[np.float64]
- class emp.geometry.Point(coord1, coord2, coord3, coordsys, consistency_check=True)[source]
A point class used to handle the many different coordinate transformations used.
- __init__(coord1, coord2, coord3, coordsys, consistency_check=True)[source]
Initialize a point by recording the point in all 4 coordinate systems.
- Parameters:
coord1 (float) – First coordinate.
coord2 (float) – Second coordinate.
coord3 (float) – Third coordinate.
coordsys (str) – Coordinate system. Must be one of [‘lat/long geo’, ‘cartesian geo’, ‘lat/long mag’, ‘cartesian mag’].
consistency_check (bool, optional) – Once the point has been transformed to each of the four coordinate systems, perform a check by performing all possible coordinate transformations and checking that they all agree. By default True
- classmethod from_gps_coordinates(latitude, longitude, altitude_km=0.0)[source]
Create a Point from GPS-style coordinates.
- Parameters:
- Returns:
A Point object in geographic lat/long coordinates.
- Return type:
- emp.geometry.get_xvec_g_from_A_to_B(pointA, pointB)[source]
Compute the vector pointing from A to B in geographic cartesian coordinates.
- emp.geometry.great_circle_distance(pointA, pointB)[source]
Computes the great-circle distance bewteen points A, B on the sphere. see: http://www.movable-type.co.uk/scripts/latlong.html
- emp.geometry.get_A_angle(point_b, point_s)[source]
The angle A b/w the line of sight radial vector and the vertical/origin-burst vector.
- emp.geometry.get_line_of_sight_midway_point(point_b, point_t)[source]
Get the position vector in geographic cartesian coordinates to a point mid-way between the upper and lower absorption layers, along the line of sight ray.