uxarray.open_dataset#
- uxarray.open_dataset(grid_filename_or_obj, filename_or_obj, gridspec=None, vertices=None, islatlon=False, isconcave=False, use_dual=False, **kwargs)#
Wraps
xarray.open_dataset()
, given a grid topology definition with a single dataset file or object with corresponding data.- Parameters:
grid_filename_or_obj (string, required) – String or Path object as a path to a netCDF file or an OpenDAP URL that stores the unstructured grid definition that the dataset belongs to. It is read similar to
filename_or_obj
inxarray.open_dataset
.filename_or_obj (string, required) – String or Path object as a path to a netCDF file or an OpenDAP URL that stores the actual data set. It is the same
filename_or_obj
inxarray.open_dataset
.islatlon (bool, optional) – Specify if the grid is lat/lon based
isconcave (bool, optional) – Specify if this grid has concave elements (internal checks for this are possible)
gridspec (str, optional) – Specifies gridspec
vertices (bool, optional) – Whether to create grid from vertices
source_grid (str, optional) – Path or URL to the source grid file. For diagnostic/reporting purposes only.
use_dual (bool, optional) – Specify whether to use the primal (use_dual=False) or dual (use_dual=True) mesh if the file type is mpas
**kwargs (Dict[str, Any]) – Additional arguments passed on to
xarray.open_dataset
. Refer to the [xarray docs](https://xarray.pydata.org/en/stable/generated/xarray.open_dataset.html) for accepted keyword arguments.
- Returns:
uxds – Dataset with linked uxgrid property of type Grid.
- Return type:
Examples
Open dataset with a grid topology file
>>> import uxarray as ux >>> ux_ds = ux.open_dataset("grid_filename.g", "grid_filename_vortex.nc")