open_dataset#
- rojak.core.sources.open_dataset(location, chunks, engine=NetcdfEngine.H5NETCDF, is_decoded=True, **open_kwargs)[source]#
Lazily open
locationas a single datasetFile-based locations are concatenated with
xarray.open_mfdataset(), and zarr stores are opened withxarray.open_zarr(). Remote files are opened through fsspec as file-like objects, which only theh5netcdfengine supports.- Parameters:
location (FilesLocation | TemplateLocation | ZarrLocation) – Where the data lives
chunks (Mapping | None) – Dask chunking to use. Must not be
Nonefor 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) orxarray.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:
ValueError – If
chunksisNonefor a file-based location, or a remote location is opened with an engine other thanh5netcdf
- Return type: