ccdtools.catalog.DataCatalog.load_dataset

DataCatalog.load_dataset(dataset, version=None, subdataset=None, **kwargs)

Load any dataset by name/version/subdataset with optional directory filtering.

Parameters:
  • dataset (str) – Name of the dataset to load.

  • version (str, optional) – Version of the dataset to load. If not provided, the latest version is used. Default is None.

  • subdataset (str, optional) – Name of the subdataset to load (if applicable). Default is None.

  • **kwargs

    Additional keyword arguments to pass to the loader function. Common options include:

    • resolutionstr, optional

      Resolution to load (if supported by the dataset).

    • staticbool, optional

      Whether to load static files (if supported by the dataset).

Returns:

Loaded dataset in the appropriate format determined by the loader function.

Return type:

pandas.DataFrame, geopandas.GeoDataFrame, or xarray.Dataset

Raises:
  • KeyError – If no matching dataset entry is found.

  • TypeError – If subdataset is specified for a dataset that does not define subdatasets.

  • ValueError – If multiple entries match the criteria or if multiple subdatasets exist and none is specified.

Examples

Load the latest version of a dataset:

>>> data = catalog.load_dataset('dataset_name')

Load a specific version:

>>> data = catalog.load_dataset('dataset_name', version='v1')

Load a specific subdataset:

>>> data = catalog.load_dataset('dataset_name', version='v1', subdataset='sub1')