climate_toolbox.geo package¶
Submodules¶
climate_toolbox.geo.distance module¶
-
climate_toolbox.geo.distance.
great_circle
(ax, ay, bx, by, radius=6371.009)[source]¶ calculate the great circle distance (km) between points
Provide points (ax, ay) and (bx, by) as floats, or as vectors. If ax and ay are vectors or arrays of the same shape, the element-wise distance will be found between points in the vectors/arrays. If ax, ay are (Mx1) column vectors and (bx, by) are (1xN) row vectors, the vectors will be broadcast using numpy broadcasting rules and the distance between each pair of points will be returned as an (MxN) matrix.
- Parameters
ax (float or array) – x/long of point a
ay (float or array) – y/lat of point a
bx (float or array) – x/long of point b
by (float or array) – y/lat of point b
radius (float, optional) – Radius of the sphere on which to calculate the great circle distance (default is to use the Earth’s radius in km, 6371.009). Values returned will be in units of the radius provided.
- Returns
distance – great circle distance between points a and b. Units will match the radius provided (default km)
- Return type
float or array