open_dataset#

rojak.core.sources.open_dataset(location, chunks, engine=NetcdfEngine.H5NETCDF, is_decoded=True, **open_kwargs)[source]#

Lazily open location as a single dataset

File-based locations are concatenated with xarray.open_mfdataset(), and zarr stores are opened with xarray.open_zarr(). Remote files are opened through fsspec as file-like objects, which only the h5netcdf engine supports.

Parameters:
  • location (FilesLocation | TemplateLocation | ZarrLocation) – Where the data lives

  • chunks (Mapping | None) – Dask chunking to use. Must not be None for file-based locations.

  • engine (NetcdfEngine) – Backend engine used to read netCDF files (ignored for zarr). Defaults to "h5netcdf".

  • is_decoded (bool) – Whether to decode coordinates and CF conventions on load. Defaults to True.

  • **open_kwargs (Any) – Additional keyword arguments passed to xarray.open_mfdataset() (file-based locations) or xarray.open_zarr() (zarr locations). These take precedence over rojak’s defaults, e.g. join="exact" to refuse files whose coordinates do not line up.

Returns:

Lazily loaded dataset

Raises:
Return type:

Dataset