def METHOD_NAME(cube, order, axis):
    """
    Compute moments by accumulating the result 1 slice at a time
    """
    if order == 0:
        return _slice0(cube, axis)
    if order == 1:
        return _slice1(cube, axis)
    shp = _moment_shp(cube, axis)
    result = np.zeros(shp)
    view = [slice(None)] * 3
    pix_size = cube._pix_size_slice(axis)
    pix_cen = cube._pix_cen()[axis]
    weights = np.zeros(shp)
    # would be nice to get mom1 and momn in single pass over data
    # possible for mom2, not sure about general case
    mom1 = _slice1(cube, axis)
    for i in range(cube.shape[axis]):
        view[axis] = i
        plane = cube._get_filled_data(fill=0, view=tuple(view))
        result += (plane *
                   (pix_cen[tuple(view)] - mom1) ** order *
                   pix_size)
        weights += plane * pix_size
    return (result / weights)