earth2studio.utils.coords.split_coords#

earth2studio.utils.coords.split_coords(x, coords, dim='variable')[source]#

A utility function to split a dimension from a (x,coords) pair and convert it into a list of tensors, a CoordSystem, and the dimension that extract from coords.

Parameters:
  • x (torch.Tensor) – Input tensor

  • coords (CoordSystem) – Coordinates referring to the dimensions of x

  • dim (str) – Name of the dimension in coords to split along

Returns:

  • list[torch.Tensor] – List of tensors extracted by splitting the extracted dimension from coords.

  • CoordSystem – The updated coord system with the extracted dimension removed.

  • np.ndarray – The values of the dimension extracted from the coordinate system.

Return type:

tuple[list[Tensor], OrderedDict[str, ndarray], ndarray]

Examples using earth2studio.utils.coords.split_coords#

Generative Downscaling

Generative Downscaling