imas.backends.netcdf.nc_metadata.NCMetadata

class imas.backends.netcdf.nc_metadata.NCMetadata(ids_metadata: IDSMetadata)

Bases: object

NCMetadata contains additional netCDF metadata for an IDS data structure.

When constructing an NCMetadata, the complete IDS structure is scanned and all DD coordinate information is parsed. This information is used to construct netCDF dimension information for all quantities in the IDS.

Coordinate parsing is done in three phases:

  1. Traverse the full metadata tree and parse coordinate information for all quantities. See _parse() and _parse_dimensions().

  2. Resolve shared dimensions. See _resolve_pending().

  3. Tensorize all quantities. See _tensorize_dimensions().

__init__(ids_metadata: IDSMetadata)

Methods

__init__(ids_metadata)

get_coordinates(path, homogeneous_time)

Get the coordinates (adhering to CF conventions) for a netCDF variable.

get_dimensions(path, homogeneous_time)

Get the dimensions for a netCDF variable.

Attributes

ids_metadata

Metadata of the IDS toplevel that this NC metadata is for.

time_dimensions

Set of all (inhomogeneous) time dimensions.

dimensions

Mapping of paths to dimension names.

coordinates

Mapping of paths to coordinate variable names.

aos

Mapping of paths to their nearest AoS parent.

paths

List of all paths.

time_coordinates

All coordinate variable names representing (inhomogeneous) time.

aos : Dict[str, str]

Mapping of paths to their nearest AoS parent.

coordinates : Dict[str, List[str]]

Mapping of paths to coordinate variable names.

dimensions : Dict[str, List[str]]

Mapping of paths to dimension names.

get_coordinates(path: str, homogeneous_time: bool) tuple[str]

Get the coordinates (adhering to CF conventions) for a netCDF variable.

Parameters:
path: str

Data Dictionary path to the variable, e.g. ids_properties/comment.

homogeneous_time: bool

Use homogeneous time coordinates. When True, ids_properties.homogeneous_time should be set to 1.

get_dimensions(path: str, homogeneous_time: bool) tuple[str]

Get the dimensions for a netCDF variable.

Parameters:
path: str

Data Dictionary path to the variable, e.g. ids_properties/comment.

homogeneous_time: bool

Use homogeneous time coordinates. When True, ids_properties.homogeneous_time should be set to 1.

ids_metadata

Metadata of the IDS toplevel that this NC metadata is for.

paths : List[str]

List of all paths.

time_coordinates : Set[str]

All coordinate variable names representing (inhomogeneous) time.

time_dimensions : Set[str]

Set of all (inhomogeneous) time dimensions.


Last update: 2026-01-28