## Abstract

Wavefront estimation using in-focus image data is critical to many applications. This data is invariant to a sign flip with complex conjugation of the complex amplitude in the pupil, making for a non-unique solution. Information from an in-focus image taken through a non-redundant pupil mask (NRM) can break this ambiguity, enabling the true aberration to be determined. We demonstrate this by priming a full pupil Gerchberg-Saxton phase retrieval with NRM fringe phase information. We apply our method to measure simulated aberrations on the segmented James Webb space telescope (JWST) mirror using full pupil and NRM data from its near infrared imager and slitless spectrograph (NIRISS).

© 2016 Optical Society of America

## 1. Introduction

Intensity data from far-field or in-focus imagery of a point source is often used to determine the aberration in an optical system. Sometimes the aberration is an engineering or calibration quantity, as in the case of the immediately post-launch *Hubble Space Telescope* (HST), and sometimes it is interesting of itself, as occurs in lensless X-ray microscopy. The Gerchberg-Saxton (GS) algorithm [1] iteratively accomplishes an estimation of phase from image intensity and a knowledge of the pupil geometry, and does typically converge, but it can seem to converge to a spurious solution that is a local minimum, or converge to either of the two ambiguous solutions that are global minima. The unconstrained GS algorithm can converge to either the true pupil field *P*(*x*) or its complex conjugate whose argument’s sign is reversed, *P*^{*} (−*x*) [2]. Breaking the two-fold ambiguity can be accomplished in different ways. A consideration of more data taken with added defocus (or other kinds of phase diversity) can result in obtaining the true aberration [3, 4]. Extra data in the form of pupil diversity can also be used to break the sign ambiguity of the phase. Our approach is included amongst the latter class of methods.

The GS phase retrieval method iteratively applies the known pupil transmission constraint in the pupil domain and the measured image intensity constraint in the image domain (e.g. [5]). Stepping from one domain to the other is accomplished by a Fourier transform of pupil plane or image plane complex amplitudes. In the special case where the aberration is *only* composed of functions where *P*(*x*) = *P*^{*}(−*x*) (such as purely tip/tilt or coma) the phase can be recovered unambiguously with the unconstrained GS algorithm In practice the algorithm can converge to a local minimum rather than the true pupil phase unless the initial guess at the pupil phase is in some heuristic sense fairly close to the correct value.

We describe a phase retrieval method that uses a pair of in-focus images, one taken with the full pupil and the other with a non-redundant mask (NRM) in the pupil. A NRM consists of a set of holes in a mask where no hole-to-hole vector is repeated (e.g., Fig. 1 (left)). Our approach can be backup method for fine wavefront sensing that may typically be required in order to maintain diffraction-limited 2 *μ*m image quality on the 6.5 m 18-segment infrared James Webb Space Telescope (JWST), especially during routine operation and later stages of commissioning. A flight-ready wavefront sensing scheme using JWST’s *Near Infrared Camera* (NIRCam) has already been developed and tested [7]. However, JWST’s Near Infrared Imager and Slitless Spectrograph (NIRISS) [8] using its two pupil masks, NRM and CLEARP [9] (see Fig. 1) can serve as a backup sensing method. We show that these two pupil masks can be used to measure the telescope’s aberrations without introducing focus diversity by sweeping the secondary mirror through focus or placing some of NIRCam’s three weak lenses in the beam.

Our backup method reduces mission risk since it provides a second instrument that can measure JWST’s wavefront. Using both NIRCam and NIRISS also provide wavefront measurements at different field points, which could assist with secondary mirror alignment when commissioning JWST. During routine astronomical observations a pair of images taken with the CLEARP and NRM pupil masks in one filter can provide a full wavefront measurement to interferometric accuracy. Such measurements could also support image deconvolution methods at all wavelengths in NIRISS, where all powered imaging optics are reflective. Using in-focus imagery and hardware optimized for science removes the need for dedicated wavefront sensing hardware, such as weak defocusing lenses, on future space telescopes. Our approach does not solve the persistent problem of non-common path wavefront aberrations in coronagraphs between the wavefront sensor and the focal plane mask [10], because we measure the wavefront at the science detector (rather than at the focal plane containing the coronagraphic occulter).

We quantify the method’s performance when faced with realistic limits of noise, size of the image (number of resolution elements), and wavefront error expected during certain commissioning phases of JWST. §2 motivates our approach and the design choices of our study. §3-4 show examples of how the algorithm performs under different conditions using both monochromatic and 8% bandwidth images, matching NIRISS’s F480M filter on a continuous circular pupil. In §5 we apply the algorithm to a JWST-like pupil with segment tip, tilt and focus aberrations, as well as global pupil aberrations. We discuss our results in §6 in the context of JWST mirror phasing.

## 2. Motivation and methods

We presume that disjoint segments of the pupil have already been brought to a common pointing, and to near a common focus. This places an upper bound on the sizes of piston and tilt differences over the pupil (given the optical quality of each segment). In addition, we assume that every segment in the pupil is well within the coherence length of the filter bandpass, so that the PSF is somewhat coherent. Reaching this coarsely-phased stage is possible using JWST’s NIRCam [7, 11, 12] or, as an alternative, with NIRISS and possibly MIRI [11, 12]. After the 18 segments of JWST’s primary mirror are coarsely phased we do not expect any phase wrapping if we only use NIRISS’ 4.3 *μ*m or 4.8 *μ*m wavelength filters. Our study focuses on the problem of measuring a wavefront aberration that does not exhibit phase wrapping, in order to explore algorithmic efficacy rather than address technical complications.

The GS algorithm iterates between pupil plane field *P*(*x*) and image plane field *E*_{image}(*k*), applying constraints in each domain before returning to the other (by means of a Fourier Transform, for example). For our image plane constraint we replace the image plane amplitude by the square-root of the image intensity. We constrain the pupil plane amplitude by forcing it to be the pupil support function. We modify initial iterations of the GS algorithm by applying additional constraints in the pupil plane over the regions of the holes in the NRM.

By analyzing a PSF taken through an *N* hole NRM we obtain *N*(*N* − 1)/2 *fringe phases*. Physically, a fringe phase is the piston component of the optical path delay (OPD) between two holes in the NRM. We use these fringe phases to calculate the piston over each hole in the NRM. This can be done uniquely by making the *N* pistons possess a zero mean.

We initialize the pupil phase over the mask holes to the NRM PSF-derived OPDs and assert zero phase in the pupil everywhere else. In each subsequent constrained iteration the pupil phase over the mask holes is replaced with the NRM-measured phase piston. Elsewhere in the pupil we use the phase provided by the GS iteration without interpolation. We then smooth the entire pupil phase by representing it with a small set of low-order polynomials.

This starts the GS iterations off closer to the true phase, which we show enables robust and rapid phase retrieval without the need for defocused images. Our pupil phase estimate approaches the true pupil phase in a just a few iterations, even when we applied 5% errors to measured piston phases.

During the initial constrained GS iterations the phase over the remainder of the pupil can drift towards a solution while maintaining agreement with the NRM image data in selected areas. The basic process is outlined in Fig. 2. After this initial rapid convergence, the NRM-measured pupil phase constraints are lifted, and the unconstrained GS method converges to the true phase in most of the cases we tested. Pathological cases where NRM-derived constraints do not contain any information on the pupil phase can be constructed (e.g., pure segment tilt with zero hole piston).

We chose to constrain the pupil phase by applying the average hole piston over the entirety of the mask hole locations rather than over smaller areas (or just a few points) in the pupil. If the region of replacement is too small it can add artificial high frequency signal in the reconstructed pupil. In general, unphysical high frequency (frequencies beyond the limit of the number of resolution elements in the image) phase will build up during this process, without smoothing. We smooth the pupil phase each iteration by representing it with the first 15 Zernike [13] or Hexike polynomials [14], depending on the shape of the pupil. Choosing an optimal set of basis functions that are better suited to the actual segment geometry (including obstructions) is beyond the scope of this study. For this study we add 5% error to zero mean pupil phases (radians) that would be measured from the NRM image in order to introduce some measurement error.

We used 250 pixels across our circular pupils, and up to 1024 pixels for complicated obstructed apertures. We have assumed the OPD over each segment (or the full circular pupil) only contains low spatial frequencies (compared to the Nyquist frequency of our pupil sampling), so we can represent the pupil phase over a segment with a few low order polynomials.

## 3. Monochromatic circular pupil

In this section we apply our constrained GS phase retrieval algorithm to a simple circular pupil to demonstrate the principle. Using a known input wavefront, constructed with a random realization of the first 10 Zernike polynomials, we simulate images at the NIRISS pixel scale of 64 mas using a 6.5m diameter pupil at 4.8*μ*m to match JWST-NIRISS’s F480M filter. NIRISS is Nyquist sampled at ~4*μ*m. Our images are slightly finer than Nyquist sampled. The technical complications of sub-Nyquist image sampling may be addressable using existing techniques [15]. Our goal is to measure this input wavefront. We apply our NRM phase constraint for the first 100 iterations and then remove the constraint, allowing the algorithm to run until it converges to a state where the solution is stable between consecutive iterations. We report two relevant quantities, the *true error* and the *convergence*. The *true error* is the difference between the actual zero-mean wavefront and the pupil phase estimate. We use the true error to evaluate the algorithm performance in this study. The *convergence* is the difference between pupil phase in consecutive iterations. The convergence criterion sets the stopping point of our iterations. We set our numerical convergence criterion to 10^{−6} radians difference between iteration *i* and *i* − 1. We chose this criterion to be smaller than the expected true error. In a practical situation, the size of the true error will have to be estimated beforehand with simulations, such as ours, and optical testing.

We damp each iteration, computing the pupil phase as 80% of the new solution and 20% of the solution from the previous iteration. We did not optimize the damping in this study. Finally we smooth our estimated pupil phase by representing it with the first 15 Zernike polynomials when using a circular pupil. In the case of hexagonal mirror segments we use equivalent 15 Hexike polynomials on each segment. The difference between iterations that decides the convergence condition is calculated inside a slightly undersized pupil to avoid any edge effects.

#### 3.1. Concept: phase retrieval with and without constrained GS (noiseless case)

We demonstrate the advantage of our constrained approach compared to pure GS phase retrieval using a noiseless image made from an unobstructed circular pupil. Figure 3 compares the constrained case (using NRM fringe phases) with the unconstrained Gerchberg-Saxton algorithm. The initial pupil has 0.62 radians rms of phase (~ 460 nm). We convert angular measure to a physical distance assuming a wavelength of 4.8 *μ*m, the central wavelength of the JWST filter we model. Figure 4 displays the true error and convergence for both the constrained and unconstrained cases. We refer to the true error as *residual wavefront* henceforth. In the unconstrained case the algorithm converges quickly (Fig. 4 blue solid line) but to the wrong solution – the true error increases over time (blue dotted line). The residual wavefront in this unconstrained case is 0.53 radians (~400 nm) rms phase, as seen in the rightmost panel of Fig. 3. In the constrained case the residual wavefront error falls quickly in just a few iterations. The final residual wavefront using the constrained GS algorithm has 0.1 radians (~76 nm) (middle panel of Fig. 3).

In some cases, after steadily decreasing, the true error between the measured wavefront and the true aberration, increases a small amount when the constraint is lifted and the algorithm is allowed to “relax,” as shown in the black dotted line in Fig. 4. The performance details are most likely due to our specific choices of damping and smoothing and we anticipate that improvements can be made in the practical implementation of this approach. For the remaining sections of this study we focus on the major limiting factors that will guide the observations necessary to measure the wavefront from in-focus images.

#### 3.2. Image size dependence

The reconstruction performance is ultimately limited by the size of the image used (in units of the resolution element *λ/D*). Roughly speaking, by limiting the measured spatial frequencies in the pupil, the image size governs how well we can correct the wavefront. This image size dependence applies only to the full pupil image, as the NRM image contributes only a guiding first estimate. In Fig. 5 we compare the residual error in the measured wavefront with the number of resolution elements in the PSF. We find that image sizes of ~ 25*λ/D* can be used to correct the wavefront with acceptably small residual wavefront error. For the remaining simulations in Sections 3 and 4 we used an image size of 128 pixels, which corresponds to ~50*λ/D*. Deep coadded exposures are likely to be needed for the required dynamic range. In many of the following cases the image size sets the floor for our wavefront sensing accuracy.

As described in Perrin et al. (2003), the direct correspondence between radial distance from the center of the PSF and the spatial frequency in the pupil plane is only true for Strehl ratios above about 90%, where the 1st order expansion of the PSF is a good representation. But for lower Strehl ratios the correspondence is only an approximation. Higher order PSF expansion terms show cause frequency mixing, so phase terms with a spatial frequency of eg. *M* cycles across the pupil can place speckles at harmonics located at 2*M*, 3*M*, … resolution elements from the core. Since we use images with Strehl ratios below 90%, we find image size limits our wavefront sensing precision.

In the presence of pupil obstructions (a single spider in Fig. 5) we still find acceptable, albeit slightly reduced performance; our accuracy improves with increasing image size. The larger obstruction limits the reconstruction accuracy most. We suspect that a different approach to smoothing each iteration may improve this performance. To mitigate the effects of pupil obstructions, in Section 5, where we simulate JWST-like segment gaps and spiders, we use larger image size of 524 pixels, approximately 70 *λ/D*.

#### 3.3. Capture range

In the noiseless case (using a 50*λ/D* image size) we can recover the wavefront with a standard deviation *σ* = 10^{−2} radians residual error between the true aberration and the estimated wavefront from our algorithm. Our input aberrations do not exceed 2*π* radians P-V wavefront error because we do not implement any phase unwrapping in this study. Figure 6 displays the residual between the reconstructed wavefront and the true aberration as a function of P-V wavefront error of the true aberration, indicating the region above 2*π* radians where phase wrapping occurs. Incorporating phase unwrapping procedures may improve performance in this region.

Other in-pupil approaches to wavefront sensing use an interferometric analysis with an asymmetric pupil [16] or the differential optical transfer function (dOTF) using a known pupil modification [17]. The dOTF approach is similar to ours in that it does not need to operate in closed control loop, and it also uses two in-focus images. However, it requires an additional hardware component or specific hardware capability to produce a small pupil obstruction. We discuss the operational differences between our approach and the dOTF method further in Section 6. Similar to our approach, the asymmetric pupil wavefront sensor (APWFS) can use existing science hardware in the case of JWST, but it works iteratively in closed loop. Our monochromatic case, where we have not applied phase unwrapping (e.g. Fig. 6), has similar capture range to APWFS.

Multiwavelength NRM data has been used to resolve phase wrapping ambiguity [11]. Since phase unwrapping is routinely used in successful Gerchberg-Saxton methods [4], combining these approaches may work well on continuous pupils. Phase unwrapping on segmented apertures raises some fundamental issues that are beyond the scope of this study. Multiwavelength imaging may help resolve some of these issues. The APWFS works only in the regime where the small angle approximation is valid; when the wavefront errors are larger than ~ 1 radians it breaks down [18]. Our approach does not use a small angle approximation. The APWFS operates in a closed control loop with wavefront correction, whereas our approach provides a wavefront estimate with just one set of images. We note that the APWFS measurement could be used to constrain the Gerchberg-Saxton algorithm instead of pistons derived from NRM fringes, so that our initially constrained approach can be used with other JWST instruments that do not contain an NRM.

#### 3.4. Photon noise and exposure time

Our procedure requires two exposures, one with the full pupil, one with the NRM. We can tolerate fewer counts in the NRM images since the fringe phases are only used to move the estimated pupil phase in the right direction during the first few iterations. Here we consider the necessary exposure time for the full pupil image in the presence of photon noise. We find that even in shallow full pupil exposures, we can reconstruct the wavefront to an accuracy of ~0.1 radians rms or better (compared to 0.62 radians rms in the initial aberrated pupil), as summarized in Fig. 7. The inset plot shows two examples at 10^{3} and 10^{7} photons. While the residual error is larger for an exposure of 10^{3} photons, the wavefront is recovered to ~0.04 radians. Beyond ~ 10^{5} photons we reach the reconstruction limit set by our 50 *λ*/D image size.

Shallow exposure images with the full pupil can be obtained quickly on bright sources with NIRISS. For example, a 7.5 magnitude star in NIRISS F480M filter will take of order seconds to reach 10^{7} photons. For the NRM images 10^{6} photons should be more than sufficient to achieve better than the 5% precision in pupil phases that we use in these simulations [19]. It will take seconds to reach 10^{6} photons on the same 7.5 magnitude star with the NRM.

## 4. Finite bandwith images matching NIRISS’s F480M filter

In reality, images will be chromatic and will contain other sources of noise, such as from pointing jitter. In this section we extend our analysis to polychromatic images matching the bandwidth of NIRISS’s 8% F480M filter. We consider constant transmission across the filter bandwidth centered at 4.8 *μ*m. We additionally add pointing jitter by convolving the PSF with a Gaussian of standard deviation *σ* = pointing jitter.

The algorithm reconstructs phase errors in the wavefront at the central wavelength. The chromatic effects of our 8% bandwidth images increase the threshold reconstruction error. Above ~0.15 *λ*/D, jitter is the larger source of error. We summarize these results in Fig. 8, and mark the region where the simulation is limited by other sources of error (image size and chromatic bandwidth). The inset plot shows an example of our results in the particular case of 0.25*λ/D* jitter and 10^{6} photons (data point indicated by a star marker). In our example, which has less than ideal conditions, we are able to recover the wavefront very well, with a residual wavefront error of < 0.1 radians rms. We investigated this effect up to about a full pixel of jitter, 0.5 *λ/D*, where performance is degraded, but still produces a residual wavefront error of ~ 0.3 radians rms.

The JWST pointing requirement is 7 mas rms [20], which is ~0.05 *λ/D* jitter at 4.8 *μ*m. In our illustrative example we find that our algorithm is limited by the PSF image size (128 pixels) when the jitter is less than ~ *λ/*8*D*. Up to about a quarter pixel of jitter is correctable to ~0.05 radians rms (or ~40 nm at the 4.8 *μ*m wavelength). If JWST’s pointing jitter remains at or below requirement, it will not be a limiting factor to this kind of wavefront reconstruction.

## 5. Correctable wavefront errors on the JWST segmented mirror

JWST mirror segments have seven actuators. These control the six solid body degrees of freedom as well as the segment radius of curvature [7]. Individual JWST mirror segments have been measured to have very small aberrations, and are designed to be stiff. The commissioning plan is to adjust segment radius of curvature only during fine phasing [21], so the range of radius of curvature actuation need only be of the order of ~ 100 nm at (~ 0.13 radians at 4.8*μ*m). Prior fine phasing, pupil aberrations (including global defocus) are expected to be dominated by misplaced primary mirror segments, and, during early commissioning, from a misaligned secondary.

In this section we consider piston, tilt and focus segment aberrations, errors which are expected from segment drifts between phasing. We apply our algorithm to images made with a pupil matching the JWST primary hexagonal segments and mirror obstructions. For this example we do not consider the central obstruction in the CLEARP pupil (Fig. 1 right). We use the Hexike polynomials implemented in WebbPSF [22, 23] for smoothing the measured wavefront each iteration. We do not assume anything about the particular set of Hexike terms present in the wavefront. In practice, it may be useful to limit smoothing modes to only piston, tip/tilt, and focus. In these test cases, we consider images that are sampled three times better than NIRISS’s F480M filter to focus on the algorithm performance for a segmented pupil rather than sampling effects. We use images of size 524 pixels (~ 74*λ/D*).

#### 5.1. Segment tilt

In the special case of pure, random segment tip/tilt with no segment piston or higher order aberrations, constraining the GS with NRM data (which measures hole piston) only supplies zero piston constraint over all holes. In our pure segment tilt test case the constrained GS did not recover all the segment tilts correctly. Because this is a special case, we address segment tilt separate from piston and defocus.

Once mixed with any other (symmetric) phase, NRM can break the GS ambiguity. When we added coma (a global aberration that often arises from secondary mirror misalignment) the wavefront was retrieved unambiguously (Fig. 9). We also mix tilt with segment piston and focus, and again recover the wavefront (Fig. 10).

#### 5.2. Combinations of segment piston, tilt and focus

In general we may expect a combination of segment-base wavefront errors, of which piston, tilt and focus are correctable. We split these into pure segement defocus and pure segment piston as a demonstration of correcting single even functions on the JWST segmented pupil. Both defocus and piston introduce nonzero fringe phases in the NRM image (since the NRM holes are smaller than the segments). In reality, piston error on a curved segment contributes other aberrations. We then mix segment piston, tilt, and focus errors (Fig. 10-bottom) and can reconstruct both the symmetric and antisymmetric wavefront error terms unambiguously. While the accuracy of wavefront retrieval is reduced at segment edges and obstructions, the general structure and the sign of the phase is preserved in the reconstruction. Fine tuning this procedure may manage segment edges and obstructions either with different smoothing function, or by incorporating a gain factor for known discontinuities.

#### 5.3. Secondary mirror misalignment

JWST wavefront sensing has been developed around using NIRCam. NIRCam uses specialized hardware to determine segment co-phasing, and large and small wavefront aberrations. All wavefront sensing is initially performed at one field point in NIRCam. This telescope phasing may result in a sub-optimal positioning of the secondary mirror due to a degenerate combination of certain primary and secondary misalignment modes that cannot be sensed at a single field point. In order improve the wavefront in other JWST instruments, wavefront sensing needs to be performed in the other imaging instruments, namely NIRISS and JWST’s Mid-Infrared Imager (MIRI). The most thoroughly tested approach to this Multi-Instrument Multi-Field (MIMF) wavefront sensing [24] involves sweeping through focus with a secondary mirror move and using a focus-diverse Miselle-Gerchberg-Saxton phase retrieval algorithm [1, 3]. Using our approach, we can accomplish an unambiguous wavefront measurement by combining NIRISS’ CLEARP and NRM pupil masks without invoking a secondary mirror move. This might enable a shorter commissioning period for JWST, since the secondary mirror focus sweep is a slow exercise.

A mixture of astigmatism and coma are likely to result from the secondary mirror misalignment. In NIRISS this aberration might be up to 200 nm in size. In Fig. 11 we show a simulated measurement of this kind of aberration using our method. From this single measurement we cannot determine where the aberrations are from (primary or secondary misalignments), but NIRISS can add an additional field point compared to NIRCam’s wavefront measurements. Multiple field points are required to determine the secondary misalignment without moving the secondary.

## 6. Discussion

Our constrained Gerchberg-Saxton approach to phase retrieval provides an efficient way to measure wavefront aberrations on current and future space telescopes using only in-focus images. The algorithm is suited to both continuous and segmented/obstructed pupils, though segment obstructions appear to limit the performance in our simple implementation. We use the first 15 Zernike or Hexike polynomial to smooth the wavefront in the pupil. We smooth over the full pupil in the case of a continuous pupil, and segment-wise in the case of the segmented pupil, using the appropriate set of polynomials. Alternative basis functions could handle different wavefront errors better. We ignore the edge effects of thin pupil obstructions. Mitigating the errors introduced by these effects may take more study.

In this paper we have discussed our wavefront retrieval approach primarily in the context of commissioning JWST, although the method could provide wavefront knowledge during JWST science observations (for example, to support image deconvolution). On JWST this work may help avoid some secondary mirror focus sweeps during the commissioning phase of the telescope. We have presented a proof of concept of our method; further optimization of the method can be tailored to individual cases.

On JWST, two in-focus exposures containing 10^{6} photons each (requiring exposure times of < 1s full pupil images and seconds in NRM images for a star of 7.5^{th} magnitude through the F480M filter) will provide enough signal to measure the wavefront errors of ~ 100 nm, even in the presence of jitter, finite bandwidth and limited image size. Chromatic smearing, and finite image size are larger sources of error than the anticipated pointing jitter of JWST. Our method can tolerate up to 16 mas of pointing jitter, which is twice as large as JWST’s required pointing accuracy. Frequent monitoring of mirror segment drift can be measured with our approach on NIRISS (which contains the 7-hole NRM used in this study) as a part of normal telescope operations. This provides a complimentary capability to trend wavefront stability over time in NIRISS alongside the main wavefront sensing monitoring program using NIRCam.

We have focused on using a non-redundant mask to break the phase degeneracy in the unconstrained GS algorithm. It may also be possible to accomplish this with a redundant pupil that possesses asymmetries, using the asymmetric pupil wavefront sensor (APWFS) method [16], which also uses in-focus images. The APWFS algorithm could be used on data from other JWST instruments, such as NIRCam or MIRI.

Our method has some key differences compared to the differential optical transfer function approach to wavefront sensing. The dOTF method similarly requires two in-focus images, one with a pupil modification, though the modification must be small. For JWST, Codona [17] suggests using small motions of the pupil wheel to block a portion of the pupil and achieve its required pupil diversity, which is not possible for MIRI’s rachet-mechanism filter wheel. Our constrained GS approach uses two standard filter settings on NIRISS. With the possibility of using APWFS measurements, a single image could suffice for doing constrained GS wavefront sensing with MIRI.

Using these methods for both monolithic and segmented future telescopes (such as the Wide Field Infrared Survey Telescope [25] or the High Definition Space Telescope [26]) can utilize science hardware for wavefront sensing, which has obvious benefits for weight, cost, complexity, and scope.

## Acknowledgments

We thank Marshall Perrin and Joseph Long for helpful discussions and support for WebbPSF software. We also thank an anonymous referee for helpful and scholarly comments. This work was supported by the National Science Foundation Graduate Research Fellow Grant No. DGE-123825, NASA APRA Grant NNX11AF74G, and the STScI Director’s Discretionary Research Fund. This research made use of Astropy, a community-developed core Python package for Astronomy [27].

## References and links

**1. **R. W. Gerchberg and W. O. Saxton, “A practical algorithm for the determination on phase from image and diffraction plane pictues,” Optik **35**, 237–246 (1972).

**2. **J. R. Fienup and C. C. Wackerman, “Phase-retrieval stagnation problems and solutions,” J. Opt. Soc. Am. A **3**, 1897–1907 (1986). [CrossRef]

**3. **D. L. Misell, “A method for the solution of the phase problem in electron microscopy,” J. Phys. D: Appl. Phys. **6**, L6–L9 (1973). [CrossRef]

**4. **J. E. Krist and C. J. Burrows, “Phase-retrieval analysis of pre-and post-repair Hubble Space Telescope images,” Appl. Opt. **34**, 4951–4964 (1995). [CrossRef] [PubMed]

**5. **J. R. Fienup, “Phase retrieval algorithms: a comparison,” Appl. Optics **21**, 2758–2769 (1982).

**6. **B. J. Bos, D. A. Kubalak, S. R. Antonille, R. G. Ohl, J. G. Hagopian, P. S. Davila, J. Sullivan, M. Sánchez, D. Sabatke, R. A. Woodruff, M. te Plate, C. Evans, V. Isbrucker, S. Somerstein, M. Wells, and S. Ronayette, “Cryogenic pupil alignment test architecture for the James Webb Space Telescope integrated science instrument module,” Proc. SPIE **7010**, 70103C (2008). [CrossRef]

**7. **D. S. Acton, T. Towell, J. Schwenker, J. Swensen, D. Shields, E. Sabatke, L. Klingemann, A. R. Contos, B. Bauer, K. Hansen, P. D. Atcheson, D. Redding, F. Shi, S. Basinger, B. Dean, and L. Burns, “Demonstration of the James Webb Space Telescope commissioning on the JWST testbed telescope,” Proc. SPIE **6265**, 62650R (2006). [CrossRef]

**8. **R. Doyon, J. B. Hutchings, M. Beaulieu, L. Albert, D. Lafrenière, C. Willott, D. Touahri, N. Rowlands, M. Maszkiewicz, A. W. Fullerton, K. Volk, A. R. Martel, P. Chayer, A. Sivaramakrishnan, R. Abraham, L. Ferrarese, R. Jayawardhana, D. Johnstone, M. Meyer, J. L. Pipher, and M. Sawicki, “The JWST Fine Guidance Sensor (FGS) and Near-Infrared Imager and Slitless Spectrograph (NIRISS),” Proc. SPIE **8442**, 84422R (2012). [CrossRef]

**9. **A. Sivaramakrishnan, P. G. Tuthill, M. J. Ireland, J. P. Lloyd, F. Martinache, R. Soummer, R. B. Makidon, R. Doyon, M. Beaulieu, and C. A. Beichman, “Planetary system and star formation science with non-redundant masking on JWST,” Proc. SPIE **7440**, 74400Y (2009). [CrossRef]

**10. **A. Sivaramakrishnan, R. Soummer, L. Pueyo, J. K. Wallace, and M. Shao, “Sensing phase aberrations behind Lyot coronagraphs,” Astrophys. J. **688**, 701–708 (2008). [CrossRef]

**11. **A. C. Cheetham, P. G. Tuthill, A. Sivaramakrishnan, and J. P. Lloyd, “Fizeau interferometric cophasing of segmented mirrors,” Opt. Express **20**, 29457 (2012). [CrossRef]

**12. **A. Cheetham, N. Cvetojevic, B. Norris, A. Sivaramakrishnan, and P. Tuthill, “Fizeau interferometric cophasing of segmented mirrors: experimental validation,” Opt. Express **22**, 12924 (2014). [CrossRef] [PubMed]

**13. **R. J. Noll, “Zernike polynomials and atmospheric turbulence,” J. Opt. Soc. Am. **66**, 207–211 (1976). [CrossRef]

**14. **R. Upton and B. Ellerbroek, “Gram-Schmidt orthogonalization of the Zernike polynomials on apertures of arbitrary shape,” Opt. Lett. **29**, 2840–2842 (2004). [CrossRef]

**15. **J. R. Fienup, “Phase retrieval for undersampled broadband images,” J. Opt. Soc. Am. A **16**, 1831–1837 (1999). [CrossRef]

**16. **F. Martinache, “The asymmetric pupil fourier wavefront sensor,” PASP **125**, 422–430 (2013). [CrossRef]

**17. **J. L. Codona and N. Doble, “James Webb Space Telescope segment phasing using differential optical transfer functions,” JATIS **1**, 029001 (2015).

**18. **B. Pope, N. Cvetojevic, A. Cheetham, F. Martinache, B. Norris, and P. Tuthill, “A demonstration of wavefront sensing and mirror phasing from the image domain,” MNRAS **440**, 125–133 (2014). [CrossRef]

**19. **A. Z. Greenbaum, L. Pueyo, A. Sivaramakrishnan, and S. Lacour, “An image-plane algorithm for JWST’s non-redundant aperture mask data,” Astrophys. J. **798**, 68 (2015). [CrossRef]

**20. **J. P. Gardner, J. C. Mather, M. Clampin, R. Doyon, M. A. Greenhouse, H. B. Hammel, J. B. Hutchings, P. Jakobsen, S. J. Lilly, K. S. Long, J. I. Lunine, M. J. McCaughrean, M. Mountain, J. Nella, G. H. Rieke, M. J. Rieke, H.-W. Rix, E. P. Smith, G. Sonneborn, M. Stiavelli, H. S. Stockman, R. A. Windhorst, and G. S. Wright, “The James Webb Space Telescope,” SSR **123**, 485–606 (2006). [CrossRef]

**21. **A. R. Contos, D. S. Acton, P. D. Atcheson, A. A. Barto, P. A. Lightsey, and D. M. Shields, “Aligning and maintaining the optics for the James Webb Space Telescope (JWST) on-orbit: the wavefront sensing and control concept of operations,” Proc. SPIE **6265**, 62650X (2006). [CrossRef]

**22. **M. D. Perrin, J. Long, A. Sivaramakrishnan, C.-P. Lajoie, E. Elliot, L. Pueyo, and L. Albert, “WebbPSF: James Webb Space Telescope PSF simulation tool,” Astrophysics Source Code Library (2015).

**23. **M. D. Perrin, A. Sivaramakrishnan, C.-P. Lajoie, E. Elliott, L. Pueyo, S. Ravindranath, and L. Albert, “Updated point spread function simulations for JWST with WebbPSF,” Proc. SPIE **9143**, 91433X (2014). [CrossRef]

**24. **D. S. Acton and J. S. Knight, “Multi-field alignment of the James Webb Space Telescope,” Proc. SPIE **8442**, 84423C (2012). [CrossRef]

**25. **D. Spergel, N. Gehrels, J. Breckinridge, M. Donahue, A. Dressler, B. S. Gaudi, T. Greene, O. Guyon, C. Hirata, J. Kalirai, N. J. Kasdin, W. Moos, S. Perlmutter, M. Postman, B. Rauscher, J. Rhodes, Y. Wang, D. Weinberg, J. Centrella, W. Traub, C. Baltay, J. Colbert, D. Bennett, A. Kiessling, B. Macintosh, J. Merten, M. Mortonson, M. Penny, E. Rozo, D. Savransky, K. Stapelfeldt, Y. Zu, C. Baker, E. Cheng, D. Content, J. Dooley, M. Foote, R. Goullioud, K. Grady, C. Jackson, J. Kruk, M. Levine, M. Melton, C. Peddie, J. Ruffa, and S. Shaklan, “Wide-Field InfraRed Survey Telescope-Astrophysics Focused Telescope Assets WFIRST-AFTA final report,” ArXiv e-prints (2013).

**26. **J. Dalcanton, S. Seager, S. Aigrain, S. Battel, N. Brandt, C. Conroy, L. Feinberg, S. Gezari, O. Guyon, W. Harris, C. Hirata, J. Mather, M. Postman, D. Redding, D. Schiminovich, H. P. Stahl, and J. Tumlinson, “From cosmic birth to living earths: the future of UVOIR space astronomy,” ArXiv e-prints (2015).

**27. **T. P. Robitaille, E. J. Tollerud, P. Greenfield, M. Droettboom, E. Bray, T. Aldcroft, M. Davis, A. Ginsburg, A. M. Price-Whelan, W. E. Kerzendorf, A. Conley, N. Crighton, K. Barbary, D. Muna, H. Ferguson, F. Grollier, M. M. Parikh, P. H. Nair, H. M. Unther, C. Deil, J. Woillez, S. Conseil, R. Kramer, J. E. H. Turner, L. Singer, R. Fox, B. A. Weaver, V. Zabalza, Z. I. Edwards, K. AzaleeBostroem, D. J. Burke, A. R. Casey, S. M. Crawford, N. Dencheva, J. Ely, T. Jenness, K. Labrie, P. L. Lim, F. Pierfederici, A. Pontzen, A. Ptak, B. Refsdal, M. Servillat, O. Streicher, and Astropy Collaboration, “Astropy: A community Python package for astronomy,” A&A **558**, A33 (2013). [CrossRef]