You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is to document and discuss some enhancements I am looking into w.r.t. the coordinates used as inputs.
The current situation
Currently the grid node coordinates fed to wmg are a numpy array of shape [2, N_y, N_x]. This assumes that the grid nodes are on a regular grid. It is also the case that these are assumed to be cartesian coordinates, in the projection used for the LAM data.
Generalizing to non-regular gridded data
My idea to generalize this is to change so that the coordinate array xy instead has shape [N_grid_nodes, 2] with e.g. xy[:,0] containing the x-coordinate for all grid nodes. Existing mesh creation algorithms would still have to work with a rectangular area, for which they can use the axis-aligned bounding box of the grid nodes. Other, new, mesh creation methods could use the convex hull of the set of grid nodes.
Generalizing to allow lat-lon coordinates
For lat-lon coordinates the same [N_grid_nodes, 2] shape could be used for the coordinates. It would also be good to feed a projection specification (I propose a Cartopy projection instance, https://scitools.org.uk/cartopy/docs/latest/reference/generated/cartopy.crs.Projection.html). Using the projection the lat-lon coordinates can then be mapped to a euclidean space and all our current methods can be applied as is. Having the option of lat-lon coordinates however also opens up the opportunity for mesh creation methods that work directly with these.
A question is how to tell wmg if in-projection or lat-lon coordinates are given. Some options are:
Have separate arguments xy and lat_lon where only one has to be given.
Have only one argument coords, and then a separate boolean flag e.g. uses_lat_lon.
One could also enforce that a projection has to be given when using lat-lon coordinates, and use that implicitly as the uses_lat_lon flag above.
Another option is really to only allow lat-lon coordinates from here onwards.
Not really sure what is the best option of the ones above. Any input is appreciated.
The text was updated successfully, but these errors were encountered:
I also realize that the concept of grid_refinement_factor is defined in terms of the number of grid nodes in the x- and y-directions. This will not make sense for irregularly positioned grid nodes. So likely this will have to be generalized to a refinement in terms of actual distances, rather than number of nodes. Which probably makes more sense anyhow (and you can always find a mapping in-between).
This issue is to document and discuss some enhancements I am looking into w.r.t. the coordinates used as inputs.
The current situation
Currently the grid node coordinates fed to wmg are a numpy array of shape [2, N_y, N_x]. This assumes that the grid nodes are on a regular grid. It is also the case that these are assumed to be cartesian coordinates, in the projection used for the LAM data.
Generalizing to non-regular gridded data
My idea to generalize this is to change so that the coordinate array
xy
instead has shape [N_grid_nodes, 2] with e.g.xy[:,0]
containing the x-coordinate for all grid nodes. Existing mesh creation algorithms would still have to work with a rectangular area, for which they can use the axis-aligned bounding box of the grid nodes. Other, new, mesh creation methods could use the convex hull of the set of grid nodes.Generalizing to allow lat-lon coordinates
For lat-lon coordinates the same [N_grid_nodes, 2] shape could be used for the coordinates. It would also be good to feed a projection specification (I propose a Cartopy projection instance, https://scitools.org.uk/cartopy/docs/latest/reference/generated/cartopy.crs.Projection.html). Using the projection the lat-lon coordinates can then be mapped to a euclidean space and all our current methods can be applied as is. Having the option of lat-lon coordinates however also opens up the opportunity for mesh creation methods that work directly with these.
A question is how to tell wmg if in-projection or lat-lon coordinates are given. Some options are:
xy
andlat_lon
where only one has to be given.coords
, and then a separate boolean flag e.g.uses_lat_lon
.uses_lat_lon
flag above.Not really sure what is the best option of the ones above. Any input is appreciated.
The text was updated successfully, but these errors were encountered: