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:
inArraynumpy.ndarray

Input image.

dimint

Dimension of extracted image.

Returns:
numpy.ndarray

Extracted central image from the dimension of inArray to dim x dim.

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.