High-order myopic coronagraphic phase diversity (COFFEE) for wave-front control in high-contrast imaging systems

The estimation and compensation of quasi-static aberrations is mandatory to reach the ultimate performance of high-contrast imaging systems. COFFEE is a focal plane wave-front sensing method that consists in the extension of phase diversity to high-contrast imaging systems. Based on a Bayesian approach, it estimates the quasi-static aberrations from two focal plane images recorded from the scientific camera itself. In this paper, we present COFFEE's extension which allows an estimation of low and high order aberrations with nanometric precision for any coronagraphic device. The performance is evaluated by realistic simulations, performed in the SPHERE instrument framework. We develop a myopic estimation that allows us to take into account an imperfect knowledge on the used diversity phase. Lastly, we evaluate COFFEE's performance in a compensation process, to optimize the contrast on the detector, and show it allows one to reach the 10^-6 contrast required by SPHERE at a few resolution elements from the star. Notably, we present a non-linear energy minimization method which can be used to reach very high contrast levels (better than 10^-7 in a SPHERE-like context)


Introduction
Exoplanet imaging is one of the most challenging areas in today's astronomy. The observation of an extremely faint object (the planet) very close to a bright source (the host star) requires the use of an extreme adaptive optics (XAO) system coupled with a high-contrast imaging technique such as coronagraphy. The current generation of instruments dedicated to exoplanets direct imaging (SPHERE on the VLT [1], GPI on Gemini South [2], Subaru SCExAO [3] and Palomar P1640 [4]) aim at detecting massive gaseous planets 10 −6 to 10 −7 times fainter than their host star. In the future, high-contrast imaging instruments on ground based or space based telescopes will perform observation of Earth-like planets, 10 −9 to 10 −10 times fainter than their host star.
The ultimate limitation of a high-contrast imaging instrument lies in its quasi-static aberrations, which originate in imperfections of the optical system such as misalignment or optical surface polishing error. These aberrations, when unseen and thus uncorrected by the AO loop, create long-lived speckles on the detector plane [5], limiting the achievable contrast. Besides, unlike the signal which originates in the residual turbulence (averaged in a long exposure image), these speckles can easily be mistaken for a planet. Thus, to reach the ultimate performance of the imaging system, one must be able to compensate for these aberrations. To perform such a compensation, SPHERE relies on phase diversity [6] to reach a contrast of 10 −6 , whereas GPI relies on an interferometric approach [7] for an aimed contrast of 10 −7 on the detector.
Several techniques dedicated to this compensation have been proposed. Closed loop methods, which assume small aberrations ( [8][9][10][11][12]), estimate the electric field in the detector plane using at least three images. The technique proposed by Baudoz et al. [13] relies on a modification of the imaging system, but requires only one image. We note that this approach, based on the analysis of fringed speckles, requires a √ 2 oversampling of the coronagraphic images to properly sample the interference fringes. These techniques aim at minimizing the energy in a chosen area ("Dark Hole"), leading to a contrast optimization on the detector in a closed loop process.
The focal plane wave-front sensor we have proposed [14], called COFFEE (for COronagraphic Focal-plane wave-Front Estimation for Exoplanet detection), requires only two focalplane images to estimate the aberrations both upstream and downstream of the coronagraph without any modification of the coronagraphic imaging system or assuming small aberrations. In a previous study [15], we presented COFFEE's early performance and limitations, detailed below, as well as its sensitivity to a realistic experimental environment. In this paper, we present a high order extension of COFFEE and its performance evaluation in a compensation process, in the framework of the quasi-static aberration calibration of a ground-based instrument such as SPHERE. Section 2 presents the modifications that allows COFFEE to overcome its previous limitations [15], allowing an estimation of high order aberrations with nanometric precision for any coronagraphic device. Section 3 presents the noise sensitivity of this extended version of COFFEE using realistic SPHERE-like simulations. The choice of a suitable diversity phase to use is also discussed in this section. Knowing that in a real system, such a diversity phase will not be perfectly introduced, we present, in Section 4, an original approach, hereafter called "myopic", which significantly improves COFFEE's robustness to an imprecise knowledge of the diversity phase. Finally, in Section 5, we describe the different compensation processes which can be used with COFFEE. In particular, we present a method of energy minimization in the detector plane that allows the creation of a Dark Hole without any small aberration assumption. Unlike other energy minimization methods [8][9][10][11][12], the one we propose does not rely on the calibration of an interaction matrix, which is sensitive to the position of the coronagraphic image on the detector. This new dark hole method can thus be used on any high contrast instrument without a repetitive dedicated calibration step.
In the SPHERE baseline design, quasi-static aberrations are measured with conventional phase diversity [6] (no coronagraph), which is unable to sense high-order aberrations to a nanometric level. As a result, this high contrast imaging instrument performance will be limited by high-order phase aberrations and not by amplitude aberrations (amplitude variations in a pupil plane). Consequently, the latter are not considered in the simulations presented herein and are currently not estimated by COFFEE.

Aberrations estimation with COFFEE
COFFEE is based on an inverse problem approach: it estimates the aberrations both upstream and downstream of the coronagraph using two focal-plane images that differ from a known aberration. As described in [15], the two main error sources of the first version of COFFEE have been shown both by simulations and experimentally to be aliasing and modelling error. The former was due to the use of a Zernike basis and prevented COFFEE from estimating high order aberrations. Moreover, the estimation of these high order aberrations is mandatory to optimize the contrast in the detector far from the optical axis (between a few λ /D and 20 λ /D in the case of the SPHERE instrument).
The latter was originating in the image formation model used by COFFEE. The estimations were indeed performed using a perfect coronagraph model, and thus limited by a model error.
In practice, COFFEE's use was limited to the apodized Roddier & Roddier coronagraph.
In this Section, we present COFFEE's modifications that allows to get rid of these two limitations. Section 2.1 describes the modification of the maximum a posteriori (MAP) approach on which COFFEE is based, which includes a modification of the basis used for the aberration estimation, now composed of pupil indicator functions (pixels). Such a basis, used with a dedicated regularization metric described in Section 2.2, allows COFFEE to estimate high-order aberrations. Besides, thanks to the modification of the imaging model, described in Section 2.3, COFFEE is now able to perform the estimation for any coronagraphic device.

Criterion expression
Most of the notations of this article are coherent with [14,15]. We consider a coronagraphic imaging system made of four successive planes denoted by A (circular entrance pupil of diameter D u ), B (coronagraphic focal plane), C (Lyot Stop), and D (detector plane). The optical aberrations are considered as static and introduced in pupil planes A and C. The coronagraphic device is composed of a focal plane mask located in plane B and a Lyot Stop in plane C. No particular assumption is made on the pupil shape or intensity, which can be calibrated using data recorded from the instrument. We note that this model does not consider out of plane aberrations and the corresponding amplitude aberrations (which originate in Fresnel effect), but as said previously, we consider in this paper the case of a ground based instrument (such as SPHERE) limited by phase aberrations. COFFEE requires only two images i foc c and i div c recorded on the detector (plane D) that, as in phase diversity, differ from a known aberration φ div , to estimate aberrations both upstream (φ u ) and downstream (φ d ) of the coronagraph.
In this paper, we consider the case of the instrument calibration, assumed to be performed at high signal to noise ratio (SNR) value, with a monochromatic source, emitted from a singlemode laser fiber. Since the impact of the source finite size on the estimation is not significant on the aberrations estimation [15], we consider here that this calibration is performed with an unresolved object, and use the following imaging model : where α p is the incoming flux (p is for "foc" or "div"), h c the coronagraphic on axis "point spread function" (PSF) of the instrument (which is the response of a coronagraphic imaging system to a point source), h det the known detector PSF, n foc and n div are the measurement noises and comprise both detector and photon noises, β p is a unknown uniform background (offset), and ⋆ denotes the discrete convolution operation.
COFFEE is based on a maximum a posteriori (MAP) approach: it estimates the aberrations φ u and φ d as well as the fluxes α = [α foc , α div ], and the backgrounds β = [β foc , β div ] that maximize the posterior likelihood p(α, β , φ u , φ d |i foc c , i div c ) of the data. For practical issues, it is more convenient (and equivalent) to minimize the opposite of the logarithm of the posterior likelihood, or neg-log-likelihood which includes regularization terms R(φ u ) and R(φ d ) designed to enforce smoothness of the sought phases: where x 2 denotes the sum of squared pixel values of map x, σ foc n , and σ div n are the noise standard deviation maps of each image. The corresponding variances can be computed as a sum of the photon and detector noise variances. The former can be estimated as the image itself thresholded to positive values, and the latter can be calibrated prior to the estimation.
Any aberration φ is expanded on a basis {b m }. In [15], we showed that the use of a truncated Zernike basis for the reconstruction led to a strong aliasing error, let alone the inability to estimate high frequency aberrations. In this paper, the phase is expanded on pixel indicator functions in the pupil plane: φ = ∑ m φ m b m (with φ m the value of the m−th pixel in the pupil). Such a basis, used with the proper regularization metrics, will allow COFFEE to estimate high order aberrations and strongly reduce the aliasing error, as shown in the following.
The minimization of metric J(α, β , φ u , φ d ) of Eq. (3) is performed by means of a limited memory variable metric (BFGS) method ( [16, 17]), which is a fast quasi-Newton type minimization method. It uses the analytical expression of gradients ∂ J ∂ φ u , ∂ J ∂ φ d , ∂ J ∂ α and ∂ J ∂ β , which we have calculated, to estimate φ u , φ d , α and β (Implementation details can be found in Appendix A). Sauvage et al. [14] established that a suitable diversity phase φ div for COFFEE was a mix of defocus and astigmatism: φ div = a div 4 Z 4 + a div 5 Z 5 with a div 4 = a div 5 = 0.8 rad RMS, introduced upstream of the coronagraph. In this paper, such a diversity phase will be used for a start; the optimal phase diversity to be used with COFFEE will be discussed later.

Regularization metric
The use of a pixel basis for the phase reconstruction is required for COFFEE to estimate high order aberrations. However, this leads to a large number of unknowns, which in turn calls for a regularization metric in order to reduce the noise sensitivity. We chose a regularization metric that is based on the available a priori knowledge on the quasi-static aberrations. Indeed, they can be reasonably assumed to be Gaussian, homogeneous and thus endowed with a power spectral density (PSD) S φ k (where k stands for u (upstream) or d (downstream)), which is usually assumed to follow a power law: with ν the spatial frequency and φ k the mean of φ k . The regularization term R(φ k ) can thus be written as: where F represent the Fourier transform operation. In order to be able to cope with any pupil shape, we implement this metric in direct space rather than Fourier space as follows; for n=2 in Eq. (4), we obtain: And for n=4 in Eq. (4), Here, r denotes the pupil plane position which will be omitted in the following for the sake of simplicity. ∇ and ∆ represent the gradient and the Laplacian operators, respectively. The balance parameter µ k will be called "hyperparameter" hereafter. For both cases, derivatives ∇φ k and ∆φ k are computed as finite differences between neighboring points, and summations are limited to points whose computation requires only pixels inside the pupil. In this paper, we consider a PSD decrease as 1/ν 2 (n = 1 in Eq. (4)), which corresponds to a classical assumption for optical surface polishing errors, according to K. Dohlen et al.
[18], who measured and characterized the PSD of the SPHERE optical system. Additionally, identification between Eqs. (5) and (6) yields the analytic value of the hyperparameter µ k : in directions x and y, respectively. The fact that the hyperparameter is given by Eq. (8) stems from the assumption that the phase φ k is statistically homogeneous, and is whitened by the differentiation in Eq. (6) [19, 20]. One can notice that σ 2 ∇φ k can be analytically computed from S φ k and the phase variance σ 2 φ k . Thus, this regularization does not require any manual tuning.

Coronagraphic image formation model
To perform the minimization of criterion J in Eq. (3), the image formation model used by COFFEE (Eq. (1)) requires the expression of a coronagraphic PSF h c . Let r be the pupil plane position vector and γ the focal plane position vector. the entrance pupil function P u is such that: with Π the disk of unit radius, D u the entrance pupil diameter, and Φ a known apodization function. The electric field in the entrance pupil can be written as: The electric field in the detector plane Ψ D is obtained by propagating Ψ A through each plane of the coronagraphic imaging system: the signal is first focused on the coronagraphic focal plane mask M ; then, the electric field is propagated trough the Lyot Stop pupil P d (r) (P d (r) = Π (2r/D d ) with D d the Lyot Stop pupil diameter). The electric field in the detector plane Ψ D can thus be written as: where F −1 is the inverse Fourier transform operation. For the sake of simplicity, spatial variables r and γ will be omitted in the following. The coronagraphic PSF h c is the square modulus of Ψ D : In Eq. (12), M can easily be adapted to represent any coronagraphic device, allowing COF-FEE to be used with a broad class of high contrast imaging instruments.

Performance evaluation
This Section presents the performance of the new extension of COFFEE presented in Section 2. Section 3.1 gathers the different parameters used for these simulations. In Section 3.2, the impact of the noise on COFFEE's estimation is quantified, while the optimal phase diversity φ div to be used with COFFEE is studied in Section 3.3. Section 3.4 presents COFFEE's sensitivity to a difference between the prior assumed in the phase reconstruction and the true phase. These parameters have been chosen so that the following simulations are representative of the SPHERE instrument. The chosen coronagraph (ALC) is the one designed for the considered wavelength on SPHERE, and the apodization function used in the image formation model (Figure 1) is the one designed for this coronagraph. In this paper, we consider the case of a highcontrast imaging instrument calibration prior to the scientific observation, so a monochromatic source is considered. It is worth mentioning that COFFEE could easily be adapted to polychromatic images, although such a study is beyond the scope of this paper. Such an adaptation would require a modification of the image formation model (Eq. (1)), in which a polychromatic coronagraphic PSF would be computed from several monochromatic PSF for different wavelengths.

Parameters and criteria
In order to properly model the ALC coronagraph, the coronagraphic PSF h c (Eq. (12)) is computed using the method developed by R. Soummer et al. [21]. This approach allows an accurate numerical representation of Lyot-style coronagraphs by accurately sampling the coronagraphic For each simulation, coronagraphic images are computed from randomly generated aberrations φ u and φ d using the imaging model presented in Eqs (1) and (12). Using these two images, COFFEE performs the phase estimation by minimizing criterion J of Eq. (3).
In order to quantify the reconstruction accuracy, we define the reconstruction error ε k as the RMS value of φ k −φ k , where k is either u (upstream) or d (downstream), φ k is the simulated aberration andφ k its estimation made by COFFEE. In this Section, every reconstruction error value is an average value, computed from ten independent randomly generated phases to make sure that the result obtained is independent of the phase realization. The PSD S φ of each generated phase is such that S φ ∝ 1/ν 2 .

Noise propagation
The ultimate limitation of the estimation performed by COFFEE lies in the propagation of noise present in the images. As mentioned in Section 2.2, the use of a suitable regularization metric ensures the smoothness of the phase, limiting the propagation of the noise from the images to the estimated aberrations. In this Section, we first demonstrate that the analytic value of the regularization metric hyperparameter (see Section 2.2) is the one that gives the smallest reconstruction error. We consider here an incoming flux α = 10 7 photons and a read-out noise (RON) of standard deviation σ det = 5 e − . This value, slightly higher than the expected RON on a SPHERE-like system, is chosen to strengthen the impact of the hyperparameter value. Besides, photon noise is added in the simulated coronagraphic images. The hyperparameter is here such as µ k = χ/σ 2 ∇φ k , with χ ∈ [10 −3 ; 10 3 ]. A reconstruction error value is computed for each value of χ. Figure 2 shows that the analytic value of the hyperparameter (χ = 1) is the one that gives the smallest reconstruction error for both upstream and downstream aberrations. When the regularization metrics are under balanced (χ < 1), the prior information is not "strong" enough in the minimization to prevent noise propagation in the estimated aberrations. One can notice here that without a regularization metric (χ = 0), the reconstruction error would have been unacceptable. On the other hand, when the regularization metrics are over balanced (χ > 1), their impact is too strong, and prevents the estimation of the high frequency components of φ u and φ d . In the following, considering the result of this simulation, all the estimations performed by COFFEE will be done using the analytic value of the hyperparameter (χ = 1).
In Fig. 3, we present the evolution of the reconstruction errors with respect to the total incoming flux. As previously, photon noise and detector noise (σ det = 1 e − ) are added in the simulated images used by COFFEE to perform the estimation.
In Fig. 3, one can see that in a low flux regime, both reconstruction errors upstream and downstream reach a saturation level, which correspond to the WFE value, rather than becoming arbitrarily large. Such a behaviour originates in the regularization metric: in a low flux regime, the speckles that originate in aberrations upstream of the coronagraph, which are used by COFFEE to estimate the aberrations, can hardly be distinguished from the noise. The less these speckles are visible in the images, the less the corresponding aberrations can be estimated using COFFEE. The limit is reached when no speckles are visible : in such a case, the estimated phase tend to zero and the reconstruction error is equal to the WFE value. Notice that without regularization metric, the reconstruction errors would have been much stronger in a low flux regime, due to noise propagation (as presented in Figure 2, in the case of an under-balanced hyperparameter). When the flux increases, the reconstruction error evolution is proportional to 1/α, which correspond to a photon noise limited regime. For very high flux values (α > 10 9 photons), the upstream reconstruction error seems to reach another saturation level. We have shown that this saturation, slightly above 1 nm RMS can be attributed to numerical difficulties in the minimization due to the very high dynamic range of the noise variance in the criterion. If it were of practical interest, these difficulties could be solved to reach even better accuracies.
In this paper, we consider the case of a high-contrast imaging instrument calibration, performed off-line prior to the observation with a high SNR value. Thus, considering the noise propagation behaviour presented above, the following simulations will be performed with an incoming flux value α = 10 9 photons and a read-out noise (RON) of standard deviation σ det = 1 e − .

Choice of a diversity phase
This section aims at studying the sensitivity of COFFEE to the diversity phase φ div , which was until now a mix of defocus and astigmatism: φ div = a div (Z 4 + Z 5 ) with a div = 0.8 rad RMS (202 nm RMS at λ = 1589 nm), introduced upstream of the coronagraph. This choice has been made following Sauvage et al. [14], who demonstrated that for a perfect coronagraph model and low order aberrations, such a diversity phase allowed a suitable criterion shape for the minimization. Indeed, the use of this diversity phase instead of defocus alone enlarges the global minimum, leading to an easier criterion minimization. In this Section, we study the influence of the diversity phase on the reconstruction accuracy more thoroughly and for realistic high order aberrations and coronagraph.
In classical phase diversity (no coronagraph), the optimal diversity phase depends on several parameters such as the signal to noise ratio (SNR), the level of the aberrations and their PSD [22]. A theoretical work, based on the computation of the Cramer-Rao lower bound (following Lee et al. [23]) could be performed to determine an optimal diversity phase; however, such a study would assume that there are no local minima in the criterion. Since we know that such minima appears in the criterion when the diversity phase amplitude is small, we adopt, in this section, a more practical approach to determine a suitable diversity phase for an aberration estimation with nanometric precision.
We will consider different diversity phases: a diversity phase composed of defocus alone, φ div = a div Z 4 , and a diversity phase composed of a mix of defocus and astigmatism, φ div = a div (Z 4 + Z 5 ). For each diversity phase, the evolution of the reconstruction errors with the diversity phase amplitude a div value will be plotted for 3 different WFE u value upstream of the coronagraph.The parameters used in this simulation are gathered in Table 1. Figure 4 shows the evolution of both reconstruction errors upstream and downstream of the coronagraph with respect to the amplitude a div . Here, the reconstruction error is due to noise and to local minima, which are gradually removed when the diversity phase amplitude increases, leading to an improvement of the estimation accuracy. When the diversity phase amplitude a div is high enough, all local minima are removed. Then, the reconstruction error reaches a saturation level which correspond to the level of noise in the images.
One can notice that with a diversity composed of defocus and astigmatism, the reconstruction error decreases faster than in the case of a diversity composed of a defocus alone. In order to have ε u < 5 nm RMS, a div must be greater than 2×WFE u when the diversity is composed of defocus and astigmatism, and greater than 2.5×WFE u when it is composed of defocus alone.
This result confirms what has been shown in a simple case with a perfect coronagraph model [14]: a diversity phase composed of a mix of defocus and astigmatism enlarges the global minimum and pushes away local minima, making criterion J (Eq. (3)) easier to minimize, and thus allowing a more accurate estimation of the aberrations both upstream and downstream of the coronagraph.

Sensitivity to the a priori assumption accuracy
As mentioned in Section 2.2, the a priori assumption about the aberration PSD considered by COFFEE is derived from [18]. However, this assumption will not be exact for all optical surface; for instance, the PSD that correspond to the polishing error of the Very Large Telescope primary mirrors follow a 1/ν 3 power law, as demonstrated by Bordé and Traub [8].
In this section, the sensitivity of COFFEE to the validity of the assumed PSD is evaluated: using parameters listed in Table 1, coronagraphic images are computed with aberrations generated with three different power laws: 1/ν, 1/ν 2 and 1/ν 3 . Then, using these simulated images, COFFEE perform the aberration estimation assuming a PSD following a 1/ν 2 power law (as described in Section 2.2).
Aberration's PSD ε u ε d S φ k ∝ 1/ν 3.08 nm RMS 5.85 nm RMS S φ k ∝ 1/ν 2 2.28 nm RMS 4.09 nm RMS S φ k ∝ 1/ν 3 1.54 nm RMS 3.40 nm RMS Table 2. Comparison of COFFEE's estimation accuracy when the a priori knowledge on the aberration's PSD is not perfectly accurate. As previously, k stands for u (upstream) or Table 2 shows the results of this evaluation. One can see that COFFEE is not very sensitive to the a priori accuracy, since the reconstruction errors remain indeed small when the PSD assumed by COFFEE does not perfectly match the actual PSD.
When S φ k follows a 1/ν power law, we note a slight increase in the reconstruction error. We have checked that, as expected, this increase is due to very high frequencies in the phase which are over-regularized and thus not reconstructed. In the conditions of our simulations, these very high frequencies are actually beyond the spatial frequencies that the DM is able to control, so that in closed loop this HF error on the reconstructed phase would have no impact.
We note that when S φ k follow a 1/ν 3 power law, reconstruction errors are lower than when the correct 1/ν 2 power law is considered. Again, the reconstruction errors originate mostly in the estimation of the high frequency aberrations, which give birth to lower energy speckle than the low frequency aberrations. When the PSD follows a 1/ν 3 power law, the quantity of high frequencies decreases in the aberrations to estimate, leading to an improved reconstruction error.

Circumventing calibration errors of the diversity phase: the myopic approach
The value of the diversity phase φ div is one of the few inputs COFFEE needs to perform the phase estimation. Thus, an imprecise calibration of φ div will lead to an error on the estimated aberration. In the case of classical phase diversity, this error is the one that drives the total error budget [24]. In [15], we demonstrated that an error ε div on the knowledge of φ div was leading to a reconstruction error of about ε div /2 on both upstream and downstream estimated aberrations. Now that both aliasing and model errors have been tackled in COFFEE, the diversity calibration error would be the most important one in the error budget.
The most convenient way to introduce the diversity phase φ div on the instrument is to modify the reference slopes of the AO loop to introduce a calibrated aberration, as described in [15]. The accuracy of such a process is thus limited by the DM's ability to achieve a given shape, leading to an error ε DM div on the phase diversity φ DM div actually introduced. As this error will always be present on an AO system (thermal evolution of the DM, ageing of influence functions, inability to re-calibrate them regularly), we have adapted COFFEE to make it able to perform a joint estimation of an error on φ div . This approach, called hereafter "myopic estimation", consist in a slight modification of the criterion J to be minimized (Eq. (3)), in which an additional unknown parameter φ ε (called hereafter diversity error phase) is introduced: where φ cal div is the calibrated diversity phase: φ div = φ cal div + φ ε . R(φ ε ) is an optional regularization metric designed to enforce our knowledge that φ ε should be small and smooth. Using the gradient ∂ J ∂ φ ε (whose computation is trivial knowing ∂ J ∂ φ u ), COFFEE is able to perform a joint estimation of φ ε along with the previously estimated parameters α, β , φ u and φ d .
In this paper, the estimated phases φ u and φ d are expanded on a pixel basis, which allows the estimation of high-order aberrations. However, since the diversity phase is composed of low order aberration, one can expect that the error φ ε will be mainly composed of low order aberrations. Thus, in order to optimize COFFEE's performance, the estimation of φ ε has been implemented in two different ways: ⋄ φ ε can be expanded on a pixel basis if high-order patterns (such as dead actuators) are expected in the diversity error phase. In this case, the regularization metric R(φ ε ) used will have the same expression as R(φ u ), presented in Section 2.2. ⋄ If only low order aberrations are expected in φ ε , it can be expanded on a truncated Zernike basis, composed of a few Zernike modes (typically up to 5 if φ div is composed of defocus (Z 4 ) and astigmatism (Z 5 )). With this basis, which reduces the number of parameters to be estimated, no regularization metric dedicated to φ ε is needed.
We validate this myopic approach by a realistic simulation: using parameters gathered in Table 1, we simulate coronagraphic images, and consider that the diversity phase used for the simulation is not perfectly known in the estimation stage. The coronagraphic simulated diversity image is computed with a diversity φ div = φ cal div + φ ε , where φ ε = a ε (Z 4 + Z 5 ), considering that the amplitude of the phase diversity is not perfectly known. In this simulation, a ε = 0.04 rad RMS (10 nm RMS).
COFFEE's phase reconstruction is then performed using both simulated images considering that the diversity phase is equal to φ cal div , first without the myopic estimation, then with an estimation of φ ε expanded on pixel basis and on a truncated Zernike basis composed of 4 modes: tip, tilt (which allows an estimation of a differential tip-tilt between the two images), defocus and astigmatism. ε u ε d φ ε : no estimation 6.92 nm RMS 8.51 nm RMS φ ε : estimation on a pixel-wise map 2.55 nm RMS 5.45 nm RMS φ ε : estimation on 4 Zernike modes 2.64 nm RMS 4.16 nm RMS Table 3. Comparison of COFFEE estimation accuracy with and without myopic estimation of φ ε when the diversity phase is not perfectly known.
The reconstruction errors corresponding to each reconstruction are gathered in Table 3. One can clearly see here that the myopic estimation approach significantly improves the reconstruction accuracy, roughly by a factor 2, allowing an optimal use of COFFEE even when the diversity phase φ div is not perfectly known.
The usefulness of this myopic approach will be further illustrated in Section 5.2, where we show that the estimation of an error on the diversity phase allows us to improve the contrast on the detector plane in a compensation process.

Closed loop quasi-static aberration compensation using COFFEE
In this Section, we present COFFEE's performance in a closed loop compensation process. We consider here the case of the calibration of a SPHERE-like instrument. Two coronagraphic images are simulated using randomly generated aberrations, whose PSD follows a 1/ν 2 law. Then, using these two simulated coronagraphic images, the aberrations upstream φ u and φ d are estimated using COFFEE.
Once the phase reconstruction is performed, we modify the DM actuator voltages to compensate for the estimated aberrations and thus optimize the contrast in the detector plane. This compensation is performed using two different techniques: in Section 5.1, we use the conventional phase conjugation. In Section 5.2, we minimize the energy in a chosen area in order to optimize the contrast in the selected region of the detector plane. To perform such a compensation, we have developed a method dedicated to high-contrast imaging instruments that does not rely on any small aberration approximation. These simulations are performed using the parameters gathered in Tables 1 and 4 In order to perform a realistic simulation, we consider here that an error φ ε is made on the diversity phase: the coronagraphic diversity image is computed with a diversity phase φ sim div = φ div + φ ε . In this section, we consider that φ ε = a ε (Z 4 + Z 5 ), with a ε = 0.04 rad RMS (10 nm RMS). COFFEE estimates the aberrations considering that the calibrated diversity phase is equal to φ div , and jointly searches for the diversity phase error φ ε , as described in Section 4.

Phase conjugation
Conventional phase conjugation aims at compensating for the aberrations upstream of the coronagraph φ u in an iterative process. After its criterion minimization, COFFEE gives an estimation φ u . The aberrations upstream of the coronagraph at the iteration i + 1 are thus given by: where g is the gain of the iterative process (g = 0.5 in this simulation) andφ DM u is the aberration introduced by the DM in the entrance pupil plane. Such an aberration corresponds to the best representation ofφ u achievable by the deformable mirror. Let F be the DM's influence matrix and T its generalized inverse. The aberration introduced by the DM can be computed as follow: Figure 5 presents the result of the simulation of a compensation performed by phase conjugation after 5 iterations of the loop (the average computation time for one loop iteration is 2 minutes). On this figure, one can see that the aberration compensation performed using COF-FEE estimation allows a significant improvement in the coronagraphic images (figure 5, left). In particular, the average contrast plot (figure 5, right) shows that after compensation, the performance in the area controlled by the DM (±20λ /D) is very close to the one that would be obtained from a coronagraphic image computed without aberrations.
We note that the level of contrast reached after compensation presented in Fig. 5 exceeds the SPHERE instrument specification for off-line calibration, which relies on a phase estimation based on classical phase diversity (no coronagraph). In particular, classical phase diversity is not able to estimate high-order frequencies, and thus will not compensate for speckles located beyond 8λ /D. The use of COFFEE, which allows a compensation in the whole area controlled by the DM in the detector plane (as showed in Fig. 5), could thus improve the SPHERE instrument performance.

Creation of a Dark Hole on the detector
Speckle nulling iterative techniques aim at minimizing the energy in a chosen area of the detector in order to facilitate exoplanet detection in this area, called a "Dark Hole" (DH). To create this DH, the methods developed until now, which rely on a small aberration approximation, minimize the energy during an iterative process [8,9]. This process requires several iterations and is based on the knowledge of an interaction matrix between the detector plane and the DM pupil plane to create the Dark Hole on the detector.
Here, we propose a new method to minimize the energy that does not rely on any small aberration assumption, allowing us to deal with high amplitude phase aberrations such as the ones created by the DM dead actuators (which are currently part of the SPHERE instrument's limitations). Besides, this method takes into account both upstream and downstream aberrations. This compensation method, coupled with COFFEE would be particularly adapted to the calibration of a high-contrast imaging instrument.
Let us define the energy in the focal plane E DH in the DH as: With m, n the pixel position in the DH (for the sake of simplicity, these variables will be omitted in the following). α is the incoming flux and Ψ DH the electric field in the DH area which, using notations of Section 2.3, is given by: ψ represents the aberration introduced by the DM: ψ(v) = Fv, with v the set of voltages applied to the DM actuators. Thus, creating a DH on the detector means finding the set of voltages v DH that minimize the energy E DH (v), knowing the relation between the entrance pupil plane and the detector plane of the high contrast imaging system. Here, we minimize E DH (v) by means of the same optimization method as the one which was used by COFFEE to perform its estimation, which is a limited memory variable metric (BFGS) method [16,17]. Such an operation gives us the voltage v DH , and thus the aberration ψ(v DH ) to introduce using the DM to create the DH. Unlike others energy minimization methods, the one we propose here does not require an interaction matrix calibration between the detector plane and the DM pupil plane. In particular, using COFFEE, we are able to estimate the aberrations downstream of the coronagraph, and among them the coronagraphic PSF position on the detector, i.e. downstream tip-tilt. This estimation is then taken into account in our compensation method (Eqs (16) and (17)). Thus, variation in the aberrations downstream of the coronagraph will not require any particular action during the compensation process, since these variations will be estimated by COFFEE along with the aberrations upstream of the coronagraph.
As mentioned previously, COFFEE does not estimate amplitude aberrations. However, the compensation method described in this section can easily be adapted to take into account amplitude aberrations upstream of the coronagraph ξ , by modifying Eq. (17): With ξ the amplitude aberrations. Thus, provided these aberrations are known, amplitude aberrations does not limit the performance of the compensation method presented in this Section.
We now validate this new energy minimization method by simulation. It requires the knowledge of the aberrations upstream φ u and downstream φ d of the coronagraph, and of the incoming flux α. In this section, we use COFFEE to perform the estimation of these parameters, and then minimize the energy in order to create a DH in the detector plane. The energy E DH is minimized between 5 λ D and 20 λ D to create the Dark Hole in the right part of the focal plane. As in the phase conjugation case (Section 5.1), such a compensation is performed in an iterative process, where the aberrations upstream of the coronagraph at the iteration i + 1 are given by: As previously, we consider g = 0, 5 in this simulation. The result of this compensation after 5 iterations of the loop is presented in Fig. 6 (the average computation time for one loop iteration is 3 minutes). In the targeted area (between 5 λ D and 20 λ D ), this method allows a significant improvement: when the compensation is performed by conventional phase conjugation ( Figure 5), the average contrast in the same area is 7.2 10 −7 . The use of our new compensation method allow a contrast improvement by a factor 10 after compensation ( Figure 6, bottom left). Besides, the interest of the myopic approach is illustrated in Fig. 6 : when the closed loop process is performed without estimation of an error on the diversity phase, the performance decreases by a factor 2 (solid cyan line). If a very high contrast level is required, this compensation technique can thus be used instead of conventional phase conjugation to calibrate the instrument. Besides, in order to push down the dark hole floor, it is possible to narrow the energy minimization area, as mentioned by Bordé et al. [8].

Conclusion
In this paper, an extended version of our coronagraphic phase diversity, nicknamed COFFEE, has been presented. The use of a regularized pixel basis in the estimation allows COFFEE to estimate high order aberrations with nanometric precision (Section 2). Besides, thanks to a modification of the coronagraphic PSF used in the imaging model, COFFEE is no longer limited to a particular coronagraphic device. COFFEE's performance has been studied and discussed in Section 3, while Section 4 has described a so-called myopic extension of COFFEE, which consists in a joint estimation of an error on the diversity phase in order to improve COFFEE's accuracy in a real system, where the diversity phase is not perfectly known. Lastly, in Section 5, the achievable contrast optimization on a SPHERE-like system using COFFEE in a compensation process has been studied using realistic simulations. In the latter section, we have presented a new compensation method which minimizes the energy in a chosen area of the detector through a non-linear minimization, in order to reach higher level of contrast than those that can be obtained using phase conjugation.
The experimental validation of this high-order and myopic version of COFFEE is ongoing, and aims at demonstrating the ability of COFFEE to estimate both low and high order aberrations, and to compensate for them. Several perspectives are currently considered for this work. With an adaptation of the coronagraphic imaging model, COFFEE can be extended to work on ground-based, long exposure images with residual turbulence induced aberrations. Another perspective lies in optimization of the computation time required for the aberration estimation, possibly following I. Mocoeur et al. [25]. These two improvements will allow COFFEE to work on-line, in closed loop during the scientific exposure. A further perspective is to extend COFFEE to the estimation of amplitude aberrations, mandatory to reach the very high levels of contrast required for exo-earth imaging, in order to create a dark hole area on the detector using the method presented in this paper.