Created
October 25, 2017 17:20
-
-
Save beatorizu/cb7b97572b5854cd6182ee5ddabff4b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find_nearest_point(latitude, longitude, l_latitude, l_longitude): | |
| """ | |
| This function find the index of the nearest value to the latitude and longitude values int the l_latitude and | |
| l_longitude lists. | |
| Parameters | |
| ---------- | |
| latitude: float | |
| longitude: float | |
| l_latitude: list | |
| l_longitude: list | |
| Returns | |
| ------- | |
| tuple | |
| the index of latitude and longitude | |
| """ | |
| i_latitude = (np.abs(l_latitude-latitude)).argmin() | |
| i_longitude = (np.abs(l_longitude-longitude)).argmin() | |
| return i_latitude, i_longitude |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment