place_into_padded

place_into_padded(images, offsets, *, fill=np.nan, validate=True)

Place N-D arrays into a padded stack using integer offsets.

Offsets are in Python/NumPy axis order. For 2-D images, (dy, dx) means (row offset, column offset): positive dy places an image at a larger row index, and positive dx places it at a larger column index. Raw offsets are normalized by subtracting the per-axis minimum offset, matching astro-ndslice outer-shape convention for offsets already in Python axis order.

Parameters

images : sequence of array-like, each shape (*spatial)

Input arrays. Arrays may have different shapes, but must all have the same number of dimensions. Accepted dtypes are uint8, uint16, int16, int32, float32, and float64; integer images are promoted to a floating workspace. Other dtypes, including int64 and float128, are not silently cast. Cast unsupported arrays explicitly before padding.

offsets : (array - like, shape(N, ndim))

Integer offsets in NumPy axis order. N must match the number of arrays, and ndim must match each input array.

fill : float = np.nan

Value assigned to uncovered pixels in the padded stack. The default is NaN, which makes the combine kernels ignore uncovered regions.

validate : bool = True

If True, validate image dimensionality, dtype, offset shape, and offset dtype. If False, callers must provide same-rank contiguous arrays with compatible dtypes and an integer offset array of shape (N, ndim).

Returns

padded : (ndarray, shape(N, *outer_shape))

Stack containing all arrays placed into the common padded frame.