esmvalcore.io.protocol#
Protocols for accessing data.
This module defines the DataSource and DataElement protocols
for finding and loading data. A data source can be used to find data elements
matching specific facets. A data element represents some data that can be
loaded as Iris cubes.
To add support for a new data source, write two classes that implement these
protocols and configure the tool to use the newly implemented data source as
described in esmvalcore.io.
Classes:
|
A data element represents some data that can be loaded. |
|
A data source can be used to find data. |
- class esmvalcore.io.protocol.DataElement(*args, **kwargs)[source]#
Bases:
ProtocolA data element represents some data that can be loaded.
An
esmvalcore.io.local.LocalFileis an example of a data element.Attributes:
Attributes are key-value pairs describing the data.
Facets are key-value pairs that can be used for searching the data.
A unique name identifying the data.
Methods:
- to_iris() iris.cube.CubeList[source]#
Load the data as Iris cubes.
- Returns:
The loaded data.
- Return type:
- class esmvalcore.io.protocol.DataSource(*args, **kwargs)[source]#
Bases:
ProtocolA data source can be used to find data.
Attributes:
A string containing debug information when no data is found.
A name identifying the data source.
The priority of the data source.
The project that the data source provides data for.
Methods:
find_data(**facets)Find data.
- find_data(**facets: FacetValue) Iterable[DataElement][source]#
Find data.
- Parameters:
**facets (FacetValue) – Find data matching these facets.
- Returns:
The data elements that have been found.
- Return type:
typing.Iterableofesmvalcore.io.base.DataElement