csiro-coasts / emsarray

xarray extension that supports EMS model formats
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

UGRID convention doesn't detect coordinates #159

Open david-sh-csiro opened 2 months ago

david-sh-csiro commented 2 months ago

When loading certain netcdf files, xarray loads ugrid attributes such as node_x, edge_x and face_x as coords instead of data_vars. When this happens, the emsarray UGRID convention does not correctly detect and load them into the topology properties. I'd suggest changing how emsarray looks up the attributes, so that it looks up the attribute from dataset directly instead of from data_vars. E.g. self.dataset[name] instead of self.dataset.data_vars[name]