Adaptive Optics Wavefront Reconstruction
Scott W. Teare

July 31, 2000



1.0 Introduction

    In astronomical adaptive optics, wavefront reconstruction is about restoring a distorted (potatochip-like) wavefront of light to its original form as a planar (pancake-like) wavefront. The original wavefront of light is the radiation from a "point-like" source such as a star or a laser beacon, and the distortion is induced by this wavefront passing through the varying refractive layers of the earth's atmosphere. Using the UnISIS adaptive optics system at Mount Wilson Observatory as an example of a typical adaptive optics system, the incoming wavefront is sampled using a Shack-Hartmann wavefront sensor (SHWFS) which measures the shape of the wavefront and the reconstruction is performed using a deformable mirror (DM) that can have its surface figure adjusted to match the shape of the wavefront.

    The wavefront reconstruction is done in a collimated beam of light from the telescope, at a position in the beam where the DM is conjugate to the telescope primary mirror (PM). In simple terms, this means that if all of the optics between the DM and the PM were considered as a single lens, a speck of dust on the PM would be reimaged (ie in focus) at the DM with only a change in magnification. There is an additional caviate, that is any optical aberations in the reimaging optics would also be seen superimposed on the astmospheric distortion at the DM.

    Based on this preamble, wavefront reconstruction reduces to solving the problem how to determine the figure needed on the DM to restore the original wavefront shape based on discretely sampling the wavefront using a SHWFS. The remainder of this paper addresses the solution of this problem.

2.0 How a Shack-Hartmann Sensor "Sees" a Wavefront

    A SHWFS is used to measure the slope of an incoming wavefront. This is accomplished by placing a lens in a position to sample a small region of the wavefront and focusing the light onto a sensor. A typical sensor for this purpose is a quadcell defined by a 2x2 pixel array of a CCD camera. When the wavefront arrives normal to the lens the light is focused on the center of the 4 pixels. Any tip or tilt in the wavefront displaces the focused light into another region of the quadcell. The slope of the wavefront can be measured by calculating the gradients across the quadcell. Simultaneous measurements of the slopes over a whole wavefront is accomplished by placing a matix of lenses (lenslet array) in front of an array of quadcells and then recording where the light falls in these quadcells. To "keep up" with the changes that are seen the CCD has to be read out at a rate that adequately samples the changes in the distribution of light. The slopes are obtained by suitably summing and differencing the light in each pixel of the quadcell to give two orthogonal slopes.

    For a smoothly varying wavefront the slopes or gradients that are read out from the SHWFS are a measure of the wavefront local to that particular quadcell.

3.0 How a Deformable Mirror Restores a Wavefront

    A continuous face-sheet DM is thin reflective glass sheet that is bonded onto an equally spaced array of actuators. The actuators are used to pull or push against the mirror face-sheet to change its figure. The individual actuators in the lattice are used to refigure the DM to match the shape of the distorted wavefront such that it leaves the DM restored to its original flat shape.

    The DM is placed at a specific conjugate point either to the telescope mirrors or the location of the atmospheric disturbances in the air above the telescope. Both of these positions can be used optimally, by incorporating a number of DMs and SHWFSs in the adaptive optics system. In the case where the turbulence is nearer to the telescope there is a certain advantage to keeping the DM conjugate to the telescope primary. This is the precise condition we see with UnISIS.

4.0 Registration of the Deformable Mirror and the Shack-Hartmann Sensor

    The correct and accurate registration of the SHWFS and the DM actuators is the key to successful wavefront reconstruction. UnISIS uses a Fried geometry, that is the SHWFS quadcells are aligned with the pitch of the actuators of the DM such that the corners of each quadcell are aligned beneath an actuator position. As such, the slopes measured by the quadcell are directly related to the phase variation in the wavefront at each actuator position of the DM, also known as a node.

    The first quadcell in the array can be expressed as the linear equations:

SX11 = (N12 + N22 - N11-N21)      ----- (1)

SY11 = (N11 + N12 - N21-N22)      ----- (2)

where N represents a node position and SX & SY are the X and Y slopes as measured in a quadcell. A complete set of linear equations can be constructed based on this. A general equation can be written out in matrix notation as:

SA * N      ----- (3)

where S is a column vector of X and Y gradients and N is a column vector representing the nodes. For a 4x4 actuator, 3x3 quadcell case S is composed of 9 X gradients followed by the 9 Y gradients and N contains the 16 nodes. A is a 18 x 16 (row vs col) matrix representing the physical relationship between the quadcells and the nodes and has the following form:

    -1     1     0     0    -1     1     0     0     0     0     0     0     0     0     0     0
     0    -1     1     0     0    -1     1     0     0     0     0     0     0     0     0     0
     0     0    -1     1     0     0    -1     1     0     0     0     0     0     0     0     0
     0     0     0     0    -1     1     0     0    -1     1     0     0     0     0     0     0
     0     0     0     0     0    -1     1     0     0    -1     1     0     0     0     0     0
     0     0     0     0     0     0    -1     1     0     0    -1     1     0     0     0     0
     0     0     0     0     0     0     0     0    -1     1     0     0    -1     1     0     0
     0     0     0     0     0     0     0     0     0    -1     1     0     0    -1     1     0
     0     0     0     0     0     0     0     0     0     0    -1     1     0     0    -1     1
     1     1     0     0    -1    -1     0     0     0     0     0     0     0     0     0     0
     0     1     1     0     0    -1    -1     0     0     0     0     0     0     0     0     0
     0     0     1     1     0     0    -1    -1     0     0     0     0     0     0     0     0
     0     0     0     0     1     1     0     0    -1    -1     0     0     0     0     0     0
     0     0     0     0     0     1     1     0     0    -1    -1     0     0     0     0     0
     0     0     0     0     0     0     1     1     0     0    -1    -1     0     0     0     0
     0     0     0     0     0     0     0     0     1     1     0     0    -1    -1     0     0
     0     0     0     0     0     0     0     0     0     1     1     0     0    -1    -1     0
     0     0     0     0     0     0     0     0     0     0     1     1     0     0    -1    -1

    The SHWFS detects the slope information, so this A matrix must be inverted to return the node information. While this could be done directly, it would be preferable to have a representation of the nodes that is a best fit to the slope information. One of the most straightforward ways of doing this is to minimize the error across the wavefront using a least squares formalism.

    Generating this matrix for "working sized" reconstructors is a non trivial exercise. For UnISIS there are 177 actuators and 144 quadcells to be used in generating the A matrix. As a result this matrix has 177 x 288 or 50976 elements. I have developed a simple matrix formalism that makes the scaling to any arbitrary size Fried geometry matrix a simple exercise.

5.0 Least-Squares Estimation of the Wavefront from a Shack-Hartmann Wavefront Sensor

    Inversion of the A matix leads to a solution that will allow the measured slopes to be used to reconstruct the wavefront at the node points as:

N = A-1 * S      ----- (4)

however this will not be an optimal solution. As well, the  A matix is neither square nor singular so that the inversion process becomes more complex. We can incorporate the formalism for a least-squares fit (stated without proof) directly into the inversion process as follows:

N = [ ( AT * A )-1 * AT ] * S      ----- (5)

where AT is the transpose of the A matrix. The inversion of  AT * A  is still somewhat tricky, usually requiring that a pseudo inverse technique be used, based on the method of Singular Value Decomposition. The matrix used to estimate the nodes based on the SHWFS slopes is called the control matrix and for this example has the following appearance for the above example:

M = ( AT * A )-1 * AT=

   -0.4375   -0.1125   -0.0500    0.1125   -0.1500   -0.0125   -0.0500    0.0125   -0.0625    0.4375   -0.1125    0.0500    0.1125    0.1500    -0.0125    0.0500    0.0125    0.0625
    0.1833   -0.2542   -0.0625   -0.1208    0.0500   -0.0792    0.0625   -0.0458    0.0167    0.1833    0.2542   -0.0625    0.1208    0.0500     0.0792    0.0625    0.0458    0.0167
    0.0625    0.2542   -0.1833    0.0792   -0.0500    0.1208   -0.0167    0.0458   -0.0625   -0.0625    0.2542    0.1833    0.0792    0.0500     0.1208    0.0167    0.0458    0.0625
    0.0500    0.1125    0.4375    0.0125    0.1500   -0.1125    0.0625   -0.0125    0.0500    0.0500   -0.1125    0.4375   -0.0125    0.1500     0.1125    0.0625    0.0125    0.0500
   -0.1833   -0.1208   -0.0625   -0.2542   -0.0500   -0.0458    0.0625   -0.0792   -0.0167   -0.1833    0.1208   -0.0625    0.2542   -0.0500     0.0458    0.0625    0.0792   -0.0167
    0.0625   -0.1125   -0.0500    0.1125   -0.1500   -0.0125   -0.0500    0.0125   -0.0625   -0.0625   -0.1125    0.0500    0.1125    0.1500    -0.0125    0.0500    0.0125    0.0625
    0.0500    0.1125   -0.0625    0.0125    0.1500   -0.1125    0.0625   -0.0125    0.0500    0.0500   -0.1125   -0.0625   -0.0125    0.1500     0.1125    0.0625    0.0125    0.0500
    0.0625    0.1208    0.1833    0.0458    0.0500    0.2542    0.0167    0.0792   -0.0625   -0.0625    0.1208   -0.1833    0.0458   -0.0500     0.2542   -0.0167    0.0792    0.0625
    0.0625   -0.0792   -0.0167   -0.2542   -0.0500   -0.0458   -0.1833   -0.1208   -0.0625   -0.0625   -0.0792    0.0167   -0.2542    0.0500    -0.0458    0.1833   -0.1208    0.0625
   -0.0500    0.0125   -0.0625    0.1125   -0.1500   -0.0125    0.0625   -0.1125   -0.0500   -0.0500   -0.0125   -0.0625   -0.1125   -0.1500     0.0125    0.0625    0.1125   -0.0500
    0.0625   -0.0125    0.0500    0.0125    0.1500   -0.1125    0.0500    0.1125   -0.0625   -0.0625   -0.0125   -0.0500    0.0125   -0.1500    -0.1125   -0.0500    0.1125    0.0625
    0.0167    0.0792   -0.0625    0.0458    0.0500    0.2542    0.0625    0.1208    0.1833    0.0167   -0.0792   -0.0625   -0.0458    0.0500    -0.2542    0.0625   -0.1208    0.1833
   -0.0500    0.0125   -0.0625    0.1125   -0.1500   -0.0125   -0.4375   -0.1125   -0.0500   -0.0500   -0.0125   -0.0625   -0.1125   -0.1500     0.0125   -0.4375    0.1125   -0.0500
    0.0625   -0.0458    0.0167   -0.1208    0.0500   -0.0792    0.1833   -0.2542   -0.0625   -0.0625   -0.0458   -0.0167   -0.1208   -0.0500    -0.0792   -0.1833   -0.2542    0.0625
   -0.0167    0.0458   -0.0625    0.0792   -0.0500    0.1208    0.0625    0.2542   -0.1833   -0.0167   -0.0458   -0.0625   -0.0792   -0.0500    -0.1208    0.0625   -0.2542   -0.1833
    0.0625   -0.0125    0.0500    0.0125    0.1500   -0.1125    0.0500    0.1125    0.4375   -0.0625   -0.0125   -0.0500    0.0125   -0.1500    -0.1125   -0.0500    0.1125   -0.4375

    This control matrix allows the gradients measured by the quadcells of the SHWFS to be used to estimate the phase relationship at the nodes of the incoming wavefront. The application of equation 5 is a very straight forward matrix multiplication. In the case of our example this would require some 288 floating point operations (FLOPS). In the case of UnISIS this becomes 50,976 floating point operations per reconstruction and there needs to be 333 reconstructions per second (16 975 008 FLOPS). Matters become more complex in that there are other operations that need to be done, such as reading out the camera etc that require a certain amount of dedicated time, requiring an effective calculation rate 5 times higher or  84,875,040 FLOPS of computing power. This is most readily accomplished using a parallel supercomputer so that the control matrix and the gradients can be distributed over a number of parallel processors to perform the wavefront reconstruction within the time requirements. UnISIS uses a parallel supercomputer composed of 8 DSP processors wired in parallel to perform the wavefront reconstruction tasks making it possible to complete the calculations within the allowed time interval.

6.0 Next Steps in Reconstruction

    The reconstructor described above is based on simple physical arguments of where the nodes and the gradients are positioned relative to each other. However, additional corrections for the influence function and non-illuminated regions of the SHWFS can be incorporated to improve the match between the theory and the real world operation. Developing such a correction matrix is one of the next steps in improving the reconstructor performance.



Created: July 31, 2000
Modified: July 31, 2000