XarrayLoader#
- class XarrayLoader(params=None, **kwargs)#
Bases:
LoaderAbstract[str|PathLike,Dataset]Load from single source with Xarray.
Uses
xarray.open_dataset()orxarray.open_mfdataset()to open data.- Parameters:
params (t.Any | None)
- OPEN_DATASET_KWARGS: dict[str, t.Any] = {}#
Options passed to
xarray.open_dataset().Dataset.get_data()kwargs take precedence.
- OPEN_MFDATASET_KWARGS: dict[str, t.Any] = {}#
Options passed to
xarray.open_mfdataset().Dataset.get_data()kwargs take precedence.
- load_data_concrete(source, **kwargs)#
Read a dataset object.
- Parameters:
source (str | PathLike | Sequence[str | PathLike]) – Sequence of files containing data.
kwargs – Arguments passed to
xarray.open_dataset(). They will take precedence over the default values of the class attributeOPEN_DATASET_KWARGSandOPEN_MFDATASET_KWARGS.
- Return type:
- preprocess()#
Return a function to preprocess data.
If
preprocessinOPEN_MFDATASET_KWARGSis True, the function will be used for open_mfdataset corresponding argument. The function should take in and return a dataset.