<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _moments_central(data, center=None, order=1):
 """ Calculate the central image moments up to the specified order. Parameters data : 2D array-like The input 2D array. center : tuple of two floats or `None`, optional The ``(x, y)`` center position. If `None` it will calculated as the "center of mass" of the input ``data``. order : int, optional The maximum order of the moments to calculate. Returns ------- moments : 2D `~numpy.ndarray` The central image moments. """


    data = np.asarray(data).astype(float)

    if data.ndim != 2:
        raise ValueError('data must be a 2D array.')

    if center is None:
        from ..centroids import centroid_com
        center = centroid_com(data)

    indices = np.ogrid[[slice(0, i) for i in data.shape]]
    ypowers = (indices[0] - center[1]) ** np.arange(order + 1)
    xpowers = np.transpose(indices[1] - center[0]) ** np.arange(order + 1)

    return np.dot(np.dot(np.transpose(ypowers), data), xpowers)