Skip to content

Chunk processing

linc_convert.utils.chunk_processing

Utilities for Processing Array in Chunks.

chunk_slice_generator

chunk_slice_generator(arr_shape, chunk_shape)

Generate slice indices for chunking an array based on the chunk size.

Parameters:

Name Type Description Default
arr_shape Sequence[int]
required
chunk_shape Sequence[int]
required
of
required

Yields:

Name Type Description
tuple A tuple (index, full_slice) where:
  • index is a tuple representing the multi-index of the chunk.
  • full_slice is a tuple of slice objects (prefixed by an Ellipsis to preserve any non-chunked dimensions) that can be used to index into an array of shape arr_shape.