def METHOD_NAME(cube, order, axis):
    """
    Compute the moments by working with the entire data at once
    """
    pix_cen = cube._pix_cen()[axis]
    data = cube._get_filled_data() * cube._pix_size_slice(axis)
    if order == 0:
        return allbadtonan(np.nansum)(data, axis=axis)
    if order == 1:
        return (np.nansum(data * pix_cen, axis=axis) /
                np.nansum(data, axis=axis))
    else:
        mom1 = METHOD_NAME(cube, 1, axis)
        # insert an axis so it broadcasts properly
        shp = list(_moment_shp(cube, axis))
        shp.insert(axis, 1)
        mom1 = mom1.reshape(shp)
        return (np.nansum(data * (pix_cen - mom1) ** order, axis=axis) /
                np.nansum(data, axis=axis))