Closed mattijn closed 6 years ago
After reviewing the APIs quickly, your situation would likely have limited support:
Should be possible to: Directly construct and use a Grid_U object with nodes and faces as you specified. Use the 'Grid_U.locate_faces' function to compute cell index of specified points (caveat: your faces array must have a -1 in place at any missing vertices)
I wouldn't bet on much past that. If you're using Variable, interpolation, or the IO related features of gridded
they will very likely not work at all, or the furthest you get will be object construction and direct attribute access.
Hope all that helped. -JAH
Thanks for your prompt response. I was wondering what you mean with
caveat: your faces array must have a -1 in place at any missing vertices
For the quads faces it contains 4 vertices, and for the triangles it contains 3 vertices and a -1 value as the missing vertice so all faces has in total 4 vertices?
EDIT At ugrid-convention : 2D flexible mesh, I see the following line:
The use of
_FillValue
to indicate faces with less nodes than MaxNumNodesPerFace extends to the coordinate bounds variables; this is an extension of the current convention.
That would support what you mention as the caveat, where the _FillValue
is then -1 (on the netCDF-convention page they use a _FillValue
of 999999).
Yes, that's correct.
OK, thanks again! Will report back here if we succeed in accessing the information using gridded
In our case it were -999
values. Filtering these, and we can at least visualize the flexible mesh, thats enough for now
hmm, I think gridded should tranlate those -999 values to -1 when we read the file -- if the _FillValue attribute is set, anyway.
made an issue to improve this: #23
We are using
gridded
to access the data, faces and nodes from unstructured grids.This works very well for
UGrids
with 3 vertices per face and also forUGrids
where the faces contain 4 vertices. Even for plotting (https://stackoverflow.com/a/49651967/2459096).But now we have some netCDF files where the faces contains both 3 and 4 vertices in a single
UGrid
.After reading the netCDF file, the
ds.grid.info
states that theUGrid
has4 vertices per face
.Before deeper investigation we were wondering if
gridded
(pyugrid
) provide support for netCDF files where the faces in theUGrid
contain a varying number of vertices?