cdm_reader_mapper.cdm_mapper.tables package

Common Data Model (CDM) mapping tables.

Subpackages

Submodules

cdm_reader_mapper.cdm_mapper.tables.tables module

Climate Model Data (CDM) mapping table routinies.

Created on Thu Apr 11 13:45:38 2019

Module to handle C3S Climate Data Store Common Data Model (CMD) tables within the cdm tool.

@author: iregon

cdm_reader_mapper.cdm_mapper.tables.tables.get_cdm_atts(cdm_tables=None)[source]

Get CDM attribute tables.

Parameters:

cdm_tables (str or list of str, optional) – List of CDM tables to retrieve. - If None, includes all tables defined in properties.cdm_tables. - If a string, treated as a single table name. - If an empty list, returns an empty mapping.

Return type:

dict[Any, dict[Any, Any]]

Returns:

dict – Dictionary mapping table names to their attribute dictionaries. Keys are table names like header or observations-*. Values are dictionaries loaded from JSON files.

cdm_reader_mapper.cdm_mapper.tables.tables.get_imodel_maps(data_model, *sub_models, cdm_tables=None)[source]

Retrieve CDM attribute maps for a data model and optional submodels.

Parameters:
  • data_model (str) – The main data model name, e.g., icoads.

  • *sub_models (str) – Optional submodel names, e.g. r300, d721.

  • cdm_tables (str or list of str, optional) – List of CDM tables to retrieve. - If None, includes all tables defined in properties.cdm_tables. - If a string, treated as a single table name. - If an empty list, returns an empty mapping.

Return type:

dict[str, dict[str, Any]]

Returns:

dict – Mapping of table names to their attribute dictionaries. Each table dictionary may have its elements normalized to lists, and tuples of (section, element) if sections exist.