load_from_folder#

rojak.core.data.load_from_folder(path_to_folder, glob_pattern='*.nc', chunks=None, engine=NetcdfEngine.NETCDF4, is_decoded=True, **open_kwargs)[source]#

Lazily load and concatenate every file matching glob_pattern in a folder into a single Dataset

Thin wrapper around rojak.core.sources.open_dataset() with a FilesLocation, kept for backwards compatibility. Prefer configuring a DataLocation instead.

Parameters:
  • path_to_folder (Path) – Directory containing the data files

  • glob_pattern (str) – Glob pattern (relative to path_to_folder) matching the files to load. Defaults to "*.nc".

  • chunks (Mapping | None) – Dask chunking to use, passed to xarray.open_mfdataset(). Must not be None.

  • engine (NetcdfEngine) – Backend engine used to read the files. Defaults to "netcdf4".

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

  • **open_kwargs (Any) – Additional keyword arguments passed to xarray.open_mfdataset(), see rojak.core.sources.open_dataset()

Returns:

Dataset formed by concatenating every matching file

Raises:

ValueError – If chunks is None

Return type:

xr.Dataset