uxarray.Grid.isel

Contents

uxarray.Grid.isel#

Grid.isel(inverse_indices=False, **dim_kwargs)#

Indexes an unstructured grid along a given dimension (n_node, n_edge, or n_face) and returns a new grid.

Currently only supports inclusive selection, meaning that for cases where node or edge indices are provided, any face that contains that element is included in the resulting subset. This means that additional elements beyond those that were initially provided in the indices will be included. Support for more methods, such as exclusive and clipped indexing is in the works.

Parameters inverse_indices : Union[List[str], Set[str], bool], default=False

Indicates whether to store the original grids indices. Passing True stores the original face indices, other reverse indices can be stored by passing any or all of the following: ([“face”, “edge”, “node”], True)

**dims_kwargs: kwargs

Dimension to index, one of [‘n_node’, ‘n_edge’, ‘n_face’]

Example

>> grid = ux.open_grid(grid_path) >> grid.isel(n_face = [1,2,3,4])