xarray.open_groups (original) (raw)

xarray.open_groups(filename_or_obj, *, engine=None, chunks=None, cache=None, decode_cf=None, mask_and_scale=None, decode_times=None, decode_timedelta=None, use_cftime=None, concat_characters=None, decode_coords=None, drop_variables=None, inline_array=False, chunked_array_type=None, from_array_kwargs=None, backend_kwargs=None, **kwargs)[source]#

Open and decode a file or file-like object, creating a dictionary containing one xarray Dataset for each group in the file.

Useful for an HDF file (“netcdf4” or “h5netcdf”) containing many groups that are not alignable with their parents and cannot be opened directly with open_datatree. It is encouraged to use this function to inspect your data, then make the necessary changes to make the structure coercible to a DataTree object before calling DataTree.from_dict() and proceeding with your analysis.

Parameters:

Returns:

groups (dict of str to xarray.Dataset) – The groups as Dataset objects

Notes

open_groups opens the file with read-only access. When you modify values of a Dataset, even one linked to files on disk, only the in-memory copy you are manipulating in xarray is modified: the original file on disk is never touched.