asascience-open / xarray-subset-grid

Subset Xarray datasets in space
https://xarray-subset-grid.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Support face_dimension attribute #34

Closed ChrisBarker-NOAA closed 2 months ago

ChrisBarker-NOAA commented 3 months ago

turns out I was wrong - the UGRID spec does allow for either ordering of dimensions:

""" The face_dimension attribute specifies which netcdf dimension is used to indicate the index of the face in the connectivity arrays. This is needed because some applications store the data with the fastest varying index first, and some with that index last. """

So, for instance, the ADCIRC:

face_node_connectivity.dims = (num_node_per_face, num_faces)

is legal, but there should be an attribute in the mesh coord:

face_dimension= 'num_faces'

So we can add that in pre-processing, and use it in the actual code.

ChrisBarker-NOAA commented 3 months ago

NOTE: I've added a start_index branch in which we could work on this.

(not complete, failing tests now ...)