Clusters and Cloud Products

class ceda_datapoint.core.cloud.DataPointCloudProduct(asset_stac: dict, id: str = None, cloudf: str = None, order: int = None, mode: str = 'xarray', meta: dict = None, stac_attrs: dict = None, properties: dict = None, mapper: DataPointMapper = None, data_selection: dict = None)[source]

Object for storing and manipulating a single cloud product i.e Kerchunk/Zarr/CFA.

property cloud_format: str

Read-only property

classmethod help() → None[source]

Display public methods for this object.

info() → None[source]

Display information about this object

open_asset(local_only: bool = False, prepare_data: bool = True, **kwargs) → Any[source]

Override for basic asset get function.

Parameters:
  • local_only – (bool) Switch to using local-only files - DataPoint will convert all hrefs and internal Kerchunk links to use local paths. Note that local_only is only available for the ‘xarray’ mode.

  • prepare_data – (bool) Apply dataset selections after opening.

open_dataset(mode: str = 'xarray', local_only: bool = False, prepare_data: bool = True, **kwargs) → Dataset | None[source]

Open the dataset for this product.

Specific methods to open cloud formats are private since the method should be determined by internal values not user input.

Parameters:
  • mode – (str) Library to use for opening datasets. Can be either ‘xarray’, returning a xr.Dataset object, or ‘cf’, returning a cf.FieldList object.

  • local_only – (bool) Switch to using local-only files - DataPoint will convert all hrefs and internal Kerchunk links to use local paths. Note that local_only is only available for the ‘xarray’ mode.

  • prepare_data – (bool) Apply dataset selections after opening.

open_dataset_with_xr(local_only: bool = False, prepare_data: bool = True, **kwargs) → Dataset[source]

Open the dataset for this product with xarray.

Returns a xr.Dataset object representing the dataset.

Parameters:
  • local_only – (bool) Switch to using local-only files - DataPoint will convert all hrefs and internal Kerchunk links to use local paths.

  • prepare_data – (bool) Apply dataset selections after opening.

open_dataset_with_cf(local_only: bool = False, prepare_data: bool = True, **kwargs) → None[source]

Open the dataset for this product with cf-python.

Returns a cf.FieldList object of one or more cf.Field objects representing the dataset.

Parameters:
  • local_only – (bool) Switch to using local-only files - DataPoint will convert all hrefs and internal Kerchunk links to use local paths.

  • prepare_data – (bool) Apply dataset selections (‘subspaces’ in ‘cf-python’ terminology) after opening.

class ceda_datapoint.core.cloud.DataPointCluster(products: list, parent_id: str = None, meta: dict = None, local_only: bool = False, data_selection: dict | None = None, show_unreachable: bool = False)[source]

A set of non-combined datasets opened using the DataPointSearch to_dataset() method. Has some additional properties over a list of datasets.

property products: list[DataPointCloudProduct]

List of products contained within this cluster

classmethod help() → None[source]

Helper function - lists methods that can be utilised for this class

info() → None[source]

Information about this object instance.

open_dataset(id: str, mode: str = 'xarray', local_only: bool = False, **kwargs) → Dataset[source]

Open a dataset from within this cluster’s cloud products. A dataset can be indexed either by id or position within this cluster’s set of datasets.

Parameters:
  • id – (str) The ID or index of the dataset in the resulting cluster.

  • mode – (str) Library to use for opening datasets. Can be either ‘xarray’, returning a xr.Dataset object, or ‘cf’, returning a cf.FieldList object.

  • local_only – (bool) Switch to using local-only files - DataPoint will convert all hrefs and internal Kerchunk links to use local paths. Note that local_only is only available for the ‘xarray’ mode.