extractArray#

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

Extract the central image.

For example, the input image is a 140x140 matrix. This function will extract the central matrix with the dimension of 120x120 (dim x dim).

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

  • dim (int) – Dimension of extracted image.

Returns:

Extracted central 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 extracted dimension is smaller than the dimension of inArray or not.