def decimateStrip(imArr):
    """Break an image consisting of a row of square postage stamps into
    individual postage stamp images.

    Inputs:
    - imArr: an image array of shape [imageShape * numIm, imageShape], where numIm is an integer

    Returns:
    - stampImageList: a list of numIm image arrays, each imageShape x imageShape

    Note: the axes of imArr are (y, x) relative to ds9 display of the image.

    Raise ValueError if imArr shape is not [imageShape * numIm, imageShape],
    where numIm is an integer
    """
    stampShape = imArr.shape
    stampSize = imArr.shape[1]
    if stampSize == 0:
        return []
    numIm = stampShape[0] // stampSize
    if stampSize * numIm != stampShape[0]:
        raise ValueError(
            "image shape %s is not a column of an even number of squares"
            % (stampShape,)
        )
    stampImageList = [
        imArr[(ind * stampSize) : ((ind + 1) * stampSize), :] for ind in range(numIm)
    ]
    return stampImageList