uxarray.open_dataset#
- uxarray.open_dataset(grid_filename_or_obj, filename_or_obj, latlon=False, use_dual=False, grid_kwargs={}, **kwargs)#
Wraps
xarray.open_dataset()
and creates auxarray.UxDataset
object, 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
.latlon (bool, optional) – Specify if the grid is lat/lon based
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
grid_kwargs (Dict[str, Any], optional) – Additional arguments passed on to
xarray.open_dataset
when opening up a Grid File. Refer to the [xarray docs](https://xarray.pydata.org/en/stable/generated/xarray.open_dataset.html) for accepted keyword arguments.**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") :param grid_kwargs: