{'fraction_non_alphanumeric': 0.02498484568958701, 'fraction_numerical': 0.01291410800411143, 'mean_word_length': 4.862793572311496, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Starshade formation flying I: optical sensing

A key challenge for starshades is formation flying. To successfully image exoplanets, the telescope boresight and starshade must be aligned to ~1 m at separations of tens of thousands of kilometers. This challenge has two parts: first, the relative position of the starshade with respect to the telescope must be sensed; and second, sensor measurements must be combined with a control law to keep the two spacecraft aligned in the presence of gravitational and other disturbances. In this work, we present an optical sensing approach using a pupil imaging camera in a 2.4-m telescope that can measure the relative spacecraft bearing to a few centimeters in 1 s, much faster than any relevant dynamical disturbances. A companion paper will describe how this sensor can be combined with a control law to keep the two spacecraft aligned with minimal interruptions to science observations.


Introduction
Starshades, large occulters designed to artificially block starlight, offer a path to imaging and spectroscopy of Earth-like extrasolar planets. The carefully shaped petals of a starshade create a dark stellar eclipse over the entrance pupil of a space telescope by controlling diffraction so that starlight does not concentrate along the optical axis as in the "Arago spot" phenomenon. Current mission concepts envision 20-100 meter starshades positioned tens of thousands of kilometers in front of their respective space telescopes. 1,2 A key challenge in the starshade concept is formation flying, as the starshade shadow is only sufficiently dark in a region 1-2 meters wider than the pupil of the telescope. 1 With this sized shadow, the relative bearing, or "shear," between the starshade and telescope must be maintained to approximately one meter, despite the large distances between the spacecraft. 3 (The separation tolerance is far less stringent, at about 250 km). Formation flying has two components, sensing and control; sensing for determining the position of the starshade with respect to the telescope, and control for using the sensor data and onboard thrusters to efficiently maintain the required flight tolerances in the space environment. This paper will address the challenge of sensing, and a companion paper 4 will address the challenge of control.
A brief review of the mission concept is in order. The starshade is intended to work with a space telescope, and must be launched and deployed. The 20-30 meter optic is rolled up into a cylinder to fit in a rocket fairing, then launched into space. In space, it separates and unfurls, with petal shape tolerances of ∼100 µm and petal position tolerances of ∼1 mm being required. 5 Once unfurled, the starshade uses thrusters to maneuver itself between the target star and space telescope, with typical spacecraft separations of tens of thousands of kilometers. When aligned, science observations occur, after which the starshade moves to the next target star. These retargeting maneuvers can take days to weeks, as tens of degrees between target stars translate into slews of hundreds of thousands of kilometers.
The pointing and acquisition problem can be divided into three different regimes, which we refer to as coarse, medium, and fine. In the coarse and medium regime, the relative starshade position is determined through measurements of distance and angle. Distance can be determined by a time-of-flight S-band radio link between the spacecraft, with an accuracy of 500 meters, which is a negligible error given the 250 km range tolerance. In the coarse regime, at relative separations of less than 600 kilometers from target, a wide-angle (∼3 o ) laser beacon on the starshade can be used in conjunction with an external star camera. Here, the angles between the starshade (which may be identified as a blinking or uncatalogued point source) and a set of reference stars may be measured with a star tracker camera to better than 2 arcseconds, 6 corresponding to a shear accuracy of 400 meters for a typical separation of 40,000 km. A switch to the medium-sensing mode occurs once the angular separation from the target star is less than a few arcseconds. Here, the telescope's internal science camera is used to sense the starshade position, using the same concept of differential measurement of point-spread functions, but with a much finer accuracy of 20 milliarcseconds, or about 4 meters. This is maintained until the starshade begins to occult the star, at a separation of about 15 meters. At this point, the two point-spread functions are no longer well separated in the science camera, and a switch occurs to the fine-sensing mode. 2 The fine-sensing mode, for stationkeeping during science operations, uses an internal pupil imager of the telescope to determine the relative shear between it and the starshade. During stationkeeping, the relative bearing between the spacecraft and starshade must stay within the 1 meter deadband, with trajectory corrections required every ∼10 minutes to compensate for the µg differential gravitational force and solar radiation pressure. These corrections are accomplished through starshade thruster firings, which cause ballistic trajectories within the deadband. The overall speed of these maneuvers is fairly slow, with maximum velocities of ∼2 cm/s at the deadband boundary.

Optical sensing
The 1 meter stationkeeping demand on a starshade mission leads to sensing needs that are more stringent than 1 meter. A starshade technology maturation program called S5 8 defined the sensing requirements such that the 3-σ error signal would be less than 30 cm, for a ∼2.4 m telescope aperture. While no requirement on sensing cadence was given, the rate must be high enough as to permit control within the 1 meter deadband under the disturbances experienced in flight.
Starshades are designed to operate in the Fresnel regime, where the dimensionless "Fresnel number" F ∼ r 2 /(λZ) is in an intermediate regime of F > 10. Here r is the starshade radius, λ the wavelength, and Z the separation between the starshade and telescope, and optical propagation physics is preserved when the Fresnel number is the same. Spectroscopy of exoplanets requires rather broad wavelength coverage to measure different spectral features. Interesting molecular signatures exist from 400-800 nm, including from oxygen, ozone, and water, and in the case of the Earth, the "red edge" at 700nm pointing to the presence of vegetation. However, moving from 400-800 nm changes the Fresnel number by of a factor of two, which is challenging to accommodate in the optical design. This leads to the definition of "science bands" corresponding to different spectral regions, where the starshade must change its distance from the telescope, so that λZ ∼ constant. For example, in the case of the WFIRST starshade concept, the blue science band is from 400-600 nm, at a separation of about 40,000 km; the green from 600-800 nm, at separations of 30,000 km; and the red at 800-1000 nm, at separations of 20,000 km ( Figure 2). Starshade suppression rapidly degrades when operated outside of the designed science band (ibid). For example, for the green science band, the starlight suppression at 600 nm is nearly 10 7 times higher than at 500 nm, despite these wavelengths being only 100 nm apart. This bright "leaked" light must be blocked internally in the telescope using bandstop filters. Note that the starshade only suppresses the on-axis starlight. Off-axis planet light is unaffected.
It is this out-of-band stellar "leakage" that is actually key to sensing the shear. The starshade cannot effectively suppress light at these wavelengths, and it focuses behind the starshade as a bright core of light, similarly to the classical spot of Arago. At these intermediate distances and Fresnel numbers, the spot width is on the order of tens of centimeters, surrounded by a dark ring and and complex diffraction artifacts due to the petals ( Figure 3). While the light distribution does not meaningfully change with starshade distance deltas of hundreds of kilometers (the Fresnel number stays almost the same), it precisely tracks the shear offset of the starshade: if the starshade moves vertically by 25 cm, the pattern will move vertically by that same amount. Thus, the offset of the spot and surrounding light with respect to the center of the telescope pupil can be used to determine the shear between the starshade and the telescope.
In order to effectively sense this signal, some way of measuring the light distribution in the pupil of the telescope is needed. (Analyzing this light in the focal plane is much less effective, as shear changes lead to only subtle differences in the point-spread function.) Pupil sensors, which directly image this light distribution, are not common in space telescopes, as they either require a movable optic to shift the focus to the position of the pupil, or a separate camera. However, they are critical elements in high contrast imaging systems, where they can be combined with interferometric elements or lenslets to directly sense internal wavefront aberrations, which can then be corrected by deformable mirrors. Typically, the pupil is imaged onto a small-format detector, for high readout speeds. A familiar example of a pupil sensor is the Shack-Hartmann wavefront sensor.
Previous work has examined the viability of optical sensing to determine the shear of the starshade with respect to the telescope. Noecker 2007 9 reviewed some potential methods of sensing the relative shear, and introduced the concept of using pupil sensing using a set of outrigger telescopes on "booms" to measure the relative gradient of light. A similar implementation was proposed in Sirbu 2011, 10 which had an internal infrared octant sensor to provide the sensing information. Harness and Cash 2015 developed an analytic method of centroiding using pupil plane images that is similar to the method proposed in this work. 11 Image plane sensing is also possible; Scharf et al. 2016 7 presented a method using the science camera, by using difference images of the starshade (and its laser beacon) and target star. Image plane sensing is more challenging to implement, given the small angles involved, and has an expected measurement precisions of 1 meter (3-σ). (ibid) It is not able to reach the performance of pupil-plane schemes. The work presented in this paper builds on the previous developments, with the goal of characterizing the precision of pupil plane sensing with realistic inputs for the radiometric error budget, assuming a WFIRST-sized telescope and the pupil camera approach of Harness and Cash. We present analytic calculations and detailed numerical simulations of the expected sensing performance and validate them against laboratory experiments performed at similar Fresnel numbers and signal-to-noise ratios. Unlike the analytic spot centroiding algorithm of Harness and Cash, we develop a sensing algorithm that is based on image matching, where the data from the pupil camera is compared against a library of pre-computed pupil images corresponding to different starshade offsets; see Figure 3. This is a brute-force algorithm, but is tractable given the minimal degrees of freedom in the problem (just two, the offset in the horizontal and vertical direction). This is essentially equivalent to matched filtering, and as such, should be optimal, with uncertainties in position driven by photon and detector noise, and not imperfections in the matching algorithm.
While the algorithm appears to be easily manageable on a flight computer, simpler algorithms (such as gradient-based centroiding) could be developed that have a much lower memory footprint and faster speed.
Portions of the text below (particularly describing experimental setup and design) are repeated verbatim from a previous conference proceeding 12 and the technical report from NASA's S5 program describing the formation flying milestone. 13

Radiometry
The amount of photons detected by the pupil sensor depends on the star brightness, the starshade suppression, the internal optical efficiency of the telescope optics up to the sensor, and the detector quantum efficiency. All of these terms have a dependence on wavelength, of course.

Stellar input flux
For the stellar models, we used a solar type model from the ATLAS9 library 14 (T eff =5750K, log[g] = 4.5, [Fe/H]=0). We validated the stellar spectrum code against a standard measured solar irradiance spectrum (ASTM E-490), finding agreement in spectral flux density at the few percent level from 300-1000 nm. Validation against filter photometric zeropoints also agreed to within a few percent. The stellar spectral type is a minor contributor to the photon budget, as this causes variations in flux by at most a factor of ∼3 for stars of the same M V at any of the relevant wavelengths.
The main contributor to the stellar photon budget is the apparent magnitudes of the target stars, which range from M V =-1.5 to 5.3, a factor of about 500.

Starshade optical transmission
The starshade optical transmission plays the largest role in the overall photon budget, as it varies by six to seven orders of magnitude between the science bands (deep suppression at 10 −10 ) and in the sensing bands (10 −3 to 10 −4 ), with a steep transition with wavelength of C ∝ λ x , where x∼15, as shown in Figure 2. Starshade optical models have been validated at better than the 10 −10 level in laboratory demonstrations (Harness et al., in prep). In this work, we are primarily interested in the performance at 10 −3 to 10 −4 , where optical modeling uncertainties are negligible. In the case of starshade operations with the WFIRST coronagraph, the optical train does not use any of the complex masks or stops that make the coronagraph so effective at suppressing starlight.

Telescope efficiency
These are simply moved out of the way, leading to a much higher throughput on the science and spectrograph cameras. The deformable mirrors and other adaptive optics are also not actively controlled, but set to predetermined "flat" setpoints. 3 There are about 20 optical surfaces between the telescope pupil and the pupil sensor ( Figure 4), which is not uncommon for a coronagraph, but leads to throughput losses compared to a purpose-built pupil imaging camera. Additionally, while it has not yet been decided what kind of filter (if any) will be present in front of the pupil camera (the low-order wavefront sensor, or LOWFS) for starshade operations, we chose to limit the spectra to broad bandpasses that corresponded to the peak out-of-band light for the different science modes (see Figure 2). These correspond to 400-540 nm for the red band, 400-435 for the green, and 870-900 for the blue. Operating much outside than these bandwidths will not have a large effect, as the starshade suppression increases dramatically with wavelength.
To compute the total efficiency to the LOWFS camera, we combined transmission curves of the individual optical elements from the WFIRST coronagraph optical design (Hong Tang, priv. comm.), and the camera quantum efficiency from the manufacturer data sheet (CCD201 from Teledyne e2V). 16 Figure 5 shows the resulting curves, with the total efficiency not exceeding 50% anywhere in the relevant bandpass. The wavelength cutoffs are set by aluminum and silver reflectance at the blue end and detector quantum efficiency at the red end. While the optical design is not finalized, it is not the driving factor for sensing performance, as we will show that changes in throughput of a factor of two will not preclude accurate sensing.

Analytic calculations
It is possible to get a rough estimate of the sensing performance using simple scaling arguments, in particular the "centroid accuracy" formula, where σ x is the spot centroid accuracy (1σ), FWHM is the spot full-width at half maximum, SNR is the spot signal-to-noise ratio, and c is a constant of order unity that depends on the exact morphology of the PSF. This formula is used in astrometry, 17,18 with a value of c = 2 being appropriate for Gaussian or Moffat-like stellar profiles.
We calculate the width of the Arago spot FWHM for the numerator using an analytic approach assuming the starshade is circular (the petals suppress contrast, but have a minor effect on spot size). In this case, the intensity distribution near the optical axis has a functional form of where x, y are the coordinates at the pupil of the telescope; J 0 refers to the zeroth Bessel function of the first kind; and r, λ, z are the radius of the starshade, wavelength of light, and distance from the starshade to the telescope. The FWHM of this distribution is: What remains to evaluate in Equation 1 is the signal-to-noise ratio. For the SNR, we use the "CCD formula," where N ph is the number of photons in the spot, n ap is the number of pixels in covered by the spot, and RN is the readout noise per pixel, conservatively assumed to be 5 electrons. This assumes readout noise and photon noise dominate the error budget, neglecting terms relating to dark current and sky background, which are not large with the baselined EMCCD detector (the e2v CCD201) in a space environment. For the number of photons in the spot N ph , we assume all the photons at the pupil (multiplied by the system efficiency) end up in a spot with a FWHM given by Equation 3, rather than computing the numerical diffraction pattern and considering the pupil obscurations and numerical propagation through the telescope optics. Figure 6 shows the results of the analytic predictions. For typical target star brightnesses of M V < 6, the predicted accuracy in one second of exposure time is better than 3 cm in all science This is a simple approximation of the achievable precision, considering only the starshade size, the telescope efficiency, and the detector sampling and noise. However, it gives a useful estimate of the performance which may be expected, and the scaling. As we will later show, it agrees well with the numerical results, supporting the validity of the more detailed simulations.

Numerical Simulations
The analytic estimates of performance did not refer to a particular centroiding algorithm, but considered theoretical limits based on spot size and signal-to-noise ratio. The true images will not be simple spots, but will have extra structure, particularly when considering pupil obscurations. A spot centroid algorithm works best with an unobscured spot, and would potentially fail if the spot exited the pupil area or was blocked by the secondary mirror. These shortcomings can be fixed in principle, but this leads to a second issue, which is that any centroid algorithm will add some error to the spot position beyond the fundamental limits imposed by spot shape and photon noise. We adopted a different approach that would avoid these obscuration and visibility issues, with minimal error added by the algorithm, as will be described below.
We constructed detailed numerical simulations to create accurate models of the images seen on the pupil camera, and to estimate the sensing performance. These simulations used electric field propagation from the starshade through the telescope optics. First, the electric field of the starshade was calculated using the boundary integral method of Cady 2012. 19 The electric field was then 1) shifted to account for the input offset positions, 2) multiplied by the telescope pupil aperture function to add the central obscuration, outer diameter and spiders, 3) propagated to the internal Zernike sensor plane, 4) multiplied by the Zernike phase function, 5) propagated to the low-order wavefront sensor camera, and 6) converted to an intensity. We used Fourier transforms to propagate between focal and pupil planes, and performed all propagations using the intensity-weighted wavelength, reasonable given the limited sensing bandwidth. This procedure was repeated on a 2 cm grid to build up the image library.
The Zernike sensor, an interferometric pupil phase sensor in the coronagraph, is only useful for low-order wavefront sensing. For shear sensing, it serves no useful function. Its effect on the shear signal is to create mild intensity gradients over the image, and actually diffract a good deal (10-20%) of light outside the pupil imager, similar to a coronagraph. The reason we included it is that it reduces the flux, making it a more conservative assumption, and it is expected to exist in the system in a baseline configuration. In practice, it would be possible to use the Zernike sensor to sense tip/tilt separately from shear, but this is beyond the scope of this work. Adding telescope tip/tilt jitter to the simulations had less than a 10% effect on the sensing precision, but increased computation times signficantly, so we neglected to include it. We also ignored motion blur from the starshade, for two reasons. First, the maximum speed of 2 cm/s will contribute at most 2 cm of sensing error for a 1 second exposure time, which is well below the required sensitivity.
Furthermore, actual target stars are so bright that the exposure times will be much less than one second, so minimal motion blur will occur.
Here we introduce the particular algorithm to determine the shear offset (for a full description of the algorithm, including storage requirements and computational complexity, see the Appendix).
Rather than using a spot centroid algorithm, we use a least-squares image matching procedure equivalent to a matched filter, which should minimally contribute to the derived uncertainty in position. Each input image I is converted into a vector of n pixels (for example, n is 1024 for a 32x32 image), is normalized by the sum of the image intensities I m = I/ n I and the scalar see Figure 8). At each grid point, we used the same method to propagate the electric field through the starshade and telescope optics, but reduced the amplitude of the electric field to account for stellar magnitude and optical efficiency. We generated 300 such realizations per point, added Poisson and readout noise, then matched them to the image library, saving the best-fit positions. From these matches, we generated empirical 1, 2, and 3-sigma error ellipses, shown in Figure 7. The results of the numerical simulations are consistent with the earlier analytic estimates, with errors of a few centimeters being predicted at all science bands, with exposure times of 1 second, for stars of 8th to 10th magnitude ( Table 1). The largest discrepancy was the blue science band, with detailed numerical simulations being about 50% worse than the analytic prediction. In the blue science band, the guiding spot (in the near infrared) has the largest size (Eq. 3), so that it is always partially obscured by the telescope's secondary mirror and supports. This can be incorporated into the analytic estimate by modified, spatially dependent values for the shape parameter c.
However, we used a fixed c = 2 for an unobscured spot, so it is not surprising that the formula tends to predict better performance than the numerical simulations.
To understand the shapes of the ellipses, we might expect that at each position, the precision will depend on the second derivative of the light intensity. Constant intensity distributions will give no information as they are translation invariant. Similarly, linearly increasing distributions will give no information due to the normalization by total flux. However, higher orders will. 4 .
Said another way, the covariance matrix of the error ellipse will be inversely proportional to the Hessian of the light intensity. This becomes more evident when plotting the sensing precision over a larger region, where there are both smooth and structured regions, as in Figure 8.

Overview
A remaining question is whether the numerical simulations and analytic predictions give reasonable expectations for formation flying performance when compared against actual hardware. We starshade is moved to a pre-determined offset, and the measured intensity on the camera is matched to a precomputed library of images using a least-squares algorithm. This is repeated hundreds of times to determine the accuracy of the position matching. In the following subsections, we give a description of the testbed design, hardware and optical considerations, and experimental results.

Testbed design
As previously mentioned, starshades are designed to operate at Fresnel numbers F ∼ r 2 /(λZ) of <20. Here r is the starshade radius, λ the wavelength, and Z the separation, and most optical propagation effects are preserved when the Fresnel number is the same. Due to the large separation distances of >10000 km, it is not possible to optically validate a full-scale starshade on Earth.
However, aspects of a flight-like setup may be tested by quadratically decreasing distance Z with starshade radius r. Scaling down the starshade by a factor of one thousand requires a separation one million times smaller, allowing for optical validation with more manageable testbeds sized 1-100 meters.     Table 2 Comparison of optical, detector, and morphological parameters of SLATE with the flight expectation flight expectation is presented in Table 2.

Optical considerations
The contrast of the guiding signal is at 10 −3 to 10 −4 , which is challenging to achieve optically, but nowhere near as challenging as building a testbed to simulate the optical performance of the starshade at science contrast, at 10 −10 to 10 −11 . This is not just due to the optical tolerances, but the amount of light present is much higher, meaning low-noise detectors are not required. Additionally, effects that are important at the 10 −8 to 10 −11 contrast levels are irrelevant for formation flying.
These include edge glint from scattered sunlight, exozodiacal light, and the high likelihood of source confusion from faint background galaxies. 20 However, attaining shear sensing contrast still requires some care, and we traded off optical tolerances with fidelity to the flight system. Here, we will describe some differences between the flight system and our testbed.
For the light source, we elected to use a single-mode fiber laser to simulate the starlight, rather than broadband illumination. Despite the single wavelength (632 nm), the images that a flight pupil sensor will see would be similar, because the sensing wavebands are not particularly broad, at ∼10% optical bandwidth. Additionally, one side of the band will be much brighter than the other due to the steep wavelength dependence of starshade transmission.
The incident beam on the starshade in flight will be a flat wave of starlight with effectively no aberration. A flat beam is not an option in this testbed as diffraction from the edges of the optics would overwhelm the faint guiding spot. We used a beam from a fiber, collimated 100 mm from the starshade, as optical modeling showed the Gaussian shape would marginally affect the spot contrast while eliminating edge diffraction. Our original choice of a precision asphere to collimate the Gaussian beam failed badly due to significant mid-spatial-frequency errors in the lens. On the other hand, our optical model indicated that the spherical aberration from an off-the-shelf doublet would marginally affect the guiding signal.
Starshades are meant to be free-floating, which cannot be reproduced in the laboratory. Mounting them with "struts" will cause unacceptable diffraction unless the struts themselves are apodized similarly to the petal edges; this is the approach taken by the experiments at science contrast levels. 21 In our case, the starshade was manufactured 5 by depositing chrome on an optical reference flat.
Beyond static errors like spherical aberration, the biggest optical challenge was mid-to highspatial frequency error. We simulated the expected power spectra of the optical surface roughness of the lenses and starshade, and found that operating at Fresnel numbers of F ∼7 would require an RMS surface error of ∼5 nm, which is challenging to achieve without active optical control (for example, interferometer reference flats are typically specified up to 1/20th of a wave). However, the same simulations indicated that operating closer to F ∼4-5 would be achievable with bulk, static optics. While this is at the lower range of flight Fresnel numbers, it allowed us to validate the simulations without the added complexities of an active wavefront control system. 5 by Opto-Line International, Inc.,

Camera parameters
The flight EMCCD detector for the WFIRST coronagraph, the CCD201 from e2v, is baselined for both the low-order wavefront sensor and science camera. Unsurprisingly, its performance exceeds the lab detector's by factors ranging from 20 (read noise) to 10,000 (dark current). As such, attempts to match exposure times and flux levels in the testbed to flight levels would result in a much lower signal-to-noise ratio than that delivered by the EMCCD. Instead, we adjusted the exposure times and laser power to match the empirically measured signal-to-noise ratio of the spot, which ranges from 3-8 depending on the wavelength.
Another unknown at this time is the pixel resolution of the LOWFS camera, which is expected to be between 16 and 64 pixels across the pupil diameter. The pixel resolution does not meaningfully affect formation flying performance, provided the sampling is fine enough to properly resolve the spot structure, but not so fine that readout noise overwhelms the signal. The lab camera's native resolution was about 100 pixels across the pupil, which we digitally interpolated down to 32, for a final output image format of 32x32.

Experimental Design
The experimental setup used signal-to-noise ratios and spot sizes (as fractions of the pupil diameter) determined from the expected flight-like values. These are listed in Table 2. The relative scaling between the testbed motion and flight motion (in units of millimeters per cm) were calculated analytically and verified experimentally.
We experimented with different processing of the camera images, but opted to go with a straightforward "image minus dark frame" calibration. This is due to features of the test camera, which included a fixed bias offset, and confounding factors such as background illumination from neighboring laboratories. The dark-subtracted frame was then input into the image matching algorithm presented in the Appendix. While we would have been able to get better performance using more advanced postprocessing, like filtering out optical noise, this minimal level of calibration stays close to the flight algorithm. It is also expected that in flight, there will be additional error sources like unstable flat fields and charge traps due to cosmic ray damage, which will not be in the optical model.
In order to build the sensor model, we first needed to create an image library for the lab. We computed the diffraction pattern on the sensor with models of the lab optics, involving the fiber output beam, collimating lens, and miniature starshade. Obviously, sizes and distances are different as well, at ∼3 meter separations and a ∼6mm starshade rather than ∼40,000 km separations and a 26 meter starshade. An example of the computed and measured diffraction pattern, before adding the pupil and binning, is shown in Figure 11 ( Figure 12 shows the 32x32 version with the pupil overlaid). While our contrast measurements were consistent to 25% of expectation, absolute values of contrast are not relevant because the images are normalized before being matched. We determined the correct laser drive voltage by empirically measuring the signal-to-noise ratio of the pixels (after being binned to the LOWFs plate scale) as approximated by SNR = mean/(standard deviation). We matched the empirical signal-to-noise ratio to that expected in space from stars fainter than 8th magnitude at a typical spot size. The exact nature of the noise will change between the flight detector and SLATE; the former will be almost purely Poissonian, while the latter includes Poisson, readout, and dark current noise. It would be in principle possible to independently characterize the different SLATE detector noise sources, and their combined distributions, but we opted to use the empirical SNR instead. While we did not analyze the exact form of the noise statistics, it is possible that some variation in our results is due to these subtle effects.

Results
From the empirical data covariance matrix at each position, we generate error ellipses showing, 1, 2, and 3σ contours. These results were consistent with numerical expectations within a factor of ∼50%, as shown in Table 3. Plots of the results are presented in Figure 13. The delivered sensing precision, which was obtained at much lower signal level than expected in flight, is still well within the tolerance specified for formation flight, and a companion work will demonstrate robust control even with errors far larger than what the sensor can deliver.  The primary reason for the worse performance in the lab than from numerical simulation is optical noise; that is, blobs of bright light forming structures in the shadow, that are not expected in the CGI flight optical system. This noise is created by light scattered by the imperfect optics.
The extra optical noise leads to both statistical and systematic errors. The statistical errors are due to the combination of Poisson, dark, and readout noise; the systematic errors are due to the matching algorithm biasing towards the scattered light structures. (These systematic errors are visible in Figure 13 as slight shifts in the midpoint of the error ellipses compared to the setpoints).
Errors in the camera also contribute. The dark level in the camera drifts continuously, and while we always took a background frame before a science frame, the noise on top of these frames can appear as a changing noise gradient from one side of the detector to the other. Another issue was flat-field correction: we did not solve for a flat-field on the camera and thus differences in per-pixel gain can create a spatially dependent systematic error signal. These errors will also be present in flight to some degree, as cosmic ray damage begins to affect the pixels in the detector.

Conclusions
We have presented a lateral sensing scheme appropriate for the challenging task of starshade formation flying, where two spacecraft must be aligned to a precision of 1 meter at distances of 20,000-80,000 km. The sensing scheme measures the position of the classical "Arago spot" from light diffracting around the edges of the starshade using an internal pupil sensor on the telescope.
This light, which is outside the wavelengths of scientific interest, bright enough to provide a robust sensing signal. The precision of this sensing scheme is just a few centimeters in shear for star brightnesses of 8-10 V magnitudes, which is fainter than any of the expected target stars by factors of >10. The performance of this sensor shows good agreement when compared to analytical calculations, detailed numerical simulations, and laboratory experiments.
No additional hardware is needed to implement this sensor beyond a pupil imager in the tele-scope. This is already present in the case of the WFIRST coronagraph instrument, where it is used as an internal wavefront sensor in coordination with a Zernike spot. In the case of future missions like mDot, 22 HabEx, 23 or LUVOIR, 24 pupil sensors are expected to be present as well. As such, they can support accommodation for future starshade rendezvous missions.
A companion paper (Flinois et al., in preparation) 4 will introduce a control scheme that can easily provide enough fidelity to keep the starshade and telescope aligned to the 1 meter necessary for imaging extrasolar planets. Such a control scheme has a high level of efficiency and an ability to execute nearly optimal trajectories in the differential gravity of L2, with minimal interruptions in science operations for trajectory correction maneuvers. As such, we have high confidence that the formation flying problem, which was initially considered a major challenge in implementing a starshade, can be solved.

Disclosures
The authors declare no financial or other conflicts of interest in this publication.

Appendix A: Storage and computational requirements for formation sensing algorithm
The baselined flight computer for the coronagraph instrument on WFIRST is the LEON4 processor 25 from Cobham Gaisler. Internal testing of the processor report a maximum performance of 800 MFLOPS, with an "effective" performance (including all low-level overheads) estimated at 76 MFLOPS. The available memory allocated to the coronagraph instrument is about 66 GB.

A.1 Library size and storage requirements
For formation flying, the control region is 1 meter in radius. It is expected the image library size will be larger, to accommodate some margin for error and initial acquisition. We assume a 3x3

A.2 Computational requirements
Here we describe a brute-force implementation of the image matching algorithm. Let n be the number of pixels used in the pupil sensor; for example n = 1024 for the 32x32 format considered earlier. Let m be the number of images in the library. Table 4 outlines the steps in the shear-sensing algorithm with their associated floating point cost.
To convert to FLOPS, we assume each low-level mathematical operation (addition, multiplication, etc) costs 1 FLOP. For the 22,500 images per library, a full search each second would cost about 70 MFLOPS, which is just within the capabilities of the LEON4. However, after the initial  12 Image matching from the noisy camera image to the model prediction.
13 Results of sensing precision of SLATE (right) and a model of SLATE at the same flux levels (left).