def is_triangular(self, var):
"""
Test if a variable is on a triangular grid
This method first checks the `grid_type` attribute of the variable (if
existent) whether it is equal to ``"unstructered"``, then it checks
whether the bounds are not two-dimensional.
Parameters
----------
var: xarray.Variable or xarray.DataArray
The variable to check
Returns
-------
bool
True, if the grid is triangular, else False"""
return str(var.attrs.get('grid_type')) == 'unstructured' or \
self._check_triangular_bounds(var)[0]
评论列表
文章目录