Spatial linear dark field control and holographic modal wavefront sensing with a vAPP coronagraph on MagAO-X

. The Magellan Extreme Adaptive Optics (MagAO-X) Instrument is an extreme AO system coming online at the end of 2019 that will be operating within the visible and near-IR. With state-of-the-art wavefront sensing and coronagraphy, MagAO-X will be optimized for high-contrast direct exoplanet imaging at challenging visible wavelengths, particularly H α . To enable high-contrast imaging, the instrument hosts a vector apodizing phase plate (vAPP) coronagraph. The vAPP creates a static region of high contrast next to the star that is referred to as a dark hole; on MagAO-X, the expected dark hole raw contrast is ∼ 4 × 10 − 6 . The ability to maintain this contrast during observations, however, is limited by the presence of non-common path aberrations (NCPA) and the resulting quasi-static speckles that remain unsensed and uncorrected by the primary AO system. These quasi-static speckles within the dark hole degrade the high contrast achieved by the vAPP and dominate the light from an exoplanet. The aim of our efforts here is to demonstrate two focal plane wavefront sensing (FPWFS) techniques for sensing NCPA and suppressing quasi-static speckles in the final focal plane. To sense NCPA to which the primary AO system is blind, the science image is used as a secondary wavefront sensor. With the vAPP, a static high-contrast dark hole is created on one side of the PSF, leaving the opposite side of the PSF unocculted. In this unobscured region, referred to as the bright field, the relationship between modulations in intensity and low-amplitude pupil plane phase aberrations can be approximated as linear. The bright field can therefore be used as a linear wavefront sensor to detect small NCPA and suppress quasi-static speckles. This technique, known as spatial linear dark field control (LDFC), can monitor the bright field for aberrations that will degrade the high-contrast dark hole. A second form of FPWFS, known as holographic modal wavefront sensing (hMWFS), is also employed with the vAPP. This technique uses hologram-generated PSFs in the science image to monitor the presence of low-order aberrations. With LDFC and the hMWFS, high contrast across the dark hole can be maintained over long observations, thereby allowing planet light to remain visible above the stellar noise over the course of observations on MagAO-X. Here, we present simulations and laboratory demonstrations of both spatial LDFC and the hMWFS with a vAPP coronagraph at the University of Arizona Extreme Wavefront Control Laboratory. We show both in simulation and in the lab that the hMWFS can be used to sense low-order aberrations and reduce the wavefront error (WFE) by a factor of 3 − 4 × . We also show in simulation that, in the presence of a temporally evolving pupil plane phase aberration with 27-nm root-mean-square (RMS) WFE, LDFC can reduce the WFE to 18-nm RMS, resulting in factor of 6 to 10 gain in contrast that is kept stable over time. This performance is also verified in the lab, showing that LDFC is capable of returning the dark hole to the average contrast expected under ideal lab conditions. These results demonstrate the power of the hMWFS and spatial LDFC to improve MagAO-X ’ s high-contrast imaging capabilities for direct exoplanet imaging. into the system and to apply the appropriate correction sensed by the focal plane wavefront sensor. Another OAP and an achromatic doublet then relay the pupil-DM conjugate plane to the vAPP mask, which is mounted on a translation stage to allow for easy mask selection. This final pupil plane is then brought to focus at the science detector by a single achromatic doublet.

Spatial linear dark field control and holographic modal wavefront sensing with a vAPP coronagraph on MagAO-X 1 Introduction One of the key challenges faced by exoplanet direct imaging is the high contrast ratio between the exoplanet and its host star. To detect light from the exoplanet above the stellar noise, this high contrast ratio must be overcome. This is done by suppressing light from the star over a selected region in the image plane to a level at which light from the exoplanet can be detected. On MagAO-X, this is achieved with the vector apodizing phase plate (vAPP) coronagraph. 1,2 The vAPP creates a static region of high contrast next to the star referred to as a dark hole. The dark hole generated by the MagAO-X vAPP has an average contrast of ∼4 × 10 −6 at a central wavelength of 656 nm (Hα); this is the diffraction-limited average expected contrast assuming no optical surface aberrations and no atmospheric turbulence. With this vAPP, MagAO-X has the potential to take the first high-contrast direct images of an exoplanet in reflected light. 3,4 Even with a coronagraph such as the vAPP, high-contrast imaging is still limited by the presence of atmospheric aberrations. On MagAO-X, these aberrations are dealt with using a state-ofthe-art adaptive optics (AO) system. The primary AO is comprised of a pyramid wavefront sensor (PyWFS), which drives a Boston Micromachines 2K deformable mirror (BMC 2K DM) at 3.6 kHz. 4 This system delivers high Strehl ratios ≥70% at Hα and high angular resolution performance from 14 to 30 mas. 4 However, as the PyWFS is non-common path with the science image, the AO performance is limited by non-common path aberrations (NCPA) that generate quasi-static speckles in the image plane. 5 These aberrations remain unsensed and uncorrected by the primary AO system and are the dominant source of error for high-contrast imaging systems. 6 To maintain the system's high-contrast imaging capabilities, the AO system must be made sensitive to these NCPA and quasi-static speckles. This is done by employing the science camera as a secondary WFS; such techniques are referred to as focal plane wavefront sensing (FPWFS). By using the science image as the WFS, small residual aberrations that limit the dark hole contrast can be detected. To realize the high contrast enabled by the vAPP, FPWFS is necessary.
The dark hole generated by the MagAO-X vAPP is a D-shaped region on one side of the PSF extending from 2 to 15 λ∕D. The opposite side of the PSF remains unocculted. In this region, referred to as the bright field, the relationship between modulations in intensity and low-amplitude pupil plane phase aberrations can be approximated as linear. 7,8 The bright field can therefore be used as a linear wavefront sensor to detect small NCPA and suppress quasi-static speckles. Due to PSF symmetry, this technique, known as spatial linear dark field control (LDFC), can monitor the bright field across high spatial frequencies and is therefore sensitive to aberrations that will limit the contrast within the dark hole. A second form of FPWFS, known as holographic modal wavefront sensing (hMWFS), is also employed with the vAPP. This technique uses hologram-generated PSFs encoded with a basis of Zernike polynomials to sense quasi-static speckles due to instrumental effects at small spatial separations. Sensitivity to low-order aberrations with the hMWFS allows for the maintenance of high Strehl and small inner working angle (IWA). The aim of our efforts here is to demonstrate the ability of the hMWFS and spatial LDFC to sense and correct quasi-static speckles behind a vAPP coronagraph in the presence of a temporally evolving phase aberration and thereby restore the contrast within the vAPP dark hole to the contrast level expected under ideal conditions. These results will inform our efforts to deploy both techniques on MagAO-X when it comes online at the end of 2019.
In this paper, we present a technical overview and simulation results of spatial LDFC and the hMWFS with a vAPP coronagraph as well as laboratory results from the University of Arizona Extreme Wavefront Control Laboratory. We provide an overview of vAPP design and operation in Sec. 2, and in Sec. 3, we present simulation and laboratory results of low-order wavefront sensing results with the hMWFS on MagAO-X. In Sec. 4, we move from the low-order control regime demonstrated in Sec. 3 to higher-order control enabled by spatial LDFC. We provide results of spatial LDFC's ability to restore the contrast within the dark hole to the contrast expected under ideal conditions in both simulation and in the laboratory. In Sec. 5, we conclude this paper with a summary of our results and the next steps for the hMWFS and spatial LDFC on MagAO-X.

vAPP Coronagraph at the UA Extreme Wavefront Control Lab
The vAPP on MagAO-X will be similar to the vAPP coronagraph currently in operation at the Magellan Clay Telescope on the existing MagAO system. 1,9 The vAPP is a pupil plane optic that takes unpolarized light from the astronomical source and creates two circularly polarized copies of the PSF, one with right-handed circular polarization, the other with left-handed. 10 The two PSFs are each imprinted with a 180-deg D-shaped dark hole on opposing sides oriented so that, when combined, the result is a 360-deg high-contrast region around the stellar PSF as seen in Fig. 1. Between the two polarized coronagraphic PSFs with dark holes is a copy of the precoronagraph system PSF with a peak intensity that is roughly 100× lower than that of the coronagraphic PSFs. This PSF is the result of an unpolarized leakage term that is not affected by the vAPP. Beyond the science PSFs, the vAPP also creates two sets of low-order hMWFS PSFs, with one set positively biased and one set negatively biased (Fig. 1). 11 These hMWFS PSFs are used for driving the low-order closed loop, and they can also be used for optical alignment adjustment. Both uses of the hMWFS are addressed in greater detail in Sec. 3. At the University of Arizona Extreme Wavefront Control Laboratory, the testbed hosts seven vAPP masks on a single testplate. Each mask differs by the outer working angle (OWA) of the dark hole and the hMWFS design. Of the seven masks, six are vAPPs, and of those six, four include an hMWFS with different modal basis sets. The seventh mask is a simple binary mask of the Magellan pupil with no phase pattern inscribed. Of the masks with hMWFS PSFs, one creates only phase diversity spots; one contains the first 12 Zernike polynomials; one Fig. 1 Simulation example of the science image delivered by a vAPP coronagraph. Shown here are the two circularly polarized coronagraphic science PSFs each with a 2 to 15 λ∕D dark hole with an average contrast of ∼10 −5 and a bright field opposite the dark hole. Between the two coronagraphic PSFs is a leakage PSF that is generated by unpolarized light leakage in the vAPP. Located farther out in the image are 12 hMWFS PSFs each encoded with a single low-order Zernike mode.
contains 20 Zernike modes that have been orthonormalized to the Magellan pupil; and one contains eight Zernike modes that have been orthonormalized to the Magellan pupil plus phase diversity spots. All of these masks and their resulting images can be seen in Fig. 2.
The testplate is aligned on the UA Extreme Wavefront Control Lab testbed in a relayed pupil plane conjugate to both a Magellan pupil mask and a BMC Kilo-DM (Fig. 3). The testbed pupil mask was designed to simulate the circular Magellan pupil in reflection. Due to the beam's 30 deg angle  The source injected into the system is a Fianium WhiteLase Micro Supercontinuum laser, which is limited by a bandpass filter to pass light only within a 10-nm bandwidth centered at the vAPP design wavelength of 660 nm. The entrance pupil of the system is defined by a reflective Magellan pupil mask designed with an elongation along the x -axis to match the beam footprint seen by the mask when angled at 30 deg with respect to the incoming beam. This pupil is relayed by OAPs mirrors to a conjugate pupil plane where the Boston Micromachines Kilo-DM is placed; the DM is used both to inject aberrations into the system and to apply the appropriate correction sensed by the focal plane wavefront sensor. Another OAP and an achromatic doublet then relay the pupil-DM conjugate plane to the vAPP mask, which is mounted on a translation stage to allow for easy mask selection. This final pupil plane is then brought to focus at the science detector by a single achromatic doublet.
Journal of Astronomical Telescopes, Instruments, and Systems 049004-3 Oct-Dec 2019 • Vol. 5 (4) of incidence with respect to the mask, the beam cross-section seen by the mask is a cross-section with a 1 cosð30 degÞ elongation along the x-axis. To match this elongated beam footprint, the mask was designed with the same ellipticity. After reflecting off the Magellan mask, the pupil is relayed to the DM, then to the vAPP testplate.
The different masks on the testplate were tested both in simulation and on the testbed with the intent to determine the regime over which the response of the hMWFS to an applied aberration was linear and the amount of crosstalk between modes. In both simulation and on the testbed, an aberration was injected into the system using the DM, and the calculated correction was applied using the same DM. To compare simulated results to testbed results, a model of the testbed was used in simulation, which included a scaled model of the BMC Kilo-DM to match the number of actuators across the DM and the elongated shape of the illuminated beam footprint on the testbed DM due to its angled position relative to the incoming beam. Further explanation of these tests and the results can be found in Secs. 3 and 4.
The hMWFS PSFs generated by the vAPP are created by encoding the pupil plane vAPP phase mask with the desired modal basis set. 2,11 Each hMWFS PSF corresponds to one mode. For example, the 12 Zernike hMWFS set seen in Fig. 1 is encoded with the 12 Zernikes seen in Fig. 4.
An example in simulation of the first three Zernike modes applied in the pupil and the corresponding hMWFS intensity change in the science image can be seen in Fig. 5.
A version of this hMWFS design containing Zernike modes was selected for the MagAO-X vAPP, and for this reason, the following work focuses solely on the results from this 12 Zernike hMWFS vAPP coronagraph and disregards the other designs on the testplate.

Coronagraphic Low-Order Wavefront
Sensing with an hMWFS As a low-order wavefront sensor implemented with a coronagraph, the hMWFS can be categorized as a form of coronagraphic low-order wavefront sensing (CLOWFS). CLOWFS is a well-established technique by which jitter, tip, tilt, and other common low-order aberrations, such as coma, astigmatism, and defocus, are sensed using starlight that has been rejected by the coronagraph. [12][13][14][15][16] Traditionally, the signal used to run CLOWFS in closed-loop has been stellar light rejected at either an intermediate focal plane or at the Lyot stop in a conjugate pupil plane (known more commonly as LLOWFS 12 ), which is then brought to focus at the wavefront sensor camera. With the vAPP coronagraph, the CLOWFS loop is run with the hMWFS PSFs in the science image plane.
To measure the response of hMWFS to each encoded mode and build the CLOWFS response matrix, each mode in the basis set is applied in the pupil using the DM, and the change in intensity of the hMWFS PSFs is recorded. The recorded response for each k'th mode is the normalized difference in intensity between the positively biased upper hMWFS mode (I kþ ) and the negatively biased lower hMWFS mode (I k− ) as 11 Each I k is recorded as a single column in the CLOWFS response matrix G. The control matrix is then obtained by the inversion of G. For a given pupil aberration and resulting aberrated image, the response of the hMWFS I ab is decomposed into a linear sum of all the modes in the hMWFS basis set by fitting I ab to the control matrix such that E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 2 ; 6 3 ; 2 4 6 a ¼ G −1 I ab ; (2) where a is the resulting vector of amplitudes corresponding to each base mode. For any wavefront sensor, it is important to understand over what range this measured response a of the wavefront sensor is linearly related to the amplitude of the input aberration.

Simulations of the hMWFS Performance
The first step in testing the Zernike hMWFS was the determination of the range over which the response of the hMWFS is linear or monotonic. This was done first in simulation using a model of the vAPP coronagraph, and a model of the BMC Kilo-DM in use in the UA Extreme Wavefront Control Lab. Using the DM, tip, tilt, and each of the 12 Zernike polynomials encoded in the hMWFS were applied in turn with an amplitude of 100 nm, and the normalized response of the hMWFS was recorded as detailed in Eqs. (1) and (2).
To determine the linear response of the hMWFS, each aberration was individually injected into the system with a series of amplitudes with maximum peak values ranging from −200 to þ200 nm with a step size of 22 nm between each amplitude. The amplitude response of all modes a in the basis set was measured for each k'th mode. The resulting linearity response curves for each aberration are shown in the plots in Fig. 6.
As can be seen in the above figure, each mode has a linear, or at least monotonic, response between AE100 nm (plotted in blue). The response of the other modes to the single applied mode, also referred to as crosstalk, between the modes is represented by the dashed black lines. It can be clearly seen that, within the linear response regime of each mode, the crosstalk between the other modes is either zero or small enough to be negligible. It is the combination of this monotonic range and negligible crosstalk between modes that has driven this hMWFS's selection for the MagAO-X instrument.
To ensure its performance in closed-loop, the Zernike hMWFS was also tested in simulation. One example presented here in Fig. 7 shows the injection of a pupil plane aberration with an initial root-mean-square (RMS) of 92 nm. Using the DM as the corrective element, the simulation converged to a residual wavefront error RMS of 27 nm after four iterations. The same tests were implemented in the lab as well, and the results are presented in the following section.

Laboratory Demonstration of the hMWFS
For a direct comparison with the tests performed in simulation, the same 12 Zernike hMWFS vAPP used in simulation was also used in the lab for testing. A side-by-side comparison of the science image seen in simulation and in the lab with the same vAPP is shown in Fig. 8. In the lab, the hMWFS response matrix was built using an applied amplitude of 100 nm for each mode.
To explore the linear and monotonic response range of the hMWFS, the same series of amplitudes used in simulation were applied to each mode in succession, and the intensity variation of each modal PSF was recorded along with the subsequent crosstalk between modes. These results are shown in Fig. 9. The response of each mode to itself is plotted in blue, and the crosstalk between the other modes is shown by the dashed black lines. It can be seen that the range over which the response of the hMWFS in the lab is monotonically increasing for each mode is approximately between AE100 nm. The range over which the response is linear is slightly lower than seen in simulated results shown in Fig. 6; however, the response is still monotonically increasing between AE100 nm. Note that the crosstalk between modes in the lab demonstration has increased from the simulation results. This is due both to noise and to slight misalignment in the optical path, which induces astigmatism and/or coma upon reflection off the off-axis parabolic (OAPs) mirrors. The aberrations resulting from misalignment were sensed by the hMWFS and are shown in Fig. 10, where the hMWFS response reveals the presence of defocus and oblique astigmatism.
Using the 12 Zernike hMWFS on the testbed as seen in Fig. 10, the presence of approximately −0.14 waves of defocus and oblique astigmatism was detected in the optical path due to misalignment. By applying þ0.14 waves of both aberrations on the DM, the system alignment was corrected. However, in doing so, some vertical and horizontal coma were also induced. This effect is due to the shifted position of the beam on the final OAP that occurs when applying astigmatism and defocus to the DM. This misalignment on the OAP is the source of the coma seen in the corrected image in Fig. 10. This interplay between astigmatism and coma is responsible for the greater crosstalk between modes seen in the lab results as compared to the expected modal crosstalk seen in simulation. In spite of the induced coma, the astigmatism and defocus alignment correction increased the Strehl of the science PSFs, which can be seen in Fig. 11 as an increase in PSF core definition in both the upper and lower PSFs.
Following alignment correction, the hMWFS was tested in closed-loop in the lab as it was in simulation. The DM was used to inject an aberration into the beam path, and the derived correction was applied using the same DM. Despite the increased crosstalk, the CLOWFS loop converged, and in the case shown in Fig. 12, the initial aberration with an RMS of 155 nm was reduced to a residual error with an RMS of 36 nm after five iterations.
On MagAO-X, the final focal plane, including the hMWFS, will be imaged onto EMCCD detectors. These detectors have very low noise and can be read out in arbitrary regions of interest (e.g., the hMWFS regions) at speeds up to several kHz. CLOWFS with the hMWFS will therefore not be limited by current technological capabilities. The speed required to run the hMWFS in closed-loop will be dependent on the temporal characteristics of the input noise.

Linear Dark Field Control with a vAPP
While CLOWFS controls low-order aberrations and maintains high Strehl, CLOWFS, by definition, is not capable of controlling higher-order aberrations that degrade the contrast within the dark hole. To sense higher-order aberrations and to maintain  It should be noted that the log 10 scales are not the same. This is due to degraded contrast in the lab limited by the surface quality of optical elements in the system. the contrast expected under ideal conditions, spatial LDFC 8 is employed. LDFC is a similar algorithm to CLOWFS in that it provides a relative wavefront error measurement rather than an absolute phase measurement such as electric field conjugation or similar speckle-nulling techniques. 17 As it does not provide an absolute phase measurement, LDFC cannot be used to dig a dark hole. Instead, spatial LDFC senses speckle-inducing aberrations by measuring the relative changes in intensity of the bright field within the same spatial frequency extent as the dark hole but on the opposite side of the stellar PSF as seen in Fig. 13. As the vAPP, unlike other coronagraphs, creates a static dark hole with a bright field on the opposing side of the stellar PSF, it is ideally suited for utilizing spatial LDFC for speckle suppression. Though LDFC is capable of monitoring low-order aberrations and maintaining high Strehl, it is efficient to offload this job to the hMWFS. LDFC is then left to monitor higher-order aberrations and maintain the dark hole contrast. In the bright field, speckles of a high enough magnitude respond linearly to aberrations in the pupil plane. 8 This monotonic response allows for closed-loop control of both the bright field and dark hole speckles induced by the same pupil plane aberration. To build this closed loop, rather than using low-order Zernike modes, higher-order modes derived from the influence functions of the DM are used as the modal basis set. These modes are chosen such that the spatial frequency content of the basis set matches the spatial extent of the dark hole. Fig. 11 Alignment correction using an hMWFS in the lab to sense aberrations due to misalignment. The dominant aberrations sensed, oblique astigmatism, and defocus were removed using the BMC 1K DM. The correction can be seen in the improved PSF core structure with a more defined first null around the core. Fig. 10 (a) The hMWFS response to misalignment on the UA Extreme Wavefront Control Lab testbed and (b) postalignment correction by the DM. These images were generated by subtracting the lower hMWFS spots from the upper hMWFS spots (after rotation to match their orientations) and normalizing the result by the maximum reference hMWFS PSF intensity. The two blue peaks reveal the presence of (1) defocus and (2) astigmatism. The amplitude of each was measured to be −0.2 rad, corresponding to approximately −0.14 waves of defocus and oblique astigmatism. (b) After correction by the DM, the 12 Zernike hMWFS shows the removal of the defocus and oblique astigmatism from the optical path but a slight increase in both vertical and horizontal coma (4 and 5). Some vertical secondary astigmatism (9) is also introduced that may be a result of the motion of the beam on the OAP.
Journal of Astronomical Telescopes, Instruments, and Systems 049004-9 Oct-Dec 2019 • Vol. 5 (4) For the following tests in both simulation and in the lab, these mirror modes are used to control the dark hole. Five of the midspatial frequency modes used in the lab are shown in Fig. 14. In this work, both in simulation and in the lab, the spatial extent of the dark hole is 2 to 15λ∕D. The control radius, however, is set by the number of illuminated actuators across the DM, which, in this case, is 22, thereby setting the greatest controllable spatial frequency to 11 λ∕D. The next two sections present closed-loop LDFC results, first in simulation, then validation of those results in the lab.

LDFC in Simulation
To simulate LDFC's performance in the presence of atmospheric turbulence, a temporally correlated random phase aberration was generated. The spatial power spectral density (PSD) of this aberration was set at 1 k 2 to generate higher spatial frequency content in order to form speckles at higher spatial frequencies across the dark hole and leave the PSF core unaffected. [Note: By not inducing low-order aberrations, these tests emulate running LDFC alongside CLOWFS, with the hMWFS sensing low-order aberrations and removing them with a woofer (low-order) DM; however, the hMWFS was not actually implemented in the following LDFC simulations.] The RMS WFE was set at the expected NCPA for MagAO-X of ∼27 nm. To  Fig. 14 A sample of five midspatial frequency mirror modes used to build the LDFC response matrix. As the mode number increases, so does the spatial frequency content of that mode. Each subsequent mode in the response matrix therefore probes higher spatial frequencies across the dark hole in the image plane.  model frozen flow atmospheric turbulence, the aberration was given a temporal PSD of 1 f 4 . 18 This aberration was applied in the entrance pupil of the simulated Magellan telescope and allowed to evolve over time. Simulating a loop speed of 1 kHz and assuming no lag, this simulated aberration created speckles with an average lifetime of ∼400 ms. Realistic photon noise was introduced in the image plane where the flux was set to be 6 × 10 9 photons∕s for a zero magnitude star, based on the expected flux at the science camera for MagAO-X.
To be sensitive to both even and odd modes, the science image was defocused as shown in Fig. 15 when used as the WFS, and both PSFs were used for wavefront sensing. The full response matrix was built by recording the intensity change across the image plane in response to the 400 modes chosen to match the controllable extent of the dark hole. To build the control matrix, the reference image was used to select only the bright pixels within the control radius of the DM. The response of these bright pixels was then used in the inversion of the response matrix to derive the control matrix.
Before implementing LDFC, the phase aberration was introduced into the simulated entrance pupil in open-loop without any correction by the DM, and the resulting speckle images were recorded. The loop was then restarted running LDFC implemented in closed-loop while introducing the same phase aberration in the entrance pupil. The LDFC-derived correction was applied with a model of the BMC 1 K DM in a pupil plane conjugated to the entrance pupil. The pupil and image plane data for a single iteration in closed-loop is shown in Fig. 16, where it is seen in Fig. 16(a) that the initial RMS WFE of ∼27 nm has been reduced to 18-nm RMS. This reduction in WFE results in a dark hole that has been returned to its best expected simulated contrast out to the control radius of the DM at 11 λ∕D as seen in Fig. 16(b).
To analyze LDFC's performance, the dark hole was binned by spatial frequency in successive hemispherical sections centered about the PSF core as shown in Fig. 17. Within these bins, the average contrast was measured for three scenarios: the openloop case in the presence of an evolving phase aberration with no correction, the closed-loop case in the presence of the same evolving aberration plus the LDFC-driven correction applied on the DM, and the ideal case with the best theoretical contrast that is delivered by the vAPP in simulation. The results of these three Journal of Astronomical Telescopes, Instruments, and Systems 049004-12 Oct-Dec 2019 • Vol. 5 (4) tests are shown in Fig. 18, which displays the convergence and stabilization of both the upper and lower dark holes over an evolving phase aberration with 1024 iterations. Figure 18 shows that, between 2 and 5 λ∕D, there is greater than a factor of 10 improvement in contrast between the open-loop and closed-loop contrast curves. The improvement decreases slightly between 5 and 8 λ∕D to approximately a factor of six improvement between open-loop and closed-loop contrasts. Between 8 and 11 λ∕D away from the PSF core, LDFC's performance begins to decline as the residual speckle intensity matches that of the aberration-induced speckles over certain intervals. This behavior is due to the proximity of this region to the control radius of the DM. With 22 actuators across the illuminated surface, the control radius for this simulation is set at 11 λ∕D. In the 9 to 10 λ∕D region, the system is beginning to reach this control radius, and the residual spatial frequencies that remain uncorrected by the DM begin to increase in amplitude. By 10 to 11 λ∕D, the uncorrected residuals create speckles of nearly the same magnitude as the initial aberration, and LDFC's correction shows nearly no improvement over the initial aberration. Once the control radius is reached at 11 to 12 λ∕D, the LDFC correction is worse than the input aberration. This occurs because the LDFC correction out to 11 λ∕D is throwing the light outside of the control radius by inducing residual wavefront errors with spatial frequencies greater than 11 λ∕D. From 11 λ∕D out to 15 λ∕D, the OWA of the dark hole, the LDFC correction is consistently worse than the initial aberrationinduced speckles because of this effect. As it is outside of the system's control radius, results for this region are not shown. Figure 19 shows the upper and lower dark holes at eight stages as LDFC converges, driving the dark hole back to the expected contrast obtained under ideal simulation conditions. The images are reference subtracted and masked to only show the dark holes to make the speckle formation and suppression more visible. The black line denotes the 11 λ∕D control radius beyond which the DM cannot control speckle formation. While LDFC suppresses speckle formation and stabilizes the contrast within the control radius, outside 11 λ∕D, speckles form due to the residual wavefront errors left uncorrected by the DM. It should also be noted that the lower dark hole images have been flipped left to right to match the orientation of the upper dark hole for aesthetic purposes.

LDFC Laboratory Demonstration
In the lab, the same vAPP mask was used as in the simulation presented in the previous section. To obtain the following results, two cameras were used: one with the science image at focus, and one at which 50% of the light sent to the science image was picked off by a dichroic beamsplitter and defocused. The second camera with the defocused image was used as the WFS sensor for the following work. The loop was closed with 200 modes. The response matrix was built by applying each mode on the DM with both a positive amplitude and negative amplitude and subtracting the resulting PSF images. The bright pixels that were unsaturated, above the noise floor threshold, and within the DM control radius, were selected for the response matrix; the average contrast of these pixels was ∼6 × 10 −2 . Unlike in simulation, where both PSFs were used for wavefront sensing, in the lab only the upper PSF was used. However, the correction derived from only one PSF still resulted in correction on both PSFs. As in simulation, the image Oct-Dec 2019 • Vol. 5 (4) was perturbed by a continuous series of aberrations injected onto the DM with 1 k 2 spatial frequency content and a temporal PSD given by 1 f 4 , thereby creating a temporally evolving phase aberration with high correlation resembling realistic atmospheric turbulence that generated speckles within the dark hole.
With 22 actuators illuminated across the DM, the applied aberrations created speckles out to 11 λ∕D. No aberrations were consequently created in the outer extent of the dark hole from 11 to 15 λ∕D, so the following plots display results only out to 11 λ∕D. To demonstrate LDFC's ability to stabilize the contrast within the dark hole, the temporally correlated series of phase aberrations was applied to the DM in open-loop and the resulting speckle images and speckle magnitudes were recorded. The same series of phase aberrations were then run again with LDFC in closed-loop. As in simulation, LDFC's performance was analyzed by spatial frequency in successive hemispherical bins centered about the PSF core, each with a width of 1 λ∕D (see Fig. 17). In Fig. 20, the average contrast for each 1 λ∕D bin is shown for three cases: open-loop with the temporally evolving phase aberration applied on the DM with no correction applied, closed-loop with the same temporally evolving aberration but with the LDFC-driven correction being applied on separate channel on the same DM, and the best expected contrast for each λ∕D bin that could be achieved in the lab without any aberrations being intentionally induced with the DM. It should be noted that, due to aberrations induced by other optical elements in the system (predominately low-order), the expected contrast obtained under ideal lab conditions varied across the dark hole, with the contrast at its worst near the PSF core. The average best contrast within the dark hole expected under ideal lab conditions was therefore reduced to 10 −3 . Due to this reduction in best expected contrast, the gain in contrast in each λ∕D bin was not as large the gains seen in simulation; however, the average contrast in each λ∕D bin still returned to the best contrast expected in ideal lab conditions. Between 4 and 5 λ∕D, there was factor of 2 improvement in contrast between the open-loop and closed-loop tests. The contrast improvement between 5 and 8 λ∕D was ∼1.5.
Another noteworthy feature is the stabilization of the LDFCcorrected contrast curve with respect to the open-loop contrast curve. Out to approximately 9 λ∕D, the LDFC correction remains stable without significant oscillation as seen in the open-loop contrast curve. The correction degenerates slightly after 9 λ∕D as the DM's control radius is reached. At this point, the LDFC correction is still an improvement in comparison to the aberrated contrast, but there is more variation in the corrected contrast. This is due to higher frequency residual errors that go unsensed or at least uncorrected by the DM, which throw speckles out toward the edge of the DM control radius. It will be noticed that, while the IWA of the coronagraph on the testbed is 2 λ∕D as it is in simulation, the exposure time required to image the speckles across the majority of the dark hole is high enough such that the PSF out to approximately 4 λ∕D saturates, and the information in that regime is not valid. The plots below therefore begin at 4 λ∕D instead of 2 λ∕D as they do in simulation. Figure 21 shows the upper and lower dark holes at eight stages as LDFC converges, driving the dark hole back to the expected contrast obtained under ideal lab conditions. As in simulation, the images are reference subtracted and masked to only show the dark holes to make the speckle formation and suppression more visible. The black line denotes the 11 λ∕D control radius beyond which the DM cannot control speckle formation. Since the DM was used both to suppress and create speckles in the lab, no speckles formed outside 11 λ∕D in the lab demonstration.
This data obtained in the lab validate our previous simulation results. We have shown here that spatial LDFC is capable of actively sensing and suppressing temporally evolving quasistatic speckles, thereby stabilizing high contrast within the dark hole. In conclusion, we have demonstrated that the postcoronagraphic science image from a vAPP can be utilized as an FPWFS to sense low-and high-order aberrations and return the contrast within the dark hole to the expected contrast obtained under ideal conditions. We have presented results from simulation and verified those results with lab data. By monitoring intensity variations in the Zernike hMWFS, low-order aberrations can be sensed in the science image and removed by the DM to increase the Strehl and maintain the IWA of the dark hole. In simulation, we showed that the hMWFS could sense a 92-nm RMS WFE low-order aberration and reduce it to 27-nm RMS. A lab demonstration with the hMWFS then showed that a low-order aberration with 155-nm RMS could be sensed and reduced to 36-nm RMS. The hMWFS can also be used for alignment purposes. This was demonstrated in the lab, where it was able to sense ∼0.14 waves of defocus and oblique astigmatism in the system due to optical misalignment, which was then compensated with the DM. In the case of higher-order phase aberrations, we have shown that speckles that degrade the contrast across the dark hole can be sensed by spatial LDFC. We have shown here in simulation that, given realistic flux values for a zero magnitude star being observed at Hα with the Magellan Telescope, LDFC can run at 1 kHz and sense an aberration with 27-nm RMS WFE (the expected residual WFE due to NCPA on MagAO-X) and reduce it to 18-nm RMS. This correction returns the dark hole to its best expected simulated contrast within the control radius of the DM. In analyzing LDFC's performance by spatial frequency, we have shown that, between 2 to 5 λ∕D, there was greater than a factor of 10 improvement in contrast between the open-loop and closed-loop average contrast. Between 5 and 8 λ∕D, there was approximately a factor of 6 improvement between openloop and closed-loop contrast. This gain in average contrast was maintained in the presence of a temporally evolving aberration. These results were also verified in a lab environment at the University of Arizona's Extreme Wavefront Control Lab, where the average best contrast within the dark hole expected under ideal lab conditions was reduced to 10 −3 . In the lab, we showed that, between 4 and 5 λ∕D, there was factor of 2 improvement in contrast between the open-loop and closed-loop tests. The contrast improvement between 5 and 8 λ∕D was ∼1.5. While not as large of a gain in contrast as seen in simulation, the average contrast in each λ∕D bin still returned to the best contrast expected in ideal lab conditions.
As an ExAO instrument operating in the visible and near-IR and hosting a vAPP coronagraph, MagAO-X will be optimized for high-contrast exoplanet imaging at visible wavelengths, thereby making it a uniquely suited platform for these new techniques. On MagAO-X, the light used by both CLOWFS and LDFC will be separated from the science channel by a binary mask, placed at an intermediate focal plane, which transmits the dark holes to the EMCCD science camera and reflects the stellar bright field back to a second EMCCD that will act as the dedicated FPWFS as shown in Fig. 22. This reflected light at the FPWFS camera will contain the hMWFS and the bright field used by LDFC. This bright field signal can then be used to run CLOWFS and LDFC simultaneously using different regions of the same image. By separating the bright field used for wavefront sensing from the much fainter dark holes, the two EMCCDs can be run at different speeds as needed to avoid saturation at the FPWFS camera while still maximizing SNR within the dark holes at the science camera. MagAO-X is scheduled to see first light in December 2019, and testing of LDFC and the hMWFS is included in the commissioning proposal for early 2020. By implementing these two new FPWFS techniques with its extreme AO system, MagAO-X will be capable of maintaining the Strehl and high contrast that will be required for the direct detection of an exoplanet in reflected light. MagAO-X, a binary mask will be placed at an intermediate focal plane that will pass only the dark holes and central leakage term to the EMCCD science camera. The rest of the image, including the hMWFS and the bright field opposite the dark holes, will be reflected back to a second EMCCD, which will operate as the designated focal plane wavefront sensor. 19 Journal of Astronomical Telescopes, Instruments, and Systems 049004-17 Oct-Dec 2019 • Vol. 5(4)