eoio.readers.metadata module#
eoio.readers.metadata#
Metadata extraction utilities that are common across multiple datasets.
Classes#
|
Base class for extracting metadata from xarray datasets. |
- class eoio.readers.metadata.BaseMetadataExtractor(reader: BaseReader)[source]#
Bases:
ABCBase class for extracting metadata from xarray datasets.
- attach_metadata(ds: Dataset, level: None | str = None) Dataset[source]#
Attach metadata to a dataset and return a new dataset.
- Parameters:
ds – Dataset to which metadata should be attached.
level – Metadata level to attach (‘all’, ‘basic’, etc.).
- Returns:
Dataset with metadata attached.
- property basic_metadata: dict[str, Any]#
- clear_metadata(ds: Dataset) Dataset[source]#
Remove metadata (i.e. all attributes) from product and variables in place in dataset.
- Parameters:
ds – Dataset from which to remove metadata (attrs).
- Returns:
Dataset with attrs cleared.
- extract_metadata(level: None | str = None, meas_list: List[str] | None = None) tuple[dict, dict, dict, dict][source]#
Return basic, product, and variable metadata for the dataset.
- Parameters:
level – Metadata level (‘all’, ‘basic’, etc.).
meas_list – Optional list of measurement variables used to filter product-level spatial metadata.
- Returns:
Tuple of (basic_dataset_metadata, product_dataset_metadata, variable_basic_metadata, variable_metadata).
- abstractmethod get_basic_metadata() dict[source]#
Extract basic metadata from the dataset, to be used in other tools in MetEOR.
- Returns:
Basic metadata dictionary.
- get_product_metadata() dict[source]#
Extract product metadata from the dataset.
- Returns:
Product metadata dictionary.
- abstractmethod get_variable_basic_metadata(var: str) dict[source]#
Extract basic variable metadata from the dataset.
- Parameters:
var – Variable name for which metadata should be extracted.
- Returns:
Variable metadata dictionary.
- get_variable_product_metadata(var: str) dict[source]#
Extract variable metadata from the dataset.
- Parameters:
var – Variable name for which metadata should be extracted.
- Returns:
Variable metadata dictionary.
- property product_metadata: dict[str, Any]#