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

Add a 1D version of grid_coordinates #390

Merged
merged 3 commits into from Nov 16, 2022
Merged

Add a 1D version of grid_coordinates #390

merged 3 commits into from Nov 16, 2022

Conversation

leouieda
Copy link
Member

Instead of adding the ability to generated 3D coordinates to grid_coordinates, it's more straightforward to add a 1D version of numpy.linspace that can take a spacing instead of a number, knows how to adjust spacing/region, and can return pixel-registered coordinates. This function is then used in grid_coordinates and can be used to generate n-dimensional coordinates if desired (by calling numpy.meshgrid).

Relevant issues/PRs:

Fixes #138

@leouieda
Copy link
Member Author

Had a hard time naming this. Decided to use linspace since it does what we would have liked numpy.linspace to do. But using it this way can make it confusing in the code and also in user code (vd.linspace and np.linspace are very similar). Any suggestion for a better name would be very welcome.

cc @santisoler @LL-Geo @MGomezN @aguspesce

Instead of adding the ability to generated 3D coordinates to
grid_coordinates, it's more straightforward to add a 1D version of
numpy.linspace that can take a spacing instead of a number, knows how to
adjust spacing/region, and can return pixel-registered coordinates. This
function is then used in grid_coordinates and can be used to generate
n-dimensional coordinates if desired (by calling numpy.meshgrid).
@leouieda
Copy link
Member Author

How about line_coordinates for lack of a better name?

@leouieda leouieda changed the title Add linspace, a 1D version of grid_coordinates Add a 1D version of grid_coordinates Oct 27, 2022
@leouieda leouieda merged commit a42126b into main Nov 16, 2022
@leouieda leouieda deleted the linspace branch November 16, 2022 09:03
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.

Add support for generating N-dimensional grids
1 participant