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
Bounds can be stored in different ways, and it would be great to have methods to convert between each of them.
Here's the ones I'm familiar with:
bounds variables: additional bounds dimension for upper / lower bounds
vertex variables: store the breaks in a n + 1 array (needs a new dimension)
IntervalIndex: dedicated pandas object for intervals (might need some more integration)
The advantage of IntervalIndex is that it has the same dimensions and size as the cell center coordinate and thus can be attached to DataArray objects.
For spatial, there's a few more, but since they combine 2 coordinates they require stacking the spatial coordinates or need to be broadcast to 2D coordinates. For example:
array of bounding boxes: left, bottom, right, top for each grid cell
array of bounding coordinates: list of coordinates of arbitrary length for each grid cell (not a good fit for xarray's data model, but the limited awkward objects might work?)
array of shapely polygons: one polygon of arbitrary length for each grid cell
cf_xarray already has conversion functions between bounds and vertices, so as far as I can tell conversion to and from IntervalIndex seem to be in scope. For the grid cell representation conversions I'm not sure, maybe put them into xvec?
The text was updated successfully, but these errors were encountered:
Bounds can be stored in different ways, and it would be great to have methods to convert between each of them.
Here's the ones I'm familiar with:
n + 1
array (needs a new dimension)IntervalIndex
: dedicated pandas object for intervals (might need some more integration)The advantage of
IntervalIndex
is that it has the same dimensions and size as the cell center coordinate and thus can be attached toDataArray
objects.For spatial, there's a few more, but since they combine 2 coordinates they require stacking the spatial coordinates or need to be broadcast to 2D coordinates. For example:
left, bottom, right, top
for each grid cellxarray
's data model, but the limitedawkward
objects might work?)shapely
polygons: one polygon of arbitrary length for each grid cellcf_xarray
already has conversion functions betweenbounds
andvertices
, so as far as I can tell conversion to and fromIntervalIndex
seem to be in scope. For the grid cell representation conversions I'm not sure, maybe put them intoxvec
?The text was updated successfully, but these errors were encountered: