Wavefront reconstruction from its gradients.
Wavefronts reconstructed from measured gradients are composed of a straightforward integration of the measured data, plus a correction term that disappears when there are no measurement errors. For regions of any shape, this term is a solution of Poisson's equation with Dirichlet conditions (V = 0 on the boundaries). We show that for rectangular regions, the correct solution is not a periodic one, but one expressed with Fourier cosine series. The correct solution has a lower variance than the periodic Fourier transform solution. Similar formulas exist for a circular region with obscuration. We present a near-optimal solution that is much faster than fast-Fourier-transform methods. By use of diagonal multigrid methods, a single iteration brings the correction term to within a standard deviation of 0.08, two iterations, to within 0.0064, etc.