get_xarray_groups

typhon.utils.get_xarray_groups(dataset, only_names=False)[source]

Get pseudo groups from xarray dataset object (only direct under root)

xarray.Dataset objects does not allow the use of groups, but you can emulate them by using / in the variable’s name.

Parameters:
  • dataset – A xarray.Dataset object

  • only_names – Return only the names of the groups.

Returns:

A set of group names if only_names is True. Otherwise, a dictionary with the group names and all its variables as xarray.Datasets objects.