*Appl. Opt*.

**41**(26), 5497–5502 (2002)]. The paper also presents an implementation of this algorithm using graphical processing units as specialized hardware. This compute unified device architecture implementation achieves real-time results inside the stability time of the atmosphere for resolutions of up to

**1024**×

**1024**pixels.

## 1.

## Introduction

The alignment (of the order of nanometers) between the hexagonal segments of a giant mirror has a critical effect on the quality of the image, therefore, the alignment system and commissioning phase, called the “cophasing system,” is essential for the optimal performance of the telescope. Thus, the development of new techniques for cophasing that are robust, instrumentally simple, and applicable to a large number of segments (in the thousands for a giant telescope) is extremely important.

For cophasing the segments, the Shack-Hartmann sensor is commonly used in which the microlenses or prisms must be aligned very accurately over the edges of the segments. In the extremely larges telescopes (ELTs), the number of microlenses and edges grows enormously and the difficulty of precise alignment requires the search for simpler solutions. To this end, the curvature sensor corresponds to a much simpler optical design, however, until now, it has not been demonstrated with sufficient precision to measure the phase differences in and between segments although the system is capable of measuring these differences with high sensitivity.

Our contribution, in this respect, is the application of the algorithm of Van Dam and Lane to recover the local wavefront phases in a segmented surface from the measurements provided by a curvature sensor.^{1} In this case, the curvature sensor is interpreted as a geometric sensor and the key, for use, is the choice of defocus planes on which the measurement is done.

The algorithm has been tested for the recovery of the first 50 Zernike polynomials, piston not included, in circular and annular pupils with promising results. The first simulations, to detect local tip-tilt of a segmented pupil, demonstrate excellent sensitivity and precision. Furthermore, the algorithm has been optimized and implemented on compute unified device architecture (CUDA) graphical processing unit (GPU) language to get information of the local tip-tilt within the time stability of the atmosphere (10 ms in visible). All this combined with the known sensitivity of the local curvature of the piston allows for hosting the best expectations for cophasing the segmented pupils, provided that an additional algorithm other than the Van Dam–Lane algorithm, is used to restore the local piston from the same data.^{2}

## 2.

## Van Dam–Lane Algorithm

## 2.1.

### Description

The algorithm of Van Dam and Lane describes a technique for deriving the wavefront aberration from two intensity measurements (${I}_{1}$ and ${I}_{2}$), acquired at two different defocused planes by using the first derivative of the wavefront rather than contrast proportional to the Laplacian of the phase.^{1}

This is a new scheme to detect the wavefront directly using the linear relationship obtained from geometrical optics between the slope of the wavefront and the displacement of the photon.

The intensity defines a probability density function of the photon arrival and the method is based on the evolution of the cumulative density function of the intensity with geometric propagation.

In one dimension, the problem is easily solved with a histogram specification procedure with a linear relationship between the slope of the wavefront and the difference in the abscissas of the histograms. In two dimensions, the method requires the use of the Radon transform. In fact, as the authors mention in Ref. 1: “The algorithm consists only of matrix multiplications including the Radon transform and the least-squares reconstruction and one-dimensional interpolations. Consequently, it is suitable for real time implementation in an adaptive optics system.” Furthermore, the method is insensitive to scintillation at the aperture.

## 2.2.

### CUDA Implementation

The Van Dam and Lane algorithm, applied to the entire pupil of the telescope, can recover the atmospherical wavefront phase. The implementation of the algorithm of Van Dam and Lane on specialized hardware, GPU or Field Programmable Gates Arrays type, is needed to achieve real time (the characteristic time of the atmosphere). In our case, we have decided to implement it first in CUDA (GPU). As there is no data dependency in the calculations, it was decided to assign a thread to each pixel of the image. These threads are grouped into blocks of $256\times 256$. Note, that all calculations are performed on GPU (not CPU) whether it be calculation of derivatives, diffractions, interpolations, or matrix products. The derivatives of the Zernike polynomials have been implemented using the definition by Noll for both derivatives $\partial x$ and $\partial y$.^{3}

After the atmospheric contribution to the wavefront is extracted, the algorithm of Van Dam and Lane is, again, applied in parallel over the 36 telescope segments in order to obtain the local tip-tilt. Table 1 summarizes the results of such an implementation on several GPU card models for various final resolutions of the wavefront phase map. As can be seen, it is possible to work within the time stability of the atmosphere, below the 10 ms, up to resolutions of about $1024\times 1024$ pixels.

## Table 1

Computation times (ms).

Resolution | GeForce 8800 GT | GeForce 9800 GX2 | Tesla C1060 | GeForce GTX 285 | Tesla C2075 |
---|---|---|---|---|---|

128×128 | 1,104 | 1,085 | 0,707 | 0,697 | 0,628 |

256×256 | 3,075 | 2,956 | 1,568 | 1,183 | 1,202 |

512×512 | 8,865 | 8,787 | 4,529 | 3,055 | 3,056 |

1024×1024 | 33,662 | 32,819 | 15,921 | 10,474 | 8,357 |

2048×2048 | 152,452 | 148,464 | 48,738 | 40,104 | 33,551 |

4096×4096 | 874,117 | 894,807 | 182,397 | 153,834 | 121,510 |

## 2.3.

### Zernike Polynomials Restoration

As an initial test of the algorithm, several recoveries of the wavefront phases have been done on circular pupils. The algorithm recovers the Zernike polynomials of the wavefront phase. The polynomials can be retrieved either individually or as a combination. In the combined case, the algorithm maintains the ratio between the coefficients.

As seen in Fig. 1, the algorithm is able to retrieve the Zernike polynomials that comprise the original phase. For this test, we used the first 50 Zernike polynomials on a $512\times 512$ pixel image. The proportionality is maintained as can be seen by observing the similarity coefficients: mean squared error (MSE), peak signal-to-noise ratio (PSNR)^{4} and mean structural similarity (MSSIM).^{5}

The MSSIM index is a method for measuring the similarity between two images. The MSSIM index is the measuring of image quality based on an initial uncompressed or distortion-free image as reference. MSSIM is designed to improve on traditional methods, such as PSNR and MSE, which have proven to be inconsistent with human eye perception. The range of positive values in the MSSIM index is between zero and one. A value of zero means no correlation between images or vectors. A value of one means the two compared images are equal.

Figure 2 shows several recoveries comparing the original and the restored wavefront maps. The original phases are atmospherical wavefronts simulated using a 496 Zernike polynomial expansion.^{6} An 8 m diameter telescope and a 20 cm Fried diameter were considered. The algorithm is able to retrieve the first 120 Zernike polynomials that comprise the simulated atmospherical wavefront phases.

## 3.

## Tip-Tilt Restoration in Segmented Surfaces

## 3.1.

### Simulated Data

The simulations to demonstrate the results have included the generation of blurred images ${I}_{1}$ and ${I}_{2}$ of the geometric sensor from a wavefront phase containing a random distribution of tip-tilt (${Z}_{2}$ and ${Z}_{3}$) in the 36 segments of a large telescope.

The images ${I}_{1}$ and ${I}_{2}$ have been generated using both Fresnel propagation and the Rayleigh-Sommerfeld propagation^{7} (Fig. 3).

Figure 4 shows the recovery of the tip-tilt of each of the 36 hexagonal segments in a telescope type Keck. In an extremely large telescope, as the E-ELT would be talking about more than 900 segments, extracting the local tip-tilt from only two blurred images would be extremely useful.

Figure 5 shows a simulation in which the corresponding coefficients for ${Z}_{2}$ and ${Z}_{3}$ are retrieved. The vertical axis represents the coefficients of tip-tilt and the horizontal axis represents the corresponding segment (1 to 36). With regard to the strokes of the lines, dashed lines represent the initial coefficients and solid lines the coefficients obtained in the recovery.

## 3.2.

### Experimental Data

The adjustment for simulated data appears to be excellent, however, it is necessary to consider the presence of atmospheric phase and detector noise. What we have done is to use real observations to test the sensitivity of the method.

Images were acquired during the observing campaigns Active Phasing Experiment (APE) at the Paranal Observatory (Chile).^{8} The aim of the experiment was to test four different techniques, Van Dam and Lane technique was not included, for cophasing the segmented mirror. As such, the instrument was installed with four sensors on the Nasmyth focus of Unit 3 of the Very Large Telescope with an APE subsystem with which the data was acquired by diffraction image phase sensing instrument (DIPSI). The segmented mirror [active segmented mirror (ASM)] was set to a known configuration and, then, the intra and extra-focal images were acquired (Fig. 6). Figure 7 shows the results of the tip-tilt recovery from the 36 central segments (three rings). The integration time was chosen to average the effects of atmospheric turbulence (10 s) and measure only the contribution to the wavefront phase of the static aberrations of the deformable mirror. The extraction of the atmospheric contribution is not the aim of this article.

Note, that in the DIPSI instrument, the size of a segment is approximately 1 cm which corresponds to 1e-5 radians mean sizes of about 100 nm of tip-tilt. These values of large tip-tilt correspond to the first stages in the process of relocation of a segment recently aluminized. As can be observed, the recoveries are not completely accurate, however, they show similar behavior between original and restored local tip-tilts. New specific observations, with tip-tilt misalignments much smaller, must be done in order to assure the feasibility of this technique.

## 4.

## Conclusions

This paper shows that the algorithm of Van Dam and Lane could be applied for real-time retrieval of tip-tilt segmented surfaces. The fast processing time assures the possibility of extracting the atmospheric phase maps at the same time (inside the characteristic time of the atmosphere). Furthermore, this sensor is sensitive to local piston. Using a different algorithm for piston detection, combined with Van Dam and Lane algorithm for local tip-tilt detection, would allow the full cophasing of a segmented surface with a mounting and robust algorithm much simpler than the traditional use of the Shack-Hartman at the edges.

## Acknowledgments

We thank Michael Thomas for a critical reading of the original version of the paper. This work has been partially funded by national R&D Program (Project AYA2012-32079) of the Ministry of Economy and Competitiveness, the Becas Cajacanarias de Investigación (La Caixa) program, and the European Regional Development Fund (ERDF).

## References

## Biography

**Juan José Fernández-Valdivia** received his BSc and MSc degrees in computer science from La Laguna University, Canary Islands, Spain, where he is currently pursuing a PhD degree in physics and computer science. He has collaborated on specific research projects at the University of La Laguna. His research interest is currently focused on taking advantage of computer graphics hardware and the electronics involved in adaptive optics and astronomical instrumentation.

**Alberto Lastra Sedano** received his BS degree in mathematics in 2005 and his PhD degree in mathematics from Valladolid University, Spain in 2009. From 2006 to 2009, he was a research fellow of Junta de Castilla y León in Valladolid University and, from 2010 to 2011, in the University of Lille, France. He is currently working as an assistant professor in Alcalá University, Madrid, Spain. His research interests are mainly focused on the study of summability of formal solutions of equations, the study of ultraholomorphic classes of functions, and some other related topics.

**Sergio Chueca** received his BS degree in fundamental physics in 1997 in Zaragoza University, Spain and his PhD degree in astrophysics in 2002 from La Laguna University, Spain where he was a postdoctoral researcher until 2009. He is currently working as an optical researcher in Centro de studios de Física del Cosmos (CEFCA), Aragón, Spain. His research currently deals with the study of adaptive optics specifically focused on curvature wavefront sensors.

**Javier Sanz Gil** received his BS degree in mathematics in 1991 and his PhD degree in mathematics in 1996, both from Valladolid University, Spain, where he is an associate professor since 2002. His research currently deals with the study of formal and analytic solutions of several types of differential and difference equations in the framework of general ultraholomorphic classes of functions in the complex domain.

**Jose Manuel Rodríguez-Ramos** received his BS degree in astrophysics in 1990 and his PhD degree in physics from La Laguna University, Canary Islands, Spain in 1997. From 1990 to 1993, he was a research fellow of The Instituto de Astrofísica de Canarias and, from 1998 to 2000, he was a postdoctoral fellow of the same institute. He then returned to La Laguna University to work as an associate professor in electronic engineering. His research interests are currently focused in electronics involved in adaptive optics and astronomical instrumentation.