dctools.dcio.loader.FileLoader
- class dctools.dcio.loader.FileLoader
- __init__()
Methods
__init__()load_dataset(file_path[, adaptive_chunking, ...])Load a dataset with Dask-safe configurations.
open_dataset_auto(path, manager[, groups, ...])Open a dataset automatically, handling both NetCDF and Zarr formats.
- static load_dataset(file_path, adaptive_chunking=False, groups=None, engine='netcdf4', variables=None, dask_safe=True)
Load a dataset with Dask-safe configurations.
- Parameters:
file_path (str) – Path to the file.
adaptive_chunking (bool) – Whether to use adaptive chunking.
groups (Optional[list[str]]) – NetCDF groups to load.
engine (Optional[str]) – Engine to use.
variables (Optional[list[str]]) – Variables to keep.
dask_safe (bool) – Whether to use Dask-safe configurations.
- Returns:
Loaded dataset or None if error.
- Return type:
xr.Dataset | None
- static open_dataset_auto(path, manager, groups=None, engine='netcdf4', dask_safe=True)
Open a dataset automatically, handling both NetCDF and Zarr formats. Optimized for Dask worker compatibility.
- Parameters:
path (str) – Path to the dataset (local or remote).
manager (Any) – Connection manager providing the filesystem.
groups (Optional[list[str]]) – NetCDF groups to open.
engine (Optional[str]) – Engine to use for opening files.
dask_safe (bool) – Whether to use Dask-safe configurations.
- Returns:
Opened dataset.
- Return type:
xr.Dataset