xoa.cf.CFSpecs.get_dims¶
- CFSpecs.get_dims(da, dim_types, allow_positional=False, positions='tzyx', errors='warn')[source]¶
Get the data array dimensions names from their type
- Parameters
da (xarray.DataArray) – Array to scan
dim_types (str, list) – Letters among “x”, “y”, “z”, “t” and “f”.
allow_positional (bool) – Fall back to positional dimension of types is unkown.
positions (str) – Default expected position of dim per type in da starting from the end.
errors ({'ignore', 'warn', 'raise'}) –
In case of errors
ignore: silently ignorewarn: emit a warningraise: raise an exception
- Returns
tuple – Tuple of dimension names or None when the dimension is not found
See also