pyinterp.geodetic.coordinate_distances#

pyinterp.geodetic.coordinate_distances(lon1: numpy.ndarray[numpy.float64[m, 1]], lat1: numpy.ndarray[numpy.float64[m, 1]], lon2: numpy.ndarray[numpy.float64[m, 1]], lat2: numpy.ndarray[numpy.float64[m, 1]], strategy: str = 'thomas', wgs: pyinterp.core.geodetic.Spheroid | None = None, num_threads: int = 0) numpy.ndarray[numpy.float64]#

Returns the distance between the given coordinates.

Parameters:
  • lon1 – Longitudes in degrees.

  • lat1 – Latitudes in degrees.

  • lon2 – Longitudes in degrees.

  • lat2 – Latitudes in degrees.

  • strategy – The calculation method used to calculate the distance. This parameter can take the values “andoyer”, “thomas” or “vincenty”.

  • wgs – The spheroid used to calculate the distance. Defaults to None, which means the WGS-84 spheroid is used.

  • num_threads – The number of threads to use for the computation. If 0 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. Defaults to 0.

Returns:

An array containing the distances [..., distance_i, ...], corresponding to the distances between the coordinates [..., (Point(lon1_i, lat1_i), Point(lon2_i, lat2_i)), ...].