Commit 80cc37a8 authored by CEVAER's avatar CEVAER
Browse files

Added comment

parent c8e22fbe
......@@ -4,7 +4,24 @@ import xarray as xr
from pyproj import Geod
import time
def find_nearest_2d(lon, lat, lonc, latc):
"""
Search for the index for values that are the closest to lonc and latc in the
arrays lon and lat.
Parameters
----------
lon numpy.ndarray 2D numpy array containing longitude
lat numpy.ndarray 2D numpy array containing latitude
lonc float corresponding to the searched coordinate in longitude array
latc float corresponding to the searched coordinate in latitude array
Returns
-------
int, int
Return the found indexes
"""
abslat = np.abs(lat - latc)
abslon = np.abs(lon - lonc)
c = np.maximum(abslon, abslat)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment