padArray#

lsst.ts.wep.utils.padArray(inArray, dim)#

Extend the boundary of image.

For example, the input image is 120x120 matrix. This function will create an image such as 140x140 (dim x dim) matrix and put the input image in the center of new image.

Parameters:
  • inArray (numpy.ndarray) – Input central image.

  • dim (int) – Dimension of new extended image.

Returns:

Extended image from the dimension of inArray to dim x dim.

Return type:

numpy.ndarray

Raises:
  • Exception – Check the dimension of inArray is n by n or not.

  • Exception – Check the extending dimension is bigger than the dimension of inArray or not.