-
Notifications
You must be signed in to change notification settings - Fork 74
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 support for generating N-dimensional grids #138
Labels
enhancement
Idea or request for a new feature
Comments
leouieda
added a commit
that referenced
this issue
Oct 11, 2018
Gridder methods `grid`, `scatter`, and `profile` now take in `**kwargs` and pass them along to the coordinate generation functions. This will allow extra flexibility for passing in arguments, like a grid height or configuration, without needing to keep the methods in sync with the functions. Removed the `coordinate_system` mechanics from `profile` because it wasn't implemented and is probably gonna take a while. Will introduce it back when we finally have a geographic coordinate gridder. This simplifies the coordinate naming schemes and other functions. This is a step towards #138
5 tasks
leouieda
added a commit
that referenced
this issue
Oct 11, 2018
Gridder methods `grid`, `scatter`, and `profile` now take in `**kwargs` and pass them along to the coordinate generation functions. This will allow extra flexibility for passing in arguments, like a grid height or configuration, without needing to keep the methods in sync with the functions. Removed the `coordinate_system` mechanics from `profile` because it wasn't implemented and is probably gonna take a while. Will introduce it back when we finally have a geographic coordinate gridder. This simplifies the coordinate naming schemes and other functions. This is a step towards #138
leouieda
added a commit
that referenced
this issue
Oct 11, 2018
The `grid_coordinates`, `scatter_points`, and `profile_coordinates` all accept a new a `extra_coords` argument with the constant value to be used as an extra coordinate. If given, then the output will have an extra coordinate array of the same shape as the rest and with that single value. If a list is given, multiple extra coordinate arrays will be returned. This can be used to specify constant coordinates to a grid generator, like height or time, to generate a 2D grid/scatter/profile from data that requires 3+ coordinates. A step towards #138
5 tasks
leouieda
added a commit
that referenced
this issue
Oct 11, 2018
The `grid_coordinates`, `scatter_points`, and `profile_coordinates` all accept a new a `extra_coords` argument with the constant value to be used as an extra coordinate. If given, then the output will have an extra coordinate array of the same shape as the rest and with that single value. If a list is given, multiple extra coordinate arrays will be returned. This can be used to specify constant coordinates to a grid generator, like height or time, to generate a 2D grid/scatter/profile from data that requires 3+ coordinates. A step towards #138
This was referenced Jul 23, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the desired feature
Grids are generated by the
BaseGridder.grid
method, which relies oncoordinates.grid_coordinates
to generate the coordinates for prediction. There is a heavy assumption of only 2 dimensions for the grid in the code:region
is assumed to be[W, E, S, N]
, assigning coords toxarray.Dataset
is hard-coded, etc. This is fine for gridders in this package because none of them support predicting data in 3D from 2D observations.This is not the case for harmonic functions, like gravity and magnetic data. Because of Green's identities, you can predict these data anywhere in space from observations on a surface. This is know as the equivalent layer technique and it will be implemented in harmonica using Verde as a basis. So it would be good to:
grid_coordinates
to take N-dimensionalregion
,spacing
, andshape
. For example,grid_coordinates(region=[0, 10, 0, 20, 0, 30], shape=(10, 11, 12))
should produce three 3D arrays.BaseGridder.grid
to set theDataset
coords
attribute dynamically depending on the shape of the coordinates produced bygrid_coordinates
.The text was updated successfully, but these errors were encountered: