Get slices for the overlapping part of a small and a large array.
Given a certain position of the center of the small array, with respect to the large array, tuples of slices are returned which can be used to extract, add or subtract the small array at the given position. This function takes care of the correct behavior at the boundaries, where the small array is cut of appropriately. Integer positions are at the pixel centers.
Parameters: | large_array_shape : tuple or int
small_array_shape : tuple or int
position : tuple of numbers or number
mode : {‘partial’, ‘trim’, ‘strict’}, optional
|
---|---|
Returns: | slices_large : tuple of slices
slices_small : slice
|