Translator Disclaimer
Open Access Paper
2 September 2016 The AIROPA software package: milestones for testing general relativity in the strong gravity regime with AO
Author Affiliations +
General relativity can be tested in the strong gravity regime by monitoring stars orbiting the supermassive black hole at the Galactic Center with adaptive optics. However, the limiting source of uncertainty is the spatial PSF variability due to atmospheric anisoplanatism and instrumental aberrations. The Galactic Center Group at UCLA has completed a project developing algorithms to predict PSF variability for Keck AO images. We have created a new software package (AIROPA), based on modified versions of StarFinder and Arroyo, that takes atmospheric turbulence profiles, instrumental aberration maps, and images as inputs and delivers improved photometry and astrometry on crowded fields. This software package will be made publicly available soon.



Adaptive optics (AO) near-infrared observation with NIRC2 at the W. M. Keck observatory has enabled us to monitor stellar orbits in the innermost arcsecond of the Galactic Center (GC), and led to the detection of the supermassive black hole and many unexpected findings about its environment (see Fig. 1). With almost two decades of data, continuing this experiment will allow us to test General Relativity in the strong-gravity regime by observing the periapse passage of the 14th magitude star S0-2 in 2018. Our data analysis tool of choice is the IDL point spread function (PSF) fitting package, StarFinder, for extracting precise astrometry and photometry (1). However, StarFinder does not fully account for the spatial variability of the PSF as seen in NIRC2 images (Fig. 2). Recently, it became evident that spatial variability of the PSF is one of the major sources of our remaining systematic uncertainty in AO astrometry and photometry and has to be addressed in order to be sensitive to relativistic effects on S0-2’s orbit.

Figure 1

Left: Stellar orbits of the innermost nine detected stars as measured over two decades. Right: An illustration of effects of General Relativity as predictied for the orbit of S0-2.


Figure 2

Left: PSF variability as encountered in NIRC2 observations: We show a mosaic of pointings to the positions of 7 masers at the Galactic Center in the left image that are used to introduce an absolute astrometric reference frame to the innermost 10 arcseconds in the near-infrared (NIR). As illustrated in the middle panel, depending on the position of a star its PSF can look significantly different. Right: Adaptive optics measurements through atmospheric turbulence: A guide star (natural or laser) is used to to determine atmospheric phase aberrations in real time. Light from a target at a different position passes through turbulence slightly different than the one in the direction of the guide star. As a consequence the quality of the AO correction degrades with distance to the guide star (atmospheric anisoplanatism).


Figure 3

The 00026_psisdg9909_99091o_page_4_2.jpg-profile as provided by the Mauna Kea Weather Center (taken from The MASS/DIMM telescope on Mauna Kea allows the independent quantification of the turbulence profile (00026_psisdg9909_99091o_page_4_3.jpg values at 0.5, 1, 2, 4, 8, and 16 km) simultaneous with Keck observations of the GC.


Single conjugate adaptive optics uses the light of a guide star in order to correct for phase aberration introduced to the light coming from astronomical sources through the turbulent atmosphere. This atmospheric turbulence varies vertically and, as a consequence, light from a target object probes a different column of turbulence than the light from the guide star that is used to determine the single conjugate AO correction. This effect is called angular atmospheric anisoplanatism and causes an increasing degradation of the AO correction with increasing distance to the guide star. In the case of laser guide star (LGS) AO the situation is more complex: a second natural guide star for low-order correction (tip and tilt) is required, and the finite altitude of the sodium layer only allows to probe a cone of the atmosphere rather than the cylinder through which the light from a source at infinity propagates (cone effect or focal anisoplanatism).

The observed spatial variability of the NIRC2 PSF is caused by angular anisoplanatism, differential tip and tilt jitter, and aberrations of the optics of NIRC2 (which in general are different for each position depending on the path the light takes through the optics). Mitigation of anisoplanatism through hardware requires multi-conjugate or multi-object AO, massively increasing the costs and complexity of the system. Furthermore, differential instrumental aberrations will always be present due to the compromises necessary to accommodate the multifarious requirements and applications for which a modern astronomical instrument typically is built. Post-processing tools are a promising alternative and additionally allow to make use of the existing AO data. For the Galactic Center with its processes on timescales of years for stellar orbits to minutes for the variability of Sgr A* this is particularly important because the ongoing observations of the last two decades cannot simply be repeated and are very expensive datasets.

The Galactic Center Group at UCLA in collaboration with the Institute for Astronomy at UH and the W. M Keck Observatory has completed a project in which we have developed algorithms to predict how the PSF varies (Off-axis PSF reconstruction). Intermediate results and a detailed presentation of the underlying models for atmospheric anisoplanatism and instrumental phase aberrations can be found in 2, 3 and 4. In particular, we presented at earlier SPIE conferences a first validation of our model assumptions with binary star data that allowed for direct comparison of the guide star, the model, and an off-axis PSF. Additionally, the team worked on distortion solutions for NIRC2 in parallel in order to account for recent changes in the optical alignment of the AO system (5).

We incorporated the new algorithms into a software package: AIROPA (Anisoplanatic and Instrumental Reconstruction of Off-axis PSFs for AO). In the following we describe the new algorithm, and present first results and the key developments that we intend to disseminate.



In order to understand the problems occurring in the case of astrometry with variable PSFs it is helpful to think in terms of three PSF reference points: a) the true position, b) the centroid estimated from the intensity distribution of the PSF itself, and c) the mathematical centroid, an integral over an infinite domain. In the presence of phase aberrations these three reference points do not coincide with each other (6). For astrometry with a constant PSF, the empirical center of light (centroid) - calculated on the empirical PSF with finite support and in the presence of noise - is often chosen to be the astrometric reference point. However, since the PSF is (assumed to be) spatially constant, the difference between true position and centroid - although unknown - is always the same for all positions in the field of view and does not contribute to the astrometric uncertainties.

In our case, the errors of relative astrometric measurements are dominated by the shape variations of the PSFs. Due to asymmetries in the variable PSFs and their interaction with centroid algorithms it is not sufficient to estimate the empirical center of light (b) of each individual PSF as the astrometric reference. It is unknown what effect the individual shape has on the centroid measurement. As a consequence, the difference between the true position and the empirically determined center of light is different for each of the PSFs, potentially dominating the systematic uncertainties for relative astrometry.

It is essential to control and maintain the relation between the astrometric reference points of the individual modeled PSFs. In our sequence of analysis steps this means to first extract an estimate of an ’on-axis’ PSF (no atmospheric anisoplanatism, no instrumental aberrations other than at the image-sharpening position* on the detector) and to center this estimate with the centroiding algorithm of our choice (for AIROPA centering means to shift the empirical centroid of the PSF core to the center of the PSF array, e.g. to pixel [91,91] for a 181x181 array). In the next step of propagating the PSFs to off-axis positions the relation between the true position and the central pixel of the on-axis PSF has to be either conserved, or its error - if unknown - has to be time invariant and independently calibrated.

Since the atmospheric blurring is a symmetric effect, in our case only the instrumental aberrations influence the PSF centering. For sufficiently static instrumental aberrations the centering errors can be calibrated against HST astrometric datasets in the context of the determination of NIRC2’s geometric distortions.



The AIROPA software package makes use of independently measured atmospheric profiler data obtained with the Thirty Meter Telescope (TMT) side test multi-aperture scintillation sensor (MASS) and differential image motion monitor (DIMM, 8) and predicts the differential OTFs between different field positions. It is based on ARROYO (4), a set of C++ class libraries that aim to support simulations of electromagnetic wave propagation through turbulence and through optical systems. AIROPA includes C++ tools for predicting both natural guide star and laser guide star PSFs, as well as application program interfaces (APIs) for IDL. Furthermore, it provides extensive IDL modules for Fourier-based PSF manipulation and for PSF modeling from any externally generated aberration maps. These IDL routines and APIs are integrated with a modified version of StarFinder.

The basic underlying assumption of AIROPA is that the field dependency of the PSF and the corresponding optical transfer function (OTF) can be modeled according to (4, see also 2):


or equivalently:


i.e., as a convolution of an on-axis PSF(an abstract quantity that would be located at the image sharpening position on the NIRC2 detector, measured in the direction of the LGS and tip and tilt guide star (TTGS) position, and corrected for focal anisoplanatism), and of an instrumental and an atmospheric convolution kernel, with r the position on the detector with respect to the sharpening position.


Code structure and algorithm

The AIROPA code structure is shown in Fig 4. AIROPA is mainly an IDL library for PSF manipulation and PSF extraction and fitting, with an interface to C++ classes for efficient prediction of atmospheric anisoplanatism from MASS/DIMM data. The IDL portion contains code that allows for modeling of PSFs from phase-maps, including interpolation and FFT algorithms, FFT-based sub-pixel shift algorithms, filter and tapering algorithms, and algorithms for generating pupils. It furthermore provides the IDL interface to the C++ API, in particular to transform the positions of the guide stars and PSF detector positions (in the C++ classes they are defined relative to the center of the images) into the reference frame of the image (relative to the left lower corner). It also provides all other necessary input parameters, such as pupil and telescope parameters, zenith angle, LGS altitude, or observing wavelength. For image analysis, AIROPA uses a modified version of StarFinder for extraction of the on-axis PSF from science images, and for PSF-fitting with variable PSFs. The old functionality of StarFinder is preserved as legacy mode. Finally, AIROPA includes wrappers for execution of all code parts necessary to generate a list of stellar positions and magnitudes, and a large suite of tests for illustration and in order to guarantee proper installation and functionality.

Figure 4

The structure of the AIROPA code package. AIROPA is built around ARROYO, a set of C++ class libraries for electromagnetic wave propagation through turbulence, and a modified version of StarFinder, an IDL library for PSF extraction and fitting in crowded fields.




AIROPA is based on two models: a model describing the instrumental phase aberrations of NIRC2, and an atmospheric model. In order to characterize the instrumental aberrations of NIRC2 we derived phase maps as a function of detector position from phase diversity measurements on a grid of detector positions (Fig. 5). These measurements were conducted using a fiber in the input focal plane of the AO system. They show a differential wavefront error up to 220 nm across the detector. A detailed model of the instrumental PSF variability and its stability over time was developed (a comprehensive description can be found in 3) that allows to interpolate the instrumental phase aberrations for any detector position. As a result, dense grids (every 5 pixels on the 1024x1024 pixel NIRC2 detector) of 64x64 pixel phase maps are available and part of the AIROPA software package, both for times before the recent AO system realignment and after. For details see SPIE article 9909-232.

Figure 5

Map of phase maps for NIRC2 determined with fiber phase diversity measurements on the 1024x1024 pixel detector of NIRC2. Each phase map is the difference between the measured wavefront at the detector location indicated and the on-axis measurement. The color scale ranges from -300 nm to 300 nm, the maximal RMS error is ~ 200 nm (corner position).


The NGS part of the atmospheric model is described in detail in 2 and 4. It has been validated with binary star observations with NIRC2 that allowed to simultaneously observe the NGS guide star PSF and an off-axis PSF across the detector. The LGS part has been developed recently as part of this project, and its theoretical background will be published soon. While Eq. 3 does not strictly hold true for LGS observations, factorization of the off-axis OTFs into on-axis OTF and an OTF that describes the off-axis convolution kernel is a valid assumption for at least moderate turbulence, as preliminary validation against models provided by external experts has shown.

As mentioned above, in order to make use of the instrumental phase maps in the context of astrometric measurements, a new distortion map for NIRC2 will be derived from recent observations using AIROPA.



AIROPA’s algorithm contains two main steps: 1) the PSF modeling that provides grids of OTFs (i.e., OTFinstr. (r) x OTFAO+atm. (r)) with a typical step size of 200 mas, and 2) the image analysis, that makes use of the OTF grid to extract an on-axis PSF from science frames and creates PSF grids for PSF-fitting to determine stellar positions and magnitudes.

The OTF grid represents the variable atmospheric and instrumental PSF model for the 00026_psisdg9909_99091o_page_6_2.jpg-profile at a given point in time. Our modified version of StarFinder can extract the on-axis PSF, PSF0(r = 0), calculated as an average of the PSFs of reference stars after deconvolution with the the OTFs corresponding to their position. This on-axis PSF is then used to generate a grid of PSFs (in our case more than 3000!) that can be used by the PSF-fitting routines of StarFinder. These routines have been modified to work at highest efficiency. A single frame analysis based on 3025 PSFs can be done in less than 15 min. A full run with atmospheric and instrumental OTF generation and PSF fitting takes about 30 min. These run times are substantially shorter than our earlier versions of StarFinder with variable PSFs (~ 24 hrs) and enable us for the first time to efficiently test the algorithm and models against on-sky data.

A overview of the algorithm and the information flow is presented in Fig. 6. The different code parts are executed by wrappers tailored to our GC data. However, AIROPA is generalized and able to generate PSFs in the wavelength range of 1 – 5μm, and for a large range of PSF array sizes, pixels scales, and oversampling factors. AIROPA configuration files provide easy adaptation to NIR instruments other than NIRC2. With our wrappers as templates it is easily possible to set up an analysis pipeline for other AO instruments.

Figure 6

The AIROPA algorithm and data flow from left to right (data in grey, routines in purple): External MASS/DIMM data and phase maps are used in the OTF grid generating routines of AIROPA in order to predict a grid of instrumental and atmospheric OTFs. The resulting grid is used to deconvolve reference stars and determine an on-axis PSF in the PSF extraction routines. The OTF grid is used again to generate a grid of off-axis PSFs from the extracted on-axis PSF and used for PSF-fitting, resulting in a list of stellar positions and magnitudes. Since the instrumental OTFs are static, a library of instrumental OTFs (left yellow box) for each rotation angle of the pupil can be generated and used instead, dramatically increasing the efficiency of the code. Once an analysis of a science frame was run, the OTF grid is stored and can be used the next time without being generated again (right yellow box).


The instrumental PSF modeling code is very generally applicable. It provides tools to generate PSFs and OTFs from any phase map, and OTF ratios from any pair of phase maps. It furthermore contains filter and tapering functions in order to control noise, pupil generating functions, and estimate the tip and tilt on any given pupil geometry. These functions have proved to be valuable tools in order to simulate, e.g., the astrometric and photometric effects of wavefront distortions predicted by Zemax for different OSIRIS imager designs. Fig. 7 shows a NIRC2 phase map, the NIRC2 large hex pupil at a random position, and the same phase map masked by the pupil. Fig. 8 shows the output data of the instrumental routines calculated from an input phase and the NIRC2 pupil: PSF, OTF, OTF ration calculated for two detector positions, and the tip and tilt phase. AIROPA additionally provides the typical StarFinder output. Besides lists of stellar positions and photometry, these outputs are: the on-axis PSF, a PSF grid, maps of detected point sources, a background map, and residuals (Fig 9).

Figure 7

NIRC2 phase map and large hexagonal cold stop pupil. The phase maps are measured with the open NIRC2 pupil. For generating the OTF ratio in order to model an off-axis PSF we apply a model of the large hex pupil rotated according to the changing pupil orientation determined from the NIRC2 FITS header to the phase map and use the resulting array as the phase of a complex number, the pupil function.


Figure 8

Output data of the instrumental part of AIROPA. AIROPA generates pupils, pupil functions, PSF, and OTFs. It can calculate the OTF ratio for two different detector positions, and determine the tip and tilt on a non-circular aperture.


Figure 9

Final output of AIROPA. As StarFinder, AIROPA provides a detected star map, an estimated extended background, on- and off-axis PSFs, and the residual of the PSF-fitting (data - detections - background).


AIROPA includes improvements in the post-processing of the extracted PSF relative to earlier StarFinder versions. In particular, a new clipping method that identifies parts of the PSF that fall below the level of the pixel noise, and artifacts above this noise level that are not contiguously related to the PSF. This enables us to make sure that the PSF tapers off to zero. This improves the normalization of the empirical PSF, and as a consequence photometry, significantly. Additionally, since StarFinder is a combined PSF-fitting and -cleaning routine, the improved background clipping is helpful for astrometry of dim sources in the halos of bright stars. The algorithm is especially powerful in the context of generating PSF grids from on-axis PSFs. Clipping the on-axis PSF with the new algorithm removes structure that is dominated by noise, but does not affect the PSF halo severely which in parts has been folded into the PSF core by the deconvolution step. The halo is then restored by re-convolution with the off-axis kernels in the step that generates the PSF-grid, resulting in a very well behaved extended PSF halo that falls off to zero and is basically noise free. A comparison of the PSF with and without clipping is shown in Fig. 10.

Figure 10

Left: Extracted PSF with single PSF StarFinder. Middle: Extracted on-axis PSF with AIROPA and better postprocessing of the PSF background. Right: PSF reference stars.




We started to characterize the improvements in astronomical quantities with both realistic simulations of the innermost 10”x10” of the GC and real datasets of the GC and binary stars. A campaign of several NGS observations of binary stars that allowed to locate the NGS guide star in the center of the detector and the off-axis star in one corner provided on sky data in order to test the instrumental model and predictions for the effect of anisoplanatism. Fig. 11 shows a binary star observation under exceptionally good conditions. This is the ideal case for comparisons of the instrumental prediction with on-sky data. In both metrics, Strehl ratio and FWHM, our model accurately predicts the off-axis values, and the predicted PSF is very similar in shape to the observed off-axis PSF. For NGS and LGS binary star observations with a significant degree of anisoplanatism, we obtain Strehl predictions in good agreement with the observed off-axis values as well. Fig. 12 shows a comparison of the Strehl ratio differences of on- and off-axis PSFs and predicted and off-axis PSF under various conditions. The model is almost always an accurate descriptions in terms of FWHM and Strehl ratio (deviation < 5%).

Figure 11

On sky validation of instrumental model with a binary star. NGS observations with minimal anisoplanatism show a good agreement of the instrumental prediction with on-sky PSFs, in particular in Strehl-ratio and FWHM. Left: On-sky on-axis PSF. Middle: On-sky off-axis PSF; the arrows point to features that are particularly different form the on-axis PSF. Right: Predicted off-axis PSF.


Figure 12

On sky validation of atmospheric NGS model with binary stars. This figure shows the Strehl ratio difference between on-axis PSF and off-axis PSF (triangle) and predicted PSF and off-axis PSF (circle) vs. binary star separation divided by anisoplanatic angle, a measure of degree of anisoplanatism. NGS observations with significant anisoplanatism show a good agreement of the Strehl-ratios between the atmospheric prediction and the on-sky PSFs. Each color is a different binary and night.


Analyzing real LGS GC data with AIROPA (both instrumental and atmospheric modeling) we can show a factor of 3 to 4 improvement in the residual after fitting the predicted PSFs to the data. Fig.13 shows the qualitative and quantitative improvement of the residual. The fractional PSF error (FPE) is defined as:


with i,j pixels in a 40x40 pixel box around the PSF core. The improvement is driven mainly by the new background clipping algorithm, but the errors in the PSF cores are reduced as well. However, despite the better residuals, it is apparent that the PSF shapes are not perfectly described and that the instrumental and atmospheric models need further development to make use of AIROPA’s full potential.

Figure 13

Left: Comparison of the residuals of single PSF StarFinder and AIROPA. Visually, the residual is obviously improved.Right: Comparison of the residuals of single PSF StarFinder and AIROPA. Quantitatively, the residual is dramatically improved.


Figure 14

Simulation of the effect of the instrumental aberrations on NIRC2 astrometry. A GC image simulated with variable PSFs modeled from instrumental phase-maps, but analyzed with a single PSF shows large displacements of the stellar positions.


In order to understand the effect of PSF variability on astrometry we used a well controlled simulation framework. We used a grid of PSFs in order to model a simulated GC image with a realistic number of stars, including typical NIRC2 noise characteristics. We then analyzed this image with AIROPA, only using the corresponding OTF grid (i.e., deriving the on-axis PSF from the image itself). We compared the resulting list of positions and magnitudes with the input list. The result is shown in Fig. 15. While this simulations assumes perfect model knowledge, it demonstrates which magnitude of improvement can be expected in comparison to a constant PSF analysis. On average the accuracy of both quantities is improved by factors of four to five. However, for the extrema and dimmer sources, the improvement can be more than an order of magnitude. This fact is of particular interest for the GC since several of the maser sources are situated close to the edge of the images and might especially benefit from AIROPA’s analysis scheme. Further investigations of these particular field positions are on the way.

Figure 15

Predicted improvements in astrometry and photometry with AIROPA based on simulated GC images modeled from variable PSFs.




AIROPA predicts the observed differences in Strehl-ratio of up to ~ 5% under typical GC conditions in K-band (or ~ 10% in H-band) reliably, reduces PSF residuals by at least a factor of three in comparison to single-PSF analysis, and delivers more precise astrometry and photometry for stellar orbits at the Galactic Center and other NIRC2 projects. This is a milestone on the way to the measurements of general relativistic effects on stellar orbits. The validation of our new methodology in the context of astrometry at the Galactic Center is still ongoing. We have to address a number of problems with both the instrumental and the atmospheric models. However, the development of AIROPA enables us to efficiently implement the necessary changes for optimizing our PSF predictions by on-sky tests. Ultimately, we will propagate the improvements of the PSF to the final steps of establishing an absolute astrometric reference system and deriving orbits for S0-2.

AIROPA is managed with a number of repositories that include documentation and installation notes and will be used for dissemination (Fig. 16).

Figure 16

AIROPA will be further developed, disseminated and maintained via its Bitbucket repository.



[1] Image sharpening is a calibration scheme for the deformable mirror that accounts for non-common path aberrations in the science leg of the instrument that are not detected by the wavefront sensor, see, e.g., 7.


We would like to acknowledgment the support and advice of our external advisory board: Rich Dekany, James Graham, Brent Ellerbroek, Andrei Tokovinin, Claire Max, Marcos van Dam, and Jay Anderson. We also acknowledge major funding from the W. M. Keck Foundation for the AO-Optimization project and the AIROPA software package.



Diolaiti, E., Bendinelli, O., Bonaccini, D., Close, L. M., Currie, D. G., and Parmeggiani, G., “StarFinder: an IDL GUI-based code to analyze crowded fields with isoplanatic correcting PSF fitting,” in SPIE Proc., 879 –888 (2000). Google Scholar


Fitzgerald, M. P., Witzel, G., Britton, M. C., Ghez, A. M., Meyer, L., Sitarski, B. N., Cheng, C., Becklin, E. E., Campbell, R. D., Do, T., Lu, J. R., Matthews, K., Morris, M. R., Neyman, C. R., Tyler, G. A., Wizinowich, P. L., and Yelda, S., “Modeling anisoplanatism in the Keck II laser guide star AO system,” in SPIE Proc., 844724 (2012). Google Scholar


Sitarski, B. N., Witzel, G., Fitzgerald, M. P., Meyer, L., Ghez, A. M., Campbell, R. D., Lu, J. R., Matthews, K., Wizinowich, P., and Lyke, J., “Modeling instrumental field-dependent aberrations in the NIRC2 instrument on the Keck II telescope,” in SPIE Proc., (2014). Google Scholar


Britton, M. C., “The Anisoplanatic Point-Spread Function in Adaptive Optics,” PASP, 118 885 –900 (2006). Google Scholar


Service, M., Lu, J. R., Campbell, R., Sitarski, B. N., Ghez, A. M., and Anderson, J., “A New Distortion Solution for NIRC2 on the Keck II Telescope,” PASP, 128 095004 (2016). Google Scholar


Mahajan, V. N., “Line of Sight of an Aberrated Optical System,” Report, Electronics and Optics Division, Engineering Group, The Aerospace Corporation(1985). Google Scholar


van Dam, M. A. and Macintosh, B. A., “Characterization of adaptive optics at Keck Observatory,” in SPIE Proc., 1 –10 (2003). Google Scholar


Tokovinin, A. and Kornilov, V., “Accurate seeing measurements with MASS and DIMM,” MNRAS, 381 1179 –1189 (2007). Google Scholar
© (2016) COPYRIGHT Society of Photo-Optical Instrumentation Engineers (SPIE). Downloading of the abstract is permitted for personal use only.
Gunther Witzel, Jessica R. Lu, Andrea M. Ghez, Gregory D. Martinez, Michael P. Fitzgerald, Matthew Britton, Breann N. Sitarski, Tuan Do, Randall D. Campbell, Maxwell Service, Keith Matthews, Mark R. Morris, E. E. Becklin, Peter L. Wizinowich, Sam Ragland, Greg Doppmann, Chris Neyman, James Lyke, Marc Kassis, Luca Rizzi, Scott Lilley, and Rachel Rampy "The AIROPA software package: milestones for testing general relativity in the strong gravity regime with AO", Proc. SPIE 9909, Adaptive Optics Systems V, 99091O (2 September 2016);


Back to Top