huracanpy.calc.distance#
- huracanpy.calc.distance(lon, lat, *args, track_id=None, method='geod', ellps='WGS84')[source]#
Compute distance between longitude/latitude coordinates using geodesic or haversine calculation
>>> distance(lon, lat, track_id) Computes the distance between successive lon, lat points, without including differences between the end and start points of different tracks
>>> distance(lon1, lat1, lon2, lat2) Computes the distance between each point in (lon1, lat1) and each point in (lon2, lat2)
- Parameters:
lon (xarray.DataArray)
lat (xarray.DataArray)
*args (xarray.DataArray) –
0 arguments. Leave empty to calculate distance between successive points
- 1 argument, track_id. Same as 0 arguments but inserts NaNs where successive
points are from different tracks
- 2 arguments, lon and lat arrays. Calculate distances between two tracks,
e.g. radius of maximum wind speed, using storm centre locations and maximum wind speed locations
track_id (array_like, optional)
method (str, optional) – The method of computing distances, either geodesic (“geod”) or haversine (“haversine”)
ellps (str, optional) – The definition of the globe to use for the geodesic calculation (see pyproj.Geod). Default is “WGS84”.
- Return type: