extract_grid#
- EBSD.extract_grid(grid_shape: tuple[int, int] | int, return_indices: bool = False) EBSD | LazyEBSD | tuple[EBSD | LazyEBSD, ndarray][source]#
Return a new signal with patterns from positions in a grid of shape
grid_shapeevenly spaced in navigation space.- Parameters:
- grid_shape
Tuple of integers or just an integer signifying the number of grid indices in each dimension. If 2D, the shape is (n columns, n rows).
- return_indices
Whether to return the indices of the extracted patterns into
dataas an array of shape(2,) + grid_shape. Default isFalse.
- Returns:
newNew signal with patterns from indices in a grid corresponding to
grid_shape. Attributesxmap,static_backgroundanddetectorare deep copied.indicesIndices of the extracted patterns into
data, returned ifreturn_indices=True.
Examples
>>> import kikuchipy as kp >>> s = kp.data.nickel_ebsd_large(lazy=True) >>> s <LazyEBSD, title: patterns Scan 1, dimensions: (75, 55|60, 60)> >>> s2 = s.extract_grid((5, 4)) >>> s2 <LazyEBSD, title: patterns Scan 1, dimensions: (5, 4|60, 60)>