xoa.cf.CFCoordSpecs.get_dim_type

CFCoordSpecs.get_dim_type(dim, da=None, lower=True)[source]

Get the type of a dimension

Three cases:

  • This dimension is registered in CF dims.

  • da has dim as dim and has an axis attribute inferred with get_axis().

  • da has a coord named dim with an axis attribute inferred with get_axis().

Parameters
  • dim (str) – Dimension name

  • da (xarray.DataArray) – Data array that the dimension belongs to, to help inferring the type

  • lower (bool) – For lower case

Returns

str, None – Letter as one of x, y, z, t or f, if found, else None

See also

get_axis