def _pipe_density(nufft, maxiter):
    """
    Private: create the density function in the data space by a iterative solution
    Pipe et al. 1999
    """
    try:
        if maxiter < nufft.last_iter:
            W = nufft.st['W']
        else:
            W = nufft.st['W']
            for pp in range(0, maxiter - nufft.last_iter):
                E = nufft.forward(nufft.adjoint(W))
                W = W / E
            nufft.last_iter = maxiter
    except:
        W = nufft.thr.copy_array(nufft.y)
        W.fill(0.0 + 0.0j)
        for pp in range(0, 1):
            E = nufft.forward(nufft.adjoint(W))
            W /= E
    return W
