Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distance squared is not necessary!? #3

Open
mueller-fr opened this issue Aug 31, 2023 · 0 comments
Open

distance squared is not necessary!? #3

mueller-fr opened this issue Aug 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mueller-fr
Copy link
Contributor

I think the closest distance to the next grid point can be obtained by looking at the lat and lon value seperately.

For finding the closest grid coordinate

look at lat and lon seperately

For the index

numpy's searchsorted() may be helpful since the values are sorted. It would work for getting the index of a grid point for each coordinate (lat and lon).

    index_lat = lats.searchsorted(grid_lat)
    index_lon = lons.searchsorted(grid_lon)
@mueller-fr mueller-fr added the enhancement New feature or request label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant