uxarray.open_dataset#

uxarray.open_dataset(grid_filename_or_obj, filename_or_obj, gridspec=None, vertices=None, islatlon=False, isconcave=False, use_dual=False, grid_kwargs={}, **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 in xarray.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 in xarray.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

  • 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

uxarray.UxDataset

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: