-
Notifications
You must be signed in to change notification settings - Fork 17
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 function to get grid units #87
Comments
As part of adding geospatial capabilities to BMI, it's suggested in #11 and #80 that BMI have a function (or functions) to do this. While this is needed for a grid with a coordinate reference system, it's generically useful, as well. The inclusion of a grid unit getter function should be addressed separately from, and before, the addition of geospatial capabilities to BMI. |
Suggested function prototypes, in SIDL, are here: #80 (comment). |
To allow for different units for each coordinate, it seems like the new functions should be look like one of the following options. Option 1int get_grid_x_units(in int grid, out string units);
int get_grid_y_units(in int grid, out string units);
int get_grid_z_units(in int grid, out string units); Pros:
Cons:
Option 2int get_grid_units(in int grid, out array<string, 1> units); Pros:
Cons:
We could also add a dim argument that refers the dimension of the requested units, int get_grid_units(in int grid, in int dim, out string units); If we go with option 2, we may want to think about adding a get_grid_node_coordinates (to replace get_grid_[xyz]) function. int get_grid_node_coordinates(in int grid, out array<double> coordinates) or int get_grid_node_coordinates(in int grid, in int dim, out array<double, 1> coordinates) |
For Option 2, requiring the dim argument could simplify the call by making the units argument a string instead of a string array: int get_grid_units(in int grid, in int dim, out string units); |
@mdpiper Yes, of course. Good catch. I've updated my previous comment (so now it looks like you're slightly crazy by just restating what I just said). |
Further, we could introduce another new function to get the names of the grid dimensions: int get_grid_dimension_names(in int grid, out array<string, 1> names); It could return ["x", "y", "z"] or ["x1", "x2", "x3"] or N names for grids with N dimensions. Then, in get_grid_units, replace the dim parameter with name: int get_grid_units(in int grid, in string name, out string units); |
Maybe we should wait for BMI 3 for this since it'll break backward compatibility. |
Would a 4th dimension (time) be needed as well, so xyzt, or is this captured automatically? |
Hey @kettner -- time is handled separately in the BMI through a set of time functions. We do need to represent grids of rank > 3, though; I'm making a separate issue for that now. |
The BMI should have a function (or functions) to get the units of a grid.
The text was updated successfully, but these errors were encountered: