def frame_center(array, verbose=False):
    """
    Return the coordinates y,x of the frame(s) center.

    Parameters
    ----------
    array : 2d/3d/4d array_like
        Frame or cube.
    verbose : bool optional
        If True the center coordinates are printed out.

    Returns
    -------
    cy, cx : float
        Coordinates of the center.

    """
    if array.ndim == 2:
        shape = array.shape
    elif array.ndim == 3:
        shape = array[0].shape
    elif array.ndim == 4:
        shape = array[0, 0].shape
    else:
        raise ValueError('`array` is not a 2d, 3d or 4d array')

    cy = shape[0] / 2 - 0.5
    cx = shape[1] / 2 - 0.5

    if verbose:
        print('Center px coordinates at x,y = ({}, {})'.format(cx, cy))
    return cy, cx