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

New median_distance func for near neighbors #163

Merged
merged 4 commits into from
Dec 20, 2018
Merged

New median_distance func for near neighbors #163

merged 4 commits into from
Dec 20, 2018

Conversation

leouieda
Copy link
Member

The new median_distance function calculates the median near neighbor distance between each point in the given dataset. It automates the process of creating a kdtree and querying it on the same input points. It will take a median of the k nearest neighbors for each point and handle projections and reshaping of the output.

This type of function is useful to get a sense for how scattered are the data points and what would be a reasonable grid spacing or block mean spacing.

Fixes #127

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and verde/__init__.py.
  • Write detailed docstrings for all functions/classes/methods.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.

@leouieda
Copy link
Member Author

@jessepisel I could use some feedback on this PR. I'm not entirely sure this is the best way of doing this sort of calculation or if the results are actually meaningful for setting grid spacings etc. What do you think?

@leouieda
Copy link
Member Author

Actually, I'm gonna go ahead and merge this because I will need this function for some new gridders. But I'll wait a while before using it in the docs (#164).

@leouieda leouieda merged commit dbf3886 into master Dec 20, 2018
@leouieda leouieda deleted the distance branch December 20, 2018 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convenience function for near neighbor distances
1 participant