seagrid.utils.lldist#
Great-circle distances (2.x interface). All distances are in metres.
New code uses seagrid.grids.metrics.great_circle().
Module Attributes
Mean Earth radius in metres. |
Functions
|
Return the matrix of distances between all pairs of points. |
|
Return the distance between row 0 and row 1 of 2-D coordinates, per column. |
|
Return the distance between corresponding points of two sets. |
|
Return the distance from each point of a track to the previous one. |
|
Return the distance between positions given as |
- seagrid.utils.lldist.distance_matrix(lonvec, latvec)[source]#
Return the matrix of distances between all pairs of points.
- seagrid.utils.lldist.earth_radius = 6371000.0#
Mean Earth radius in metres.
- seagrid.utils.lldist.ll2dist(lon, lat)[source]#
Return the distance between row 0 and row 1 of 2-D coordinates, per column.
- seagrid.utils.lldist.ll2dist2vec(lonvec1, latvec1, lonvec2, latvec2)[source]#
Return the distance between corresponding points of two sets.
- seagrid.utils.lldist.lldist(lon, lat)[source]#
Return the distance from each point of a track to the previous one.
- Parameters:
lon (
array_like) – 1-D track positions in decimal degrees.lat (
array_like) – 1-D track positions in decimal degrees.
- Returns:
numpy.ndarray– Same length as the track; the first element is 0.- Return type:
- seagrid.utils.lldist.spherical_dist(pos1, pos2, r=EARTH_RADIUS)[source]#
Return the distance between positions given as
[..., (lat, lon)].- Parameters:
pos1 (
array_like) – Latitude and longitude in decimal degrees along the last axis.pos2 (
array_like) – Latitude and longitude in decimal degrees along the last axis.r (
float, optional) – Sphere radius in metres. Defaultearth_radius. (In 2.x the default was 3958.75 but was ignored.)
- Returns:
- Return type: