dctools.data.coordinates.detect_variables_in_dataset

dctools.data.coordinates.detect_variables_in_dataset(ds)

Detect all known oceanographic variables in an xarray Dataset.

Uses three complementary strategies, applied in order of priority:

  1. Match the variable’s standard_name attribute against CF standard names listed in VARIABLES_ALIASES.

  2. Match the variable name against known aliases in VARIABLES_ALIASES.

  3. Match the variable name against the generic key names themselves.

Only the first variable found per generic key is kept.

Parameters:

ds (xr.Dataset) – Input dataset.

Returns:

Mapping generic variable key -> actual variable name in the dataset.

Return type:

dict