dctools.data.datasets.dataloader.add_coords_as_dims

dctools.data.datasets.dataloader.add_coords_as_dims(ds, coords=('LATITUDE', 'LONGITUDE'))

Add given coordinates as dimensions to all data variables in the dataset.

Broadcasting them if necessary. Handles the case where coordinates exist only as per-point arrays (e.g., Argo profiles with N_POINTS).

Parameters:
  • ds (xr.Dataset) – Input dataset.

  • coords (tuple of str) – Names of the coordinates to promote to dimensions (if present in ds).

Returns:

Dataset with new dimensions.

Return type:

xr.Dataset