Measuring the cophasing state of a segmented mirror with a wavelength sweep and a Zernike phase contrast sensor

The demand for higher resolution telescopes leads to segmented primary mirrors which need to be phased for operation. A phasing sensor applying a wavelength sweep technique provides a large capture range without modulating the position of individual mirror segments. This technique offers the potential to monitor the phasing state of a segmented telescope in parallel to the science observations. We evaluate the performance of the wavelength sweep technique using a Zernike phase contrast sensor for coarse phasing. Tests results on a dedicated bench show 112 nm rms precision. With the help of a simulation, we explain a known error of the method and we suggest ways for improvements.


Introduction
The next generation of large optical and infrared telescopes [1][2][3][4][5] rely on segmented primary mirrors, based on the heritage of the Keck [6] and GTC [7,8] telescopes. The relative height (piston) and orientation (tilt) between neighbouring mirrors segments need to be controlled to within a fraction of the wavelength of observation [9]. In the particular case of the ELT, each of the 798 segments will be equipped with six edge sensors and three position actuators. Their role is to maintain a piston and tilt set-point defined during periodical on-sky phasing runs with the "Phasing and Diagnostic Station" [10]. This station will include a suite of different visible and near infrared sensors, performing guiding, high and low order wavefront sensing, as well as phasing tasks. Phasing runs compete with science time and are foreseen to occur typically every two weeks.
Several types of phasing sensors have been validated on sky using 10 m-class telescopes, such as the Shack-Hartmann [11][12][13], the Pyramid [13] and the Zernike phasing sensors [13][14][15]. These sensors provide comparable performances, reaching about 20 nm rms piston error (wavefront) in closed-loop for a star as faint as 18th magnitude, reaching a piston error as low as 6 nm rms for bright stars. Other types of sensors such as ELASTIC [16] or the self-coherent camera [17] have been tested and validated. ELASTIC has demonstrated that it could align and phase a sevensegments mirror with a residual wavefront error of around 50 nm RMS. The Self-Coherent camera, on the other hand is derived from a four quadrant coronograph and in simulation demonstrates its capacity to phase a segmented mirror with less than 5 nm residual RMS wavefront. Except ELASTIC, most phasing sensors' capture ranges are limited to ±0.5 the sensing wavelength. The ELT baseline wavefront control strategy foresees the implementation of a Shack-Hartmann phasing sensor, assisted by a Zernike phase contrast sensor for accurate pupil registration. [18] A freshly integrated segment will be mechanically aligned, with tens of micrometers precision. Most phasing sensors need an additional method to extend their range to tens of micrometers. Various methods have been implemented for extending the capture range beyond several microns. These include implementing multicolour schemes [19,20] and measuring light coherence by modulating the segments [11,21]. However, these methods rely on modulating the segments' piston and therefore cannot be used in parallel with science observations. This can be avoided by using a wavelength sweep technique as demonstrated by [22] in combination with a pyramid phasing sensor. The implementation is based on the commercial availability of a Liquid Crystal Tunable Filter (LCTF [23]). This device allows the rapid setting of the wavelength between 650 nm and 1100 nm with a resolution of 1 nm and a bandwidth of 10 nm. A capture range of 15 µm has been validated on-sky with a precision better than 0.25 µm [22].
The wavelength sweep technique has the potential to monitor the phasing state of a large segmented mirror telescope with a large capture range, without affecting science observations. This may help in identifying phasing performance degradation between periodic phasing runs, which may be difficult to detect through indirect failure detection schemes. In addition, it could help with pre-phasing freshly re-coated segments that will be installed on a daily basis. In this particular context, the Zernike phase contrast sensor represents a good sensor candidate because of its intrinsic simplicity. Its signal has the same dependence as the pyramid sensor's to the relative height between two segments. For example it could be integrated at the intermediate focus of one of the ELT's guide probes [10] should they be upgraded in the future.
In section 2 we present the working principle of the wavelength sweep technique and how it can be applied to the Zernike phase contrast sensor. We describe the expected piston measuring range and introduce strategies for minimizing the impact of two known sources of piston measurement errors: a sign error and a random error, appearing for small pistons values. In section 3 we show experimental results obtained on an upgraded version of ESO's APE test bench [24]. A comparison with simulations is given in section 4, before concluding and discussing next steps for validation.
For clarity purposes, the word piston will designate a segment reconstructed height with respect to a reference, the acronym optical path difference (OPD) the relative height between two neighbouring segments, and the term border will refer to the separation between two adjacent segments where the OPD was measured.

Wavelength sweep technique
Previous studies [22,25] report the use of the Wavelength Sweep Technique. The working principle is as follows: in most interferometer systems, the intensity of the fringes depends on the path difference between two surfaces and on the wavelength used. They are linked by the following mathematical expression: Where A and B are fit variables of respectively the sinusoidal amplitude and offset and λ is the wavelength. 2π λ can also be denoted as k, the wavenumber. OPD is the relative height between the two neighbouring segments and φ a free parameter for the phase delay.
Classically, a multi-wavelength method is analysed by the excess fraction method or derived methods (see [26]). This approach is illustrated in Fig. 1.
Each coloured sinusoid represents how the intensity of a fringe would vary with the OPD indicated on the x-axis. For a given measurement, each wavelength creates a different intensity. This intensity could have been generated by any of the OPDs at which there is a round marker on Fig. 1. One needs to look at all the wavelengths to identify which OPD creates the measured intensities: it is the one for which all wavelengths and their corresponding intensities give the same OPD, as represented by the vertical dashed line in Fig. 1.
Another way of displaying the intensity measurements is illustrated in Fig. 2. The markers  Fig. 1. Illustration of the excess fraction in an ideal case (no noise). Each colour represents a wavelength, and they have been vertically offset for readability. The wavelengths are sorted such that λ 0 < λ 1 ... < λ 8 . The sinusoid represents the variation of the intensity with the OPD in x-axis. A measurement has been made at each wavelength. Since the signal has a sinusoidal dependency, the signal registered could have been produced by any of the OPD with a round marker. The only solution to the problem is the one for which all wavelengths' likely solutions line-up as indicated by the black dashed line. This perfect alignment is only possible because there is no noise in this example.  [27] by the magnitude of the smallest detectable OPD and the largest detectable OPD. The smallest detectable OPD is defined as: With λ e the wavelength at the end or the biggest wavelength of the sweep range, λ s the wavelength at the start or the smallest wavelength of the range, ∆φ m the smallest phase change tolerated within the sweep range. The recommendation by [27] is to use ∆φ m = π. This is equivalent to assuming that there should not be less than half a period between λ s and λ e . OPD m also describes the limit under which the random errors start to be an issue. OPD m is a consequence of the limited sweep range. When OPD < OPD m , less than half of a period is present in the sweep range and a fit tries to find Eq. (1) in the noise of the signal. Consequently the A parameter of Eq. (1) is of the order of the signal noise amplitude and OPD takes a random value. The largest OPD is given by: With λ = λ e , δλ is the sampling of the sweep and ∆φ the largest phase change tolerated between two samples. Again, the recommendation by [27] is to use ∆φ M = π/2. This is equivalent to assuming in the worst case a quarter of a period between λ s and λ s + δλ. This recommendation is a consequence of the Nyquist criterion which states that at least two points per periods are required. The Nyquist criterion says that there should not be more than half a period between two samples. We use a quarter of the period (∆φ M = π/2) meaning four points per period as a bare minimum. The capture range of the method is (2) helps define the total sweep range λ e − λ s . Eq. (3) helps define the sampling δλ. The minimum number of wavelengths required for the wavelength sweep, to give a reliable answer is given by (λ e − λ s )/δλ.

Phase closure
In [22,25], the wavelength sweep requires some error checking. The aim is to verify the consistency of all the OPDs measured and to find the sign errors and the random errors.
This study's error check is based on the phase closure made for long baseline astronomical interferometry [28]. In interferometry, pupils are grouped by three and a super computer tries to nullify the phase delay for all groups of three pupils. Here instead of pupils, groups of three connected borders are made and the OPDs are summed. If the sum is zero, all three OPDs are consistent.
On segmented mirrors, the groups of three borders are made by finding all borders that share a common end, e.g.: in Fig. 6, the borders separating segments 1, 6 and 18 have a common end. For convenience, we call groups of three borders a corner. Each corner can be summed clockwise (this is important for the sign of the OPD). In an ideal case without any sources of noise, if their sum adds up to zero, then all three OPDs are correct. If they do not sum to zero, one or two of the OPDs are wrong. The wrong OPD can be found by looking at the surrounding corners.
If another neighbouring corner's sum is also not zero, then the border between the two corners is the culprit. There are two possibilities: a sign error or a random error. In the case of a sign error, the sign of the OPD can be changed and the sum will become zero. In the case of a random error, changing the sign will not make the sum zero. The random error should be flagged and later, during the mirror segment's piston reconstruction, ignored.
The algorithm stores which OPDs need to have an opposite sign to the one calculated and which OPDs need to be discarded, because of the random errors. Some combinations of borders with sign errors or random errors render this strategy ineffective. The probability of occurrence of those combinations becomes too high if the number of detected wrong borders OPDs is >10-15 %.
In practice, because of noise, the sum of three borders never equals zero. The best found threshold is: All corner sums less than T are treated as if the sums are zero. This threshold minimizes the number of borders that are wrongly detected with an error, while it maximizes the number of borders correctly detected with an error. This is determined empirically with the help of the measurements made on the test bench. It is relatively high because the phase closure does not take into account the bias that accompanies a sign error (see section 3.3).

Zernike phase contrast sensor
The wavelength sweep relies on a phasing sensor to give it the information represented by the round markers on Fig. 2. We use the Zernike phase contrast sensor to this end. The Zernike Phase contrast sensor was first described in [14,15,20]. Its setup, in the context of the present work, is presented in Fig. 4. Schematically, it is a phase mask placed in the focal plane of the telescope, centred on the star image, and a re-imaging optic to project an image of the pupil plane on the detector. The signal of the phase mask is an intensity variation, perpendicular to the separation between each pair of two adjacent segments in the pupil plane. The effect of the phase mask is to turn only the high spatial orders of the phase into an intensity signal. For a simple mathematical description, the reader is directed to [29] section 13.2.4. The phase mask is a parallel plate with a top hat circular depression at its centre. The depression has a radius a and creates an optical path difference D. a and D should be tuned to the atmospheric conditions and the wavelength used. We are working with a ground based telescope and, in a worse case scenario, without adaptive optics. Ideally, we would like to ignore the effect of the atmosphere. a has an influence on the cutoff frequency of the high pass filter and the width of the signal. a should be bigger than half the atmospheric seeing, to remove as much as possible the lower spatial frequency wavefront distortions [14]. a is defined in angular units to remain independent from the telescope plate scale.
The phase contrast signal can be anti-symmetric across the border. This property gives the indication of which segment is higher than the other one, and therefore the direction of the correction. The anti-symmetry arises only if D is close to a quarter of the wavelength of observation. The signal becomes completely symmetric when D is half a wavelength. Ideally, D should be a quarter of the middle wavelength of the sweep range. Because of the available hardware, this study uses a phase mask optimised for λ =700 nm, D = 700/4 nm = 175 nm. We define D in metric units. It is converted to the wavelength dependent phase angle by the fitting algorithm. In our case, we can also approximate D as constant, as the refraction index of the materials used doesn't change significantly across the sweep range (δn SiO 2 = 0.006 and δn air = 10 −5 ). Fig. 3 shows the signal evolution with an increasing OPD from left to right.
The extraction of the information needed for the wavelength sweep is done by a fit as described in [14] in section 3C. The signal can be described and fitted with a 6 parameters equation( [14] Fig. 3. Simulation of the evolution of the Zernike phase contrast signal with increasing OPD between two adjacent segments. The phase mask has a radius a = 0.5 " and a depth D = λ/4. The title of each plot gives the current relative height or OPD between the two segments. The x-axis is projected on a VLT primary mirror. The black line represents the signal without atmosphere (θ s = 0) and the red line with a seeing of 0.6 " (θ s = 0.6"). With: The s parameter is adjusted once, depending on the system's resolution and gap. [14] omits to mention that in the actual fitting algorithm, the effect of the polishing errors and the gap are accounted for by replacing the sign(x − a 5 ) by f step . a 3 and a 4 are background terms that are mostly nullified by the image normalisation. a 5 describes the signal centring on the border and is nullified by pupil registration. a 6 = π2a/λ with a the phase mask radius in radiant and λ the wavelength in meters. This needs to remain a free parameter in the fit (within bounds) because it has slight dependency on the seeing conditions. ψ is the delay created by the phase mask in radian. ψ = 2πD/λ where D is the delay created by the phase mask in nm.
To the first order, a 1 and a 2 are : where k is the wavenumber, OPD is the current OPD at the measured border. C 1 and C 2 are two coefficients that describe mainly the influence of the atmosphere on the signal. The equation of a 1 can be directly linked to the Eq. (1) of the wavelength sweep and justifies the use of the phase contrast sensor. For the wavelength sweep, since the wavelength changes between each measurement, the signal's shape changes too. There are two effects: like for any interferometer, the same OPD does not represent the same fraction of the wavelength, hence the signal's magnitude changes accordingly. a 1 and a 2 describe this effect. The second effect is linked to the depth of the phase mask, which does not represent the same phase delay for each wavelength. This will change the evolution of the of the signal's shape. ψ in Eq. (5) is the description of the changes in the signal shape. It controls whether the signal will be more anti-symmetric or symmetric with the term: [a 1 f step (x − a 5 ) sin (ψ) − a 2 f mask (a 6 (x − a 5 ))(1 − cos (ψ))]. If ψ = π/2 then the cosine part will be cancelled out. The signal will always look like the one in Fig. 3 at OPD = 0.16λ and will only change in magnitude. As ψ changes toward 0 or π, the cosine contribution will become more important, while the sine will decrease. When ψ = 0 or π the signal will look like Fig. 3 with OPD = 0.48λ. Only the amplitude will change.
A good fit to this equation is only possible if the following measures are taken. The phase mask's central depression needs to be centred on the star image, with a precision better than a/8. The pupil registration must be done with a precision better than the pixel size, for the outer-most ring of borders. Finally, the setup needs to be achromatic, e.g. to avoid defocus as a function of wavelength.   Fig. 4 shows schematically the test setup used to validate the wavelength sweep technique. The test bench starts with a fiber head source that emulates a star, which injects a white light into the bench. A lens collimates the light beam into the liquid crystal tuneable spectral filter [23]. The turbulence generator MAPS [30] adds atmospheric turbulence to the beam. Re-imaging optics re-scale the beam, to cover the entire segmented mirror using. Another set of re-imaging optics focus the beam on the Zernike phase contrast sensor. Finally, a lens collimates it on the detector.

Overview of a measurement
After setup, the internal metrology [31] drives the segmented mirror to a piston configuration, while images at different wavelengths are recorded.
To use the phase contrast sensor, two images at each wavelength are required: one with the phase mask, the other one without [14]. The image without mask is only needed for normalisation of the image with the mask. The background for the normalisation is extracted from the corners of the image with the mask, as indicated in the blue boxes in Figure 5. The normalised image with the mask is used to perform the pupil registration and to extract the phase contrast signal, as illustrated in Fig. 5 by the green boxes.
Each of the border's signals are first fit as described in section 2.3. The result of this fit at all the recorded wavelengths is then used to perform the wavelength sweep on each border, as described in section 2.1. From the previous study [22,25], it is already identified that the wavelength sweep has two major errors: a sign error and a random error. The sign error is a misdetection of the sign or direction of the OPD. This article explores the reasons for this to happen in section 3.3. The random error happens when the OPD is too small. In response to these two errors, we perform a check on the result of the wavelength sweep and, when possible, correct the sign errors as described in section 2.2.
Finally, the piston of each segment is computed, using the pseudo inverse of the synthetic interaction matrix linking the segment pistons with the border's OPD.

Setup and data acquisition
The goal of the experiment is to use the wavelength sweep method to measure the phasing state of the segmented mirror and determine the precision with which the piston could be measured in various scenarios. The segments are initialized into two types of configurations shown in Fig. 6, "family" and "random".
The family configuration puts all segments in red at the same piston. The random configuration applies a random piston to each segment. In different measurements, the red segments in the family state shown in Fig. 6 left took the pistons -6 000, -3 000, 2 000, 4 000, 5 400 nm. The state shown on the right is an example of the six random states used. The segments' piston is uniformly and randomly distributed between ±6 000 nm for two configurations, ±4 000 nm for two more and ±2 000 nm for the final two. Each of the presented configurations are measured separately. The result for all of them confounded are presented in the following sections.
In order to apply the family and random configurations, a reference measurement system called the internal metrology [31] is used. The internal metrology is a dual-wavelength Michelson interferometer, using a four points phase shift polarisation encoded scheme to retrieve the phase of each wavelength. One arm of the Michelson interferometer reflects off the segmented mirror, while the other one reflects off a reference mirror. The two wavelengths are alternatively shined in the interferometer and a synthetic wavelength algorithm is applied.
The choice of the wavelengths in the sweep is driven by Eq. (2) and Eq. (3). The smallest OPD detectable is ≈930 nm because λ s = 650 nm for the Liquid Crystal Filter. λ e = 1 000 nm due to 0  1  2 3  4  5  6  7  8  9 10 11  12  13  14  15  16  17  18  19  20  21  22 23 24 25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41 42 43 44 45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  0  1  2 3  4  5  6  7  8  9 10 11  12  13  14  15  16  17  18  19  20  21  22 23 24 25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41 42 43 44 45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60 Fig. 6. Example of imposed piston configuration. Left: "family", has been repeated several times with all segments in red placed sequentially at -6 000,-3 000, 2 000, 4 000, 5 400 nm OPD. Right: "random" shows an example of one of the six random configurations applied. The distribution of the pistons is uniform and distributed between ±6 000 nm, ±4 000 nm and ±2 000 nm. All segment positions are given relative to the centre segment 0. the cut-off wavelength of the detector, setting the sweep range from 650 to 1 000 nm. ∆φ m = π/2 For the largest OPD, the goal is to find the appropriate δλ to cover the required capture range. The wavelength sweep needs to cover the capture range of our reference measurement method which is ±6 000 nm. Eq. (3) can be rearranged as (Assuming ∆φ M = π/2): Where OPD M is the required capture range. For OPD M = 12 000 nm, δλ ≈21.3 nm. For convenience in measurements, δλ is set to 20 nm which makes an OPD M = 12 750 nm. Finally, all data points at 830 and 850 nm are removed, because of a notch filter in the beam between 815 and 865 nm. The notch is present to cut out the wavelength used by the internal metrology, scattered by the segmented mirror. In total 16 images at a different wavelength were taken, starting at 650 nm by step of 20 nm, up to 990 nm. In addition to the many correct measurements on the green dashed line, there are two interesting features in this result. First, all the data points that surround the red-dashed diagonal with a sign error, secondly closer to zero on the x-axis, all the data points with random errors. They correspond to the errors already reported by [27]. The sign error is explored further in section 3.3.

Wavelength sweep result
The random errors are discriminated by a threshold on the parameter A of the wavelength sweep and their OPDs are set to 0. Fig. 8 shows the precision of all the measured OPDs; the values are reported in Tab. 1.
The top histogram shows this for all OPD measurements and the bottom one for all the measurements that have a sign error. The shape of the histogram with sign error is a consequence of the least square equation applied to this problem. A more detailed explanation is given in section 3.3. Fig. 8 does not include all the OPDs of the "family" configuration ( Fig. 6 left) that are phased. There are 30 phased borders measured five times. Only three borders were not detected as phased, including one border that was fitted twice as non-zero.
The blue boxes in Fig. 8  measurements without sign error. This is to compare with the capture range of a monowavelength phasing sensor e.g.: 650 nm the capture range is ± 162 nm. This already demonstrates the  capacity of this method to reduce the phasing error to the capture range of a monowavelength phasing sensor.

Interpretation of the sign error
In Fig. 7 the red dashed line represent the sign error. It affects on average 30 % of the OPDs in the present data set. The sign error does not systematically affect the same border in repeated measurements over the entire mirror. Borders that were identified as potentially problematic (e.g.: because of a dust too close to the border or damage to the optical surfaces) do not show a higher rate of wrong sign detection than others. We cannot explain the sign error with hardware problems. The sign error is detected in up to 12% of the OPDs in the family configuration of Fig. 6. This number is better for the family configurations because 33 % of the borders do not have an OPD. In the 66 % of borders that have an OPD, 18% have a sign error. For the "random" configurations 23-50 % of the borders have a sign error. A potential explanation for the higher number of sign errors in the random configuration is cross-talk between borders. A property of the sign error is shown on the bottom histogram in Fig. 8.It shows two groups of data points, bracketing the zero deviation point. These groups give a clue as to the origin of borders with incorrectly detected signs.
This study uses a least square criterion to find the best solution: Where S represents the signal and M an ideal model. Fig. 9 shows the evolution of R with the OPD given on the x-axis for the model M with S having a fixed OPD at 4 000 nm.
For the readability of this demonstration the signal S is ideal and has no noise. The green vertical line represents the true answer and the red one the true answer with a wrong sign. Looking only at the blue curve, the red line is surrounded by two minima, at 400 nm OPD from the true absolute value (with the opposite sign). Additionally, the fitting algorithm used for the wavelength sweep allows the parameter φ to vary in [0; 0.2 π] ∪ [0.8 π;π ]. Taking the extremes, the orange and purple curves respectively represent what happens to R when the model has the same φ of respectively 0.2π and 0.8π. The φ of S is also respectively 0.2π and 0.8π. The left minimum comes as close as 240 nm to the magnitude of the true value when φ = 0.8π and the same for the right one when φ = 0.2π. This phase variation explains the width of the two peaks in the bottom histogram of Fig. 8.
A physical reason for φ to drift can be found in [32] section 7.1.2: They show empirically that the alignment of the phase mask on the star's image has an influence on the phase contrast signal shape. In their model they translate the effect of the alignment in the equation of a 1 (to compare with Eq. (1)): Where δ ≈ 2.8 w 2a with a the radius of the mask and w the distance of the star's image to the centre of the phase mask depression. A and OPD are the same as in Eq. (1). For δ to be of the order of 0.2π, the star's image needs to be 0.14a off the mask centre. The formula suggests that this misalignment should produce over all signals an offset of A sin δ. In the data, a corresponding offset signature is only found in 15 % of all OPD measurements. According to [32], a mask misalignment should create a consistent offset on all OPDs. Because this offset does not appear consistently across all borders, the misalignment cannot be responsible alone for the sign errors.
Further simulations are required to explain the drift in φ, this will be addressed in section 4. However, Fig. 9 allows us to define the noise threshold at which this drift of φ results in sign errors in the fit. There is a relation between the standard deviation and the minimisation criterion. The standard deviation is written as: With x all the measurements andx their expected values from the model. Eq. (8) and Eq. (10) can be combined by defining x = S(λ i ),x = M(λ i ) and N the number of wavelengths used. One can write: where σ is a description of the average noise per point. To explain the number of sign errors, we investigate the impact of the noise on whether the fit finds the correct minimum or secondary minimum, using Fig. 9. We find that when φ is 0 (blue curve) , a noise of 0.17 x intensity will result in finding the secondary minimum. For φ = 0.2π (orange curve), a noise at roughly half that level will result in finding the secondary minimum. The same occurs for φ = 0.8π (the purple curve). The average standard deviation on the bench is 0.13. This is in between the limits of 0.17 and 0.09 and it makes a drift in φ a plausible explanation for the number of sign errors. Again the only physical reason for φ to drift would be a misalignment between the star image and the phase mask. We will see in section 4.2 that alternatively the fitting noise can also create drifts in φ. With lower noise, the fit would be robust against drifts in φ.

Phase closure
After measuring the OPDs, the phase closure algorithm attempts to correct any sign errors and detects remaining random errors. Tab. 2 presents per configuration the number of sign errors detected in the second column and how the phase closure algorithm performed in the third and fourth column. Tab. 2 confirms the threshold of 10 to 15 % of sign errors, established in Section 2.2, for good performance of the phase closure algorithm. Only the family configurations with 12 % and less sign errors are successfully corrected. The phase closure algorithm does not manage to correct enough OPD in the random data sets. The random data sets output data are unusable for the rest of this study. The correction of configuration family 5 468 nm does not work in our test, because a random error could be compensated by two other OPD having their signs changed. One of these two borders is at the edge of the segmented mirror, and hence does not cause more damage. The other border is not so conveniently placed and its sign change is compensated through other sign changes, resulting in a cascading error. In the data set family -6 000 nm and 4 000 nm one border in each was measured with a random error. Both borders are marked to discard by the phase closure algorithm. This is confirmed by looking at the fitted parameter A of each border which was slightly above 0.1. As a result, the phase closure can also act as a second detection for random errors that passed the previous filter.
The family data sets show that the phase closure algorithm can help detect and correct for incorrectly measured OPDs. The random data sets also show that it is easily overwhelmed in the presence of many sign errors and random errors. One way of improving the phase closure algorithm would be to record during the wavelength sweep fitting the three best solutions for the OPD. The phase closure algorithm would try all possible solutions for all corners that have been calculated as not null.

Final mirror reconstruction
Finally, the corrected OPD measurements serve to reconstruct the piston of each segment, through the pseudo inverse of a synthetic interaction matrix. The result can be compared to the measurement of the internal metrology.
For each segment and for the data sets where the phase closure algorithm is successful, Fig. 10 shows the residual after subtracting the wavelength sweep reconstruction from the internal metrology measurement. The precision of the reconstruction is 112 nm RMS. The measurements from the configuration family 2 000 nm are interesting because there is no sign error to correct. This reconstruction is precise to 42 nm RMS, nearly 3 times better than the average. The three other configurations are worse, because the sign correction did not try to correct for the ≈300 nm bias that comes with the sign error. The idea of allowing the phase closure algorithm to choose from the three best OPD measurements, when attempting to correct the sign errors would also correct this bias, potentially further improving performance of the mirror reconstruction in the presence of sign errors.
The bias accompanying the sign error is even more relevant, if considering the aim of the wavelength sweep. We want to give the mirror a phasing state that is in the 100 nm range, in order to do mono-wavelength phasing. If the PV of the residual piston is in the 400 nm range, it means that we will need to use 1 600 nm as a wavelength for the mono-wavelength phasing. This is possible and sufficient for observations in the infra-red but not for observation in the visible. If the piston PV is of the order of 100 nm, this means that working at 400 nm for the monowavelength phasing can be achieved. This becomes excessive for most visible light observations, but acceptable for UV observations. f -6000nm f -3000nm f 2000nm f 4000nm

Model description
The objective of this simulation is to find the worst offenders in the wavelength sweep, using the phase contrast. The criteria are: the number of OPDs with a sign error, the precision and accuracy of the fit, and the errors on small OPD amplitudes.
This simulation is an image simulator and a simplified pupil registration algorithm. The output of the pupil registration algorithm is then fed into the fitting algorithm. The image simulator takes a 4096x4096 pixel input pupil wavefront. The input wavefront includes by default a segmented pupil with the possibility to add any piston to any segments. A series of operations is applied to this image: (i) The input pupil is Fourier transformed into the focal plane, (ii) the focal plane is multiplied by the phase mask function, (iii) the resultant wavefront is then Fourier transformed to the output pupil plane, (iv) the sum of the square modulus of the output wavefront is calculated to create the image. (v) the image is recalculated for each wavelength of the spectrum's bandwidth. The simulation process is illustrated in the Algorithm 1. The Liquid Crystal Tunable Filter we are using to select the wavelength of observation has a bandwidth of roughly 10 nm to 20 nm. The effect of the bandwidth can be simulated by adding the intensities at different wavelengths inside the bandwidth. In the current simulation, the final image is the sum of seven wavelengths: A n is the amplitude of the complex wavefront that is chosen according to a Gaussian distribution. Ψ is the complex exponential part of the wavefront and BW is the full width at half maximum of the source bandwidth. All seven images are summed to have the final image. Finally, this image is binned to match the 512x512 pixel camera resolution on the experimental test bench. By default, a photon shot noise is added to the final image, though this can be turned off for testing. There are eight known sources of noise : 1/ the readout noise, 2/ the variation of the spectral bandwidth of the light, 3/ the atmosphere emulated by MAPS, 4/ the segment positioning error of the internal metrology, 5/ a chromatic defocus, 6/ a misalignment of the mask, relative to the average star's image position, 7/ the segments misfiguration error and 8 / the pupil registration. The way each of these noises is added and their order is illustrated in the Algorithm 1.
The Liquid Crystal Tunable Filter provided by Thorlabs [23], has a broadening of the bandwidth with an increase in central wavelength. From the data provided by Thorlabs we can find a polynomial relation that describes this effect with respect to the central wavelength. The equation is: BW = 10 −5 λ 2 + 0.0019λ + 6.8659 (13) with λ as the central wavelength in nanometres.
In the input complex wavefront, the noise effects that are added are the atmosphere, the positioning error, the segments' misfiguration and the chromatic defocus. On the bench, the atmosphere is simulated by MAPS [30]. The simulation reproduces its properties. Because the phase contrast works better with long exposures, this is simulated by recalculating several times the output complex wavefront with as many different atmospheric screens as seconds of exposure time. 30 seconds of exposure are used on the bench, hence 30 atmospheric screens are used for the simulation. The phase contrast being only sensitive to the high-frequency wavefront deformation, in 1 second they have changed enough to be approximately uncorrelated.
The internal metrology positioning error is translated into a Gaussian distribution of errors added to the position of the individual segments in the input complex wavefront. This error is an accumulation of the internal metrology measurement error [31] on the positioning system of the test bench [13]. A previous study [13] mentions that the RMS on the OPD error is 0.75 nm over 5 hours. Measurements done for this study show an RMS closer to 5 nm RMS, probably due to ageing of the hardware. For each input wavefront, a new draw of piston errors with an RMS of 5 nm is added.
The individual segment misfiguration is an information recorded by the internal metrology. It shows a maximum of 30 nm PV misfigure error. This information is added to each input wavefront on each segment, as the phase contrast is sensitive to the segment misfigure.
The chromatic defocus seems to come from the last lens collimating the beam on the detector, according to the Zemax design of the test bench. According to the Zemax design, the defocusing at the detector as a function of the wavelength is: With λ in micrometers. Since the focus is set with a wavelength of 650 nm, The defocus created on the camera will be D λ − D λ=650 In the focal plane the misalignment of the phase mask relative to the position of the star image is added. An important hypothesis here is that the tip tilt of each segment is zero. On the test bench, this hypothesis is valid due to the internal metrology. Then we can describe the difference between the phase mask centre and the centre of the star image. On the bench, the alignment was done better than a quarter of the mask radius at 650 nm. No verification has been made at other wavelengths and the initial alignment was done using the turbulence generator with a long exposure. For comparison the effect of misalignment has been evaluated with errors from 0 to 0.5 times the phase mask size.
The read out noise is added onto the rescaled output image, because it occurs at readout of the CCD pixels. Prototypes of the VLT Technical CCDs are used as cameras. These CCDs have 80 e − RMS of readout noise. In addition, the readout noise presents structures that can be described by reconstructing the way the detectors are read. CCDs are read pixel by pixel, but the pixels need to be shifted to single readout output, which is located in one of the corners of the CCDs. The pixel matrix can be flattened by putting each row in a single line and then considered as a time series of intensities. According to documentation, a pixel is read each microsecond and the time needed to shift the next row in place is negligible. Dead pixels are replaced by an average of the full image without dead pixels. This time series is Fourier transformed and shows the frequency noise structures. The frequencies and amplitudes of the five highest peaks in amplitude are recorded and used to simulate this same configuration on the simulated images. Because these five frequencies can shift, this is done for 9 different darks to have a small statistical sample of the possible frequency shifts. Tab. 3 lists the recorded spectral results.
The last possible source of error is the pupil registration. The aim of this procedure is to retrieve the orientation of the hexagonal array, the size of the segments and the global centre of the hexagonal array. For the simulation, the pupil registration is done by giving the required pupil registration parameter. There are four parameters to adjust: the pupil orientation, the segments' size and the coordinates of the centre of the pupil. For the data these four parameters are found using the procedure described in [33]. According to this article, the precision on the orientation is 12', 0.07 pixels for the segments' size and less than 0.07 pixels for the x and y position of the pupil centre. In order to test the robustness of the fitting to these errors, the orientation was tested from 1' up to 32', segment sizes from 0 to 0.5 pixels and centering from 0 to 2 pixels.

Simulation results
In the simulation, with no added sources of noise, there are no sign errors. On the other hand under ≈1 000 nm, the simulation shows already random errors. This result includes light with a constant bandwidth of 10 nm. The random errors observed would be reduced if the bandwidth was reduced. This remains unchanged when the readout noise, the internal metrology positioning error, the broadening of the spectral bandwidth and the segments' misfigure are summed.
However, the addition of the atmosphere generated by MAPS to all the above-mentioned effects creates on average three borders with a sign error. It also generates on average four borders with random errors. An image defocus added to the previous effect creates three borders with a sign error. The phase mask misalignment can create up to 15 borders with sign errors on average when the misalignment is 0.5 of the phase mask radius. A misalignment by 0.1 mask-radius can create up to two wrong signs.
Finally, including the pupil registration with centring errors and segment size errors, no additional errors are created. The misdetection of the orientation starts creating sign errors at 25' in the rotation. Fig. 11 to Fig. 14 summarise these findings. Fig. 11 and Fig. 12 show the simulated results with the quantity of noise as expected from measurements of the test bench.
First, the fitting of the precision is similar to the one found with the measurement data. Second, the sign error shows a similar behaviour, by also showing offsets to both sides of the expected value. Only the quantity of sign error is not comparable: only 5 % of the borders present sign errors in the simulated data. The only way to come closer to the measurement data with 20 % of sign errors is to increase the phase mask alignment error to 0.5 x radius. This is presented in Fig. 13 and Fig. 14.
Finally,according to Eq. (9), φ is solely influenced by the misalignment, however, the present simulation disagrees with this statement. The fit of φ in the data without noise leads to randomly scattered φ values inside its boundaries. This means that the fit of the phase contrast signal already introduces noise. To be exact, the noise comes from the model that incompletely describes the signal. Eq. (5) has been developed from a 1 dimensional model of an isolated border without a gap separating both segments. There are features of the signals it approximates, such as the effect of the gap and the slight cross talk between borders, which makes the current fit inexact. Developing a more complete model of the phase contrast signal should improve this.
This simulation demonstrates that the technique presented here is most sensitive to the phase mask alignment. The next worse offender is the pupil registration and particularly the orientation of the pupil. The simulation shows that the drift in φ is not solely the effect of a misalignment, but also of a fitting noise. Finally, it also demonstrates that the fit of the phase contrast signal is responsible for noise and should be improved.

Discussion and conclusion
In this paper we detail a technique dedicated to the accurate measurement of local pistons of segmented mirrors for large telescopes. This technique, named the wavelength sweep, is combined with the principle of the Zernike phase contrast sensor, that has been developed a decade ago in the framework of the VLT-APE experiment. In this paper, we present the simulations of the entire technique from the simulated images to the measurement precision estimation of the piston per segment. This technique has been applied on the dedicated test bench at ESO, to evaluate the performance of the method and compare the results to simulations. The wavelength sweep combined with the phase contrast sensor shows promising performances with 64 nm RMS of precision. When there are no sign errors, a segmented mirror reconstruction can reach a precision as low as 42 nm RMS using the method. The simulation shows that the technique is resilient to a number of noise sources, including movement of the segments between and during each wavelength acquisition (within a 5 nm RMS over the entire measurement hence 30 seconds times 16 plus 10 seconds to change the wavelength times 15), a defocus between wavelengths, segment misfiguration, and camera readout noises.The simulation also shows that the measurement technique is more sensitive to alignment of the phase mask. Table 4. Gaussian fit parameters to the histograms in Fig. 12   We demonstrate that the sign error previously investigated [22], has its origin in a weakness of the least square criterion to the noise. The sign error is accompanied by a bias that degrades the measurement. A method to correct the sign via the phase closure algorithm is offered, but it does not solve the bias. This degrades the ultimate performance of the final reconstruction from 42 nm RMS to 112 nm RMS. However, a higher degree of interconnection between the phase closure algorithm and the wavelength sweep could also improve the sign error correction, allowing removal of the bias. The study in [27], suggests that a smaller sampling of the wavelength sweep and several measurements at the same wavelength improve the sign error detection. This remains to be tested with the phase contrast sensor.
We have extensively reviewed the influence of the piston on the measurement. The tip tilt is of concern as it degrades the measurement. The phase contrast sees an angle like a piston variation along the border. In the presented method we average the signal along the borders. The presence of a tilt makes the signal shape change along the border and, if too important, will create a signal shape that is impossible to fit. Ideally, the angle should create less than λ s /10 of OPD variation, in order to be ignored. This is an angle of 0.025 " on a 90 cm edge to edge segment. This study assumes that the tip-tilt is dealt with, before the piston, by other means. For example, the tip-tilt could be addressed using the algorithm in [14] section 3.D. Instead of a single box, two smaller boxes are used to retrieve the signal along each border and fitted accordingly. Also an interaction matrix including tip tilt is used for the reconstruction. However, this is highly speculative and remains to be tested in future studies.
The use of the phase contrast sensor in this study is linked to the hardware availability and to the sensor's ease of integration. In terms of performance on sky, [12] demonstrate similar performances for the pyramid and Zernike phase contrast sensors. The strength of the phase contrast sensor lies in its higher tolerance to misalignment and its non-intrusiveness. The pyramid sensor requires a modulation of the star image on the pyramid [34]. The Zernike phase contrast sensor is less intrusive than the pyramid because, after the phase mask, the beam can also be used for other applications.
Further improvements to this method can be studied in a forthcoming work, for example the estimation of the impact of the phase contrast signal sampling, the impact of the flux variation vs the wavelength, the optimization of the phase mask parameters (depth and diameter) and the phase contrast signal normalisation.