Description
FVCOM is a commonly-used ocean model with an unstructured triangular mesh. The community would like to be able to use uxarray with this model output, as well as other unstructured ocean models, but this is a good one to start with.
To Reproduce
With a small change implemented in PR #384, here is the status of reading in an example FVCOM file. (Note that the date will have to be moved forward at some point as these files do not stay around forever. If needed, bump up the date in two places to today's date.)
import uxarray as ux
url = "https://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/SFBOFS/MODELS/2023/07/18/nos.sfbofs.fields.f000.20230718.t03z.nc"
uxds = ux.open_dataset(url, url, drop_variables=["siglay","siglev"])
Currently (with the PR) this returns:
RuntimeError: Could not recognize dataset format.
Full stack trace:
File ~/packages/uxarray/uxarray/core/api.py:165, in open_dataset(grid_filename_or_obj, filename_or_obj, gridspec, vertices, islatlon, isconcave, use_dual, **kwargs)
109 """Wraps xarray.open_dataset()
, given a grid topology definition with a
110 single dataset file or object with corresponding data.
111
(...)
161 >>> ux_ds = ux.open_dataset("grid_filename.g", "grid_filename_vortex.nc")
162 """
164 ## Grid definition
--> 165 uxgrid = open_grid(grid_filename_or_obj,
166 gridspec=gridspec,
167 vertices=vertices,
168 islatlon=islatlon,
169 isconcave=isconcave,
170 use_dual=use_dual,
171 **kwargs)
173 ## UxDataset
174 ds = xr.open_dataset(filename_or_obj, decode_times=False,
175 **kwargs) # type: ignore
File ~/packages/uxarray/uxarray/core/api.py:90, in open_grid(grid_filename_or_obj, gridspec, vertices, islatlon, isconcave, use_dual, **kwargs)
85 else:
86 grid_ds = xr.open_dataset(grid_filename_or_obj,
87 decode_times=False,
88 **kwargs) # type: ignore
---> 90 uxgrid = Grid(grid_ds,
91 gridspec=gridspec,
92 vertices=vertices,
93 islatlon=islatlon,
94 isconcave=isconcave,
95 source_grid=str(grid_filename_or_obj),
96 use_dual=use_dual)
98 return uxgrid
File ~/packages/uxarray/uxarray/core/grid.py:100, in Grid.init(self, input_obj, **kwargs)
97 # check if initializing from string
98 # TODO: re-add gridspec initialization when implemented
99 elif isinstance(input_obj, xr.Dataset):
--> 100 self.mesh_type = parse_grid_type(input_obj)
101 self.from_ds(dataset=input_obj)
102 else:
File ~/packages/uxarray/uxarray/utils/helpers.py:48, in parse_grid_type(dataset)
46 mesh_type = "mpas"
47 else:
---> 48 raise RuntimeError(f"Could not recognize dataset format.")
49 return mesh_type
51 # check mesh topology and dimension
RuntimeError: Could not recognize dataset format.
Expected behavior
Not sure yet since I haven't used uxarray
successfully, but presumably read in the model output file without error and then be able to do some stuff with it.
OS:
Mac
Environment
Metadata
Metadata
Labels
Type
Projects
Status