{'fraction_non_alphanumeric': 0.030080369532217658, 'fraction_numerical': 0.015105374421441808, 'mean_word_length': 4.545628260083665, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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}}
Point spread function of SDO/HMI and the effects of stray light correction on the apparent properties of solar surface phenomena

We present a PSF for SDO/HMI and discuss the effects of its removal on the apparent properties of solar surface phenomena in HMI data. The PSF was retrieved from observations of Venus in transit by matching it to the convolution of a model of the venusian disc and solar background with a guess PSF. Observations recorded near in time to the transit of Venus were corrected for instrumental scattered light by the deconvolution with the PSF. Granulation contrast in restored HMI data is greatly enhanced relative to the original data and exhibit reasonable agreement with numerical simulations. Image restoration enhanced the apparent intensity and pixel averaged magnetic field strength of photospheric magnetic features significantly. For small-scale magnetic features, restoration enhanced intensity contrast in the continuum and core of the Fe I 617.3 nm line by a factor of 1.3, and the magnetogram signal by a factor of 1.7. For sunspots and pores, the enhancement varied strongly within and between features, being more acute for smaller features. Magnetic features are also rendered smaller, as signal smeared onto the surrounding quiet Sun is recovered. Image restoration increased the apparent amount of magnetic flux above the noise floor by a factor of about 1.2, most of the gain coming from the quiet Sun. Line-of-sight velocity due to granulation and supergranulation is enhanced by a factor of 1.4 to 2.1, depending on position on the solar disc. There are indications that the PSF varies across the FOV, with time and between the two CCDs. However, all these variations were found to be relatively small, such that the derived PSF can be applied to HMI data from both CCDs, over the period examined without introducing significant error. Image restoration affects the measured radiant, magnetic and dynamic properties of solar surface phenomena sufficiently to significantly impact interpretation.


Introduction
Solar telescopes, like any real optical system, diverge from diffraction-limited behaviour due to optical aberrations and, in the case of ground-based instruments, the influence of the Earth's atmosphere. Optical aberrations arise from factors such as design and material constraints, imperfections in the fabrication, presence of impurities, thermal changes and jitter, and are practically unavoidable. Due to aperture diffraction and optical aberrations, radiation entering a given optical system is not entirely confined to the intended area on the focal plane but instead spread out, as described mathematically by the point spread function, PSF. This image blurring or loss of contrast is the so-termed stray light.
The apparent properties of solar phenomena is sensitive to stray light, accounting for its influence on solar imagery is necessary for proper interpretation and comparison with numerical models. This has been demon-strated repeatedly in the literature, for example, in studies looking at the limb darkening function (Pierce & Slaughter 1977;Neckel & Labs 1994), the intensity contrast of granulation (Sánchez Cuberes et al. 2000;Danilovic et al. 2008;Wedemeyer-Böhm & Rouppe van der Voort 2009;Afram et al. 2011), and the brightness of small-scale magnetic concentrations (Title & Berger 1996;Schnerr & Spruit 2011) and sunspots (Albregtsen & Maltby 1981;Mathew et al. 2007).
Sophisticated techniques to correct solar observations for instrumental and atmospheric effects exist, the most common being speckle interferometry (de Boer et al. 1992;von der Lühe 1993) and phase diversity (Gonsalves 1982;Löfdahl & Scharmer 1994) methods. For spaceborne instruments, where variable atmospheric seeing is not a factor, a more conventional approach is often sufficient. Specifically, inferring the PSF from the distribution of intensity about the boundary between the bright and dark parts of partially illuminated scenes (such as, of the solar limb, and of transits of the Moon, Venus or Mercury) and restoring data by the deconvolution with it. Recent examples include the work of Mathew et al. (2007) with observations from SoHO/MDI 1 , Wedemeyer-Böhm (2008), Wedemeyer-Böhm & Rouppe van der Voort (2009) and Mathew et al. (2009) with Hinode/SOT/BFI 2 , and DeForest et al. (2009) with TRACE 3 .
In this paper we present an estimate of the PSF of the Helioseismic and Magnetic Imager onboard the Solar Dynamics Observatory, SDO/HMI (Schou et al. 2012b). The PSF was derived from observations of Venus in transit. We also demonstrate the effects of correcting HMI data for stray light with this PSF on the apparent properties of various photospheric phenomena.
This study broadly follows the approach taken with the other spaceborne instruments listed above. It departs from these earlier efforts in that we constrain the PSF not only in the radial dimension but also in the azimuthal direction, recovering the anisotropy. This we will show to be crucial for accurate stray light removal (Sect. 2.3).
The relationship between the radiance of magnetic features in the photosphere, and their size and position on the solar disc, is an important consideration in understanding and modelling the variation in solar irradiance (Domingo et al. 2009). HMI returns continuous, seeing-free, full-disc observations of intensity, Doppler shift and magnetic field at a constant, intermediate spatial resolution (∼ 1 arcsec) and at relatively low noise. This renders it a suitable tool for constraining the radiant behaviour of photospheric magnetic features (Yeo et al. 2013). It is therefore of interest to enhance the quality of HMI observations by quantifying the stray light performance of the instrument. This would be of utility not only for the accurate examination of the radiant behaviour of magnetic features in HMI data but also any application that can benefit from stray light-free measurements of intensity, line-of-sight velocity and magnetic flux density.
The PSF presented here is, to our knowledge, the first onorbit measurement of the stray light of HMI reported in the literature (see Wachter et al. 2012, for the pre-launch measurement). This is necessary given that the exact operating conditions of the sensor cannot be exactly simulated on the ground. Also, the stray light of the HMI might have changed from the time of the pre-launch calibration from changes in the condition of the instrument.
The HMI comprises of two identical 4096 × 4096 pixel CCD cameras, denoted 'side' and 'front'. The PSF was retrieved from images recorded on the side CCD during the transit of Venus on June 5 to 6, 2012. In addition to this transit of Venus, the HMI has also witnessed several partial lunar eclipses (seven, as of the end of 2012). In Sect. 2.5 we discuss the reasons for choosing the observations of Venus in transit over data from the partial lunar eclipses or of the solar limb for constraining the PSF, even though Venus has an atmosphere which had to be taken into account in deriving the PSF, introducing additional complexity to the task and uncertainty to the final estimate of the PSF.
In the following section, we detail the data selection (Sect. 2.1), the PSF derivation (Sect. 2.2) and image restoration method (Sect. 2.3), and how we accounted for the influence of Venus' atmosphere (Sect. 2.4). Then, we verify the utility of the PSF presented here for image restoration, comparing the apparent gran- 1 The Michelson Doppler Imager onboard the Solar and Heliospheric Observatory (Scherrer et al. 1995). 2 The Broadband Filter Imager of the Solar Optical Telescope onboard Hinode (Kosugi et al. 2007). 3 The Transition Region And Coronal Explorer (Handy et al. 1998). ulation contrast in restored HMI observations and synthetic intensity maps generated from numerical simulation (Sect. 3.1). We illustrate the result of image restoration on the intensity, Dopplergram and magnetogram data products of the instrument, looking at its effect on the following.
-The intensity and magnetic field strength of small-scale magnetic concentrations (Sect. 3.2.1). -The intensity and magnetic field strength of sunspots and pores (Sect. 3.2.2). -The amount of magnetic flux on the solar surface (Sect. 3.2.3). -Line-of-sight velocity (Sect. 3.2.4).
The retrieved PSF represents the stray light behaviour of the side CCD at the time of the transit of Venus, at the position in the field-of-view (FOV) occupied by the Venus disc. In Sect. 4 we examine the applicability of this PSF to other positions in the FOV, and to observations from the front CCD as well as from other times. Finally, a summary of the study is given in Sect. 5.

Data selection
The HMI is a full-Stokes capable filtergram instrument. The instrument records full-disc polarimetric filtergrams continuously, at 3.75-s cadence, on the two identical CCDs. The filtergram sequence of the side CCD alternates between six polarizations (I ± Q, I ± U and I ± V) and six positions across the Fe I 6173 Å line (at ±34, ±103 and ±172 mÅ from line centre). A set of 36 filtergrams, of each polarization at each line position, is collected every 135-s. The front CCD collects a set of 12 filtergrams, covering the Stokes I + V and I − V polarizations at the same line positions, every 45-s. Dopplergrams, longitudinal magnetograms and intensity (continuum, and line depth and width) images, collectively termed the line-of-sight data products, are generated from the filtergram sequence of the side CCD at 720-s intervals, and from that of the front CCD at 45-s intervals. Stokes parameters (I, Q, U and V) and the corresponding Milne-Eddington inversion (Borrero et al. 2011) are also produced, at 720-s cadence, from the filtergram sequence of the side CCD.
During the transit of Venus on June 5 to 6, 2012, the side CCD recorded filtergrams in the nearby continuum (−344 mÅ from line centre), instead of the regular filtergram sequence. For the purpose of estimating the PSF of the instrument, we examined the 854 × 854 pixel crop, centred on the Venus disc, of 249 continuum filtergrams collected between second and third contact (i.e., the period the venusian disc was entirely within the solar disc). Care was taken to avoid filtergrams with pixels with spurious signal levels, a result of cosmic ray hits, on the venusian disc. The pixel scale was 0.504 arcsec/pixel. A summary description of this and the other HMI data employed in this study is given in Table 1.
When generating the various data products in the HMI data processing pipeline, filtergrams (from an interval of 1350-s for the 720-s data products and 270-s for the 45-s data products) are corrected for spatial distortion , cosmic ray hits, polarization crosstalk (Schou et al. 2012a) and solar rotation, and the filtergrams of similar polarizations averaged. These time-averaged filtergrams are then combined non-linearly to form the various data products (Couvidat et al. 2012). For the side CCD, these time-averaged filtergrams are outputted as the 720-s Stokes parameters product. As a consequence of the correction for spatial distortion, the apparent PSF is different in the unprocessed and time-averaged filtergrams. The non-linearity of the algorithms used to derive the data products means they cannot be corrected for stray light by the deconvolution with the PSF. Instead, their restoration must go via restoring the unprocessed or time-averaged filtergrams.
The 249 continuum filtergrams considered (and all the other filtergram data utilised in the rest of the study) were corrected for spatial distortion. The retrieved PSF therefore represents stray light in undistorted HMI observations. This allows the generation of stray light-free data products through the deconvolution of the PSF from the time-averaged filtergrams. For the line-ofsight data products, this means correcting just the time-averaged Stokes I + V and I − V at each line position, a total of 2 × 6 = 12 images in each instance, instead of all the unprocessed filtergrams, which numbers 360 and 72 for the 720-s and 45-s data products respectively.
In this study we assumed Venus to be a perfect sphere (Archinal et al. 2011). Radial distance and azimuth are denoted r and φ, respectively. Azimuth is taken anti-clockwise from the CCD column axis such that zero is up.
The spatial distribution of intensity on the venusian disc, predominantly instrumental scattered light (aperture diffraction and stray light), varied significantly over the course of the transit (Fig. 1). The figure gives the intensity on the venusian disc in the 249 continuum filtergrams, -as a function of radial distance from the centre of the venusian disc, averaged over all azimuths and normalized to the level at the point of inflexion (Î r , top panel), and -as a function of azimuth along the edge of the venusian disc as given by the point of inflexion onÎ r , normalized to the mean level (Î φ , bottom panel).
Also plotted are the meanÎ r andÎ φ of all the filtergrams, Î r and Î φ (red curves). The radius of the venusian disc as given by the point of inflexion onÎ r is, to 0.1 arcsec, constant at 29.5 arcsec.
The fluctuation in the intensity on the venusian disc over the course of the transit arises from changes in the solar background from granulation, p-mode oscillations and limb darkening, as well as the variation of the PSF with position in the FOV.
To quantify the variation in the spatial distribution of intensity on the venusian disc over the course of the transit, and the influence of the changing solar background and the variation of the PSF with position in the FOV, we computed, for each of the 249 continuum filtergrams, the following two quantities.
-The integral underÎ r from the centre of the venusian disc to the point of inflexion, Î r dr. The broader the PSF at a given position in the FOV, the brighter the venusian disc is relative to the level at its edge, and the greater this integral. -The root-mean-square or RMS difference betweenÎ φ and Î φ , RMSÎ φ − Î φ . The closer the agreement in the trend with azimuth betweenÎ φ and Î φ , the smaller this quantity. RMSÎ φ − Î φ reflects changes in the isotropy of the PSF (such as, from astigmatism and coma aberrations) and variation in the spatial distribution of intensity of the solar background.
Î r dr and RMSÎ φ − Î φ are plotted along the trajectory of the venusian disc, given in terms of the cosine of the heliocentric angle, µ = cos θ of the disc centre, as a function of time in Fig.  2.
Î r dr changed slowly but notably over the course of the transit and the variation appears to be uncorrelated to distance from solar disc centre (and therefore, limb darkening). This suggests that the width of the PSF varies significantly along the path of Venus in the FOV. RMSÎ φ − Î φ showed a marked point-to-point Intensity on the venusian disc in the 249 continuum filtergrams from the transit of Venus. Top: Intensity as a function of distance from the centre of the venusian disc, averaged over all azimuths and normalized to the level at the point of inflexion (dashed line),Î r . Bottom: Intensity versus azimuth along the edge of the venusian disc as given by the point of inflexion on I r , normalized to the mean level,Î φ . The red curves follow the meanÎ r andÎ φ of all the filtergrams, while the blue line repre-sentsÎ φ = 1.
fluctuation but is otherwise relatively low ( 0.1) and exhibits no obvious trend with time. This indicates that the azimuth dependence ofÎ φ and Î φ is mainly driven by a persistent PSF anisotropy along the path of Venus in the FOV rather than limb darkening (see also Sect. 2.2). The marked point-to-point fluctuation is likely from granulation and p-mode oscillations. This is supported by the comparatively smooth time variation of Î r dr, which is less sensitive to these small-scale intensity fluctuations in the solar background due to the averaging over all azimuths. From the trend of Î r dr and RMSÎ φ − Î φ with time, we surmise that the width of the PSF varies significantly along the path of Venus in the FOV and while the anisotropy of the PSF is relatively stable, it is obscured by granulation and p-mode oscillations in individual filtergrams. Based on these considerations, we retained just the 42 filtergrams highlighted in Fig. 2 (red circles), taken over a 40-minute period where Î r dr is relatively stable, for the derivation of the PSF. The selected filtergrams Fig. 2. The integral underÎ r , Î r dr (top), the RMS difference betweenÎ φ and Î φ , RMSÎ φ − Î φ (middle) and the position of the centre of the venusian disc in terms of the cosine of the heliocentric angle, µ = cos θ (bottom) as a function of time from 22:00:00 UTC, June 5, 2012. The red circles highlight the values for the filtergrams used to derive the PSF. The dashed lines mark the approximate time of the second and third contacts; the period between which the venusian disc was entirely within the solar disc from SDO's position.
were aligned by the venusian disc and the average, hereafter referred to as the mean transit image, taken. The objective is to derive an image of Venus in transit where the influence of granulation and p-mode oscillations is minimal by averaging filtergrams where the PSF at Venus' position in the FOV is fairly similar.
The 249 continuum filtergrams examined alternated between four polarizations (Stokes I + Q, I − Q, I + U and I − U). We found no systematic differences in the spatial distribution of intensity on the venusian disc between filtergrams of different polarizations and so made no distinction between them here. We repeated the analysis described in this subsection on the filtergrams recorded at the six regular wavelength positions, on the front CCD during the transit of Venus. There are systematic differences (in Î r dr and RMSÎ φ − Î φ ) between different positions, even between positions at similar distance from but opposite sides of the line centre. This suggests spectral line changes from effects unrelated to the stray light behaviour of the instrument may exert an influence on intensity measured on the venusian disc. Specifically, Doppler shifts from the motion of the spacecraft (SDO is in a geosynchronous orbit) and the rotation of the Sun. For this reason we restricted ourselves to the continuum filtergrams from the side CCD.

PSF derivation method
A bivariate polynomial function was fitted to the mean transit image. We excluded the circular area of 50 arcsec radii centred on the venusian disc (about three times the area of the venusian disc) from the regression. The extrapolation of the surface fit over this excluded area represents an estimate of the intensity if Venus had been absent. We filled a circular area in the surface fit, corresponding to the venusian disc, with zeroes. We will refer to the result, essentially a model of the mean transit image in the absence of an atmosphere in Venus, aperture diffraction and stray light, as the artificial image.
The PSF was determined by minimizing the chi-square between the convolution of the artificial image with a guess PSF and the mean transit image, in the circular area of 50 arcsec radii centred on the venusian disc. For this we employed the implementation of the Levenberg-Marquardt algorithm (LMA) included in the IDL Astronomy User's Library, mpfit2dfun.pro.
Intensity in the circular area was sampled at equal intervals in the radial (0.504 arcsec, the pixel scale) and azimuthal (1/360 radians) dimensions. This is to give intensity measured at each radius from the centre of the venusian disc more equal weight in the LMA optimization. The result is a closer agreement between the convolution of the artificial image with the guess PSF and the mean transit image on convergence than achieved by comparing the circular area in the artificial and mean transit images directly.
We scaled the artificial image by a factor prior to convolution with the guess PSF. We allowed this factor and the radius of the disc of zeroes in the artificial image to be free parameters in the LMA optimization, taking an initial value of unity (i.e., no scaling) and 29.5 arcsec (the position of the point of inflexion onÎ r ). This is to minimize error from any misestimation of the surface fit to the mean transit image and the radius of the venusian disc 4 .
Following the example of previous studies (Martínez Pillet 1992;Mathew et al. 2007Mathew et al. , 2009, we attempted to model the guess PSF as the linear sum of various combinations of Gaussian and Lorentzian functions. Except here we allowed the amplitude of each Gaussian and Lorentzian component to vary sinusoidally with azimuth to accommodate PSF anisotropy. We also tried to set the ideal diffraction-limited PSF as one of the components. The guess PSF we found to reproduce the measured intensity in the artificial image best, denoted K, is given by That is, the linear combination of five Gaussian functions, with weight w i and standard deviation σ i , the amplitudes of which vary sinusoidally with azimuth, with amplitude A i , period of 2πu i radians (where u i ∈ Z) and phase v i . Modelling the guess PSF as the linear combination of four Gaussian or three Gaussian and a Lorentzian, as done in the cited works, still reproduces measured intensity in the artificial image reasonably well. The retrieved PSFs are however, negative at parts (i.e., unphysical) from the LMA converging to solutions where |A i | > 1. And introducing additional sinusoidal terms to the azimuth dependence of each Gaussian and Lorentzian function did not alleviate this problem. The linear combination of five Gaussians appeared necessary to reach a physical solution while reproducing the measured intensity in the artificial image in both the radial and azimuthal dimensions.
The guess PSF was applied to the artificial image by evaluating K (Eqn. 1) at pixel scale intervals (0.504 arcsec) on a 251×251 grid, the centre element representing the origin (r = 0), and taking the convolution of the artificial image with the result. On convergence, the value at each grid element represents the integral of the PSF over the element. The retrieved PSF therefore describes the pixel integrated PSF. This was done, instead of filling the grid with the pixel integrated value of K, for a practical reason. When correcting HMI observations for stray light via deconvolution with the PSF, it is the pixel integrated PSF that is required.
Care was taken to repeat the LMA optimization, varying the initial value of the free parameters, to reduce the likelihood that the solution lies in a local chi-square minimum. To accommodate the requirement that u i ∈ Z, we executed the LMA optimization with no constraint on the value of u i , rounded the retrieved u i to the nearest integer and repeated the process with these parameters fixed.
The PSF derivation method described here implicitly assumes there is no interaction between solar radiation and the venusian atmosphere. We will qualify this statement, and detail the adjustments made to the artificial image and the mean transit image to account for the influence of the venusian atmosphere on the retrieved PSF in Sect. 2.4. The method also ignores motion blurring from the lateral movement of the venusian disc relative to the solar disc. The displacement of the venusian disc within the exposure time of the instrument is, on average, about 0.015 pixels and can therefore be neglected without significant loss of accuracy.
In the following, we denote the PSF retrieved as described above, a preliminary estimate of the stray light behaviour of the instrument, by K 1 . The retrieved value of the parameters of K 1 are listed in Table. 2. The best fit value of the scale factor applied to the artificial image is 1.0029, and the radius of the disc of zeroes, 29.29 arcsec. Though only a slight departure from the initial values (unity and 29.5 arcsec), this correction to the amplitude of the artificial image and the size of the disc of zeroes effected a marked improvement in the chi-square statistic.
In Fig. 3 we plot the intensity along different radii from the centre of the venusian disc; from the mean transit image (black curves) and reproduced in the artificial image by the convolution with K 1 (red curves). Also plotted is the intensity reproduced in the artificial image by fixing the A i at zero (blue curves). In this instance, the variation with azimuth arises solely from limb darkening, which enters the process through the surface fit to the mean transit image. Evidently, limb darkening alone cannot account for all the observed variation with azimuth, confirming that the PSF of the instrument is significantly anisotropic. By allowing the amplitude of each Gaussian component in the guess PSF to vary sinusoidally with azimuth, we are able to reproduce most of the observed intensity azimuth dependence. The close overall agreement between observed and reproduced intensities in the radial dimension is illustrated in Fig. 4.
Here we choose to describe the PSF as the linear combination of five Gaussian functions over more physically realistic models, such as the convolution of the diffraction-limited PSF with a Voigt function (Wedemeyer-Böhm 2008). Apart from yielding a closer agreement between the PSF-blurred artificial image and the mean transit image, this functional form is more Notes. The PSFs are given by the linear combination of five Gaussian functions (Eqn. 1), denoted by i, with weight w i and listed in ascending order by the standard deviation, σ i . The amplitude of each Gaussian component modulates sinusoidally with azimuth, with amplitude A i , period of 2πu i radians (where u i ∈ Z) and phase v i . There are no associated formal regression errors for u i , and in the case of K 2 , σ i=1 as the value of these parameters were fixed in the LMA optimization (see text).

Fig. 3.
Intensity on the venusian disc at distances of 6, 12 18 and 24 arcsec from the centre, and along its limb (taking the radius of the venusian disc retrieved along with K 1 by the LMA optimization, 29.29 arcsec), as a function of azimuth. The black curves follow the values from the mean transit image and the red curves the values reproduced in the artificial image by the convolution with K 1 . The blue curves represent the intensity obtained in the artificial image by fixing A i at zero. The intensity fluctuations along the venusian limb arises from aliasing artefacts.
amenable to incorporating the complex azimuthal dependence. The retrieved parameter values of K 1 (Table 2) and the azimuth dependence of measured intensity on the venusian disc at differ- -It allows solutions with Strehl ratios exceeding unity, which is unphysical. -The Fourier transform of the Gaussian function, and therefore the modulation transfer function (MTF) of such PSF models, is non-zero above the Nyquist limit. Correcting observations for stray light by the deconvolution with such a PSF can introduce aliasing artefacts from the enhancement of spatial frequencies above the Nyquist limit.
We will address these two potential issues in Sects. 2.4 and 3.1, respectively. The approach taken here to derive the PSF is broadly similar to that applied to images of Mercury in transit from Hinode/SOT/BFI by Mathew et al. (2009). Specifically, by minimising the difference between observed intensity and that pro-duced in a model of the aperture diffraction and stray light-free image (termed here the artificial image) by the convolution with a guess PSF. There are two significant departures.
Firstly, in this study, the artificial image is given by the surface fit to the mean transit image, with a disc of zeroes representing the venusian disc. In the cited work, the authors filled the mercurian disc in the recorded image with zeroes and took the result as the artificial image. As stated earlier in this subsection, having excluded the venusian disc and surroundings in the regression, the surface fit to the mean transit image is, in this excluded region, an approximation of the intensity had Venus been absent. For this we consider the approach taken here to yield a more realistic model of the instrumental scattered light-free image.
Secondly, as mentioned in the introduction, while the earlier effort assumed an isotropic form to the PSF, here we allowed the PSF to vary with azimuth. We were motivated by the observation that the stray light behaviour of the instrument is evidently anisotropic (Sect. 2.1 and Fig. 3).

Image restoration method
To correct HMI observations for aperture diffraction and stray light, we utilised the implementation of the Richardson-Lucy algorithm, RLA (Richardson 1972;Lucy 1974), included in the IDL Astronomy User's Library, max likelihood.pro.
The RLA is an iterative method for restoring an image blurred by a known PSF, in our study, the guess PSF, K. Let f k denote the estimate of the restored image from the k-th iteration, f k+1 is given by where the •, * and ⋆ symbols represent the pixel-by-pixel product, convolution and correlation, respectively. The method has been shown, empirically, for data obeying Poisson statistics, to converge towards the maximum likelihood solution (Shepp & Vardi 1982). Following Mathew et al. (2009), we employed a threshold for the chi-square between the original image and f k * K as the stopping rule. Here we set the threshold at 99.99% confidence level. In Figs. 5 and 6a we show the result of restoring one of the 42 continuum filtergrams averaged to yield the mean transit image (recorded at 02:25:37 UTC, June 6, 2012), hereafter referred to as the test transit image, with K 1 . The image restoration sharpened the test transit image considerably and removed most of the signal on the venusian disc. The restoration however, also left a ringing artefact around the venusian disc; manifest as the bright halo in the grey scale plot (middle panel, Fig. 5) and the peak in the radial intensity profile (black solid curve, Fig. 6a). Restoring other observations taken nearby in time (within a few hours of the test transit image), we found similar artefacts in the boundary of active region faculae, and sunspot penumbra and umbra. Mathew et al. (2009) in the similar study with images of Mercury in transit from Hinode/SOT/BFI noted similar ringing artefacts around the mercurian disc upon image restoration with the RLA. The authors attributed it to Gibb's phenomenon, ringing artefacts in the Fourier series representation of discontinuous signals. In the PSF derivation and image restoration process described here, discrete Fourier transforms, DFTs were executed in convolution and correlation computations. We found that repeating the derivation of K 1 and the restoration of the test transit image without performing any DFTs in the convolution and correlation computations had negligible effect on the ringing artefact, ruling out Gibb's phenomenon as the main cause in this instance. In the following subsection we will demonstrate the ringing artefact found here to arise from us not taking the interaction between solar radiation and the venusian atmosphere into account in deriving K 1 . Figure 7 is a colour scale plot of the venusian disc in the restored test transit image (left panel). The plot is saturated at about 2% of the mean photospheric level to reveal the spatial distribution of residual intensity (instrumental scattered light not removed by the image restoration) on the venusian disc. Also shown is the result of restoring the test transit image with K 1 excluding the anisotropy of the PSF by setting A i at zero (right panel). There is a gross, broadly east-west graduation of the residual intensity in the latter, not apparent in the former, where the residual intensity level is significantly more uniform across the venusian disc. This demonstrates the necessity to constrain the anisotropy of the PSF to properly correct HMI observations for instrumental scattered light.

Interaction between solar radiation and the venusian atmosphere
As stated in Sect. 2.2, the PSF derivation method described so far builds on the assumption that there is no interaction between solar radiation and the venusian atmosphere.
In representing the venusian disc as a disc of zeroes in the artificial image, we have presumed that the body would, in the absence of aperture diffraction and stray light, be completely dark and exhibit a discrete edge. Diffusion and scattering of solar radiation in the venusian atmosphere can, however, render the edge of the venusian disc diffused.
The PSF is retrieved from matching the mean transit image to the convolution of the artificial image and the guess PSF. This is valid if all measured intensity came directly from the Sun. This is, however, not the case; there is a bright halo around the venusian disc when it is in transit (termed the aureole) from the refraction of solar radiation by the upper layers of the atmosphere towards the observer.

Diffusion and scattering of solar radiation in the venusian atmosphere
To elucidate the influence of diffusion and scattering of solar radiation in the venusian atmosphere on the retrieved PSF we repeated the derivation, approximating the action of diffusion and scattering by blurring the edge of the disc of zeroes in the artificial image prior to the convolution with the guess PSF. We generated a copy of the artificial image that is unity everywhere outside the venusian disc and zero inside, convolved it with a Gaussian kernel, and scaled the original artificial image by the result. This procedure introduces Gaussian blur that is confined to near the edge of the disc of zeroes. We repeated the derivation of the PSF with different degrees of Gaussian blurring. In Fig. 8 (top panel) we display the PSFs retrieved after blurring the edge of the disc of zeroes with kernels representing Gaussian functions with standard deviations of 0.2, 0.3 and 0.4 arcsec (blue dotted, dashed and solid curves) along K 1 (black dashed curve). In Fig. 6b we have the radial intensity profile of the test transit image before and after image restoration with these PSFs. The stronger the blurring, the narrower the core of the PSF and the weaker the ringing artefact. The narrowest Gaussian kernel (0.2 arcsec) returned a PSF that is still very similar to K 1 while the broadest (0.4 arcsec) yielded a PSF that is unphysical, significantly narrower at the core than the ideal diffraction-limited PSF. As the Gaussian blurring is confined to near the edge of the disc of zeroes, the retrieved PSFs do not differ significantly from K 1 beyond a few arcseconds from the centre of the PSF.

Refraction of solar radiation in the venusian atmosphere
We estimated the contribution by the aureole to apparent intensity in the mean transit image. For this purpose we examined the 854 × 854 pixel crop, centred on the venusian disc, of a continuum filtergram taken shortly (∼ 10 seconds) before the venusian disc moved completely into the solar disc (recorded at 22:25:33 UTC, June 5, 2012), hereafter referred to as the ingress image.
The ingress image is expressed as a grey scale plot in Fig. 9. The aureole is only directly observable at ingress and egress (i.e., when the venusian disc is only partially within the solar disc), in the part of the venusian disc outside the solar disc. This is because the aureole is much dimmer than the photosphere and therefore difficult to distinguish from direct solar radiation. Generally, the intensity of the aureole increases with the proportion of the venusian disc sitting inside the solar disc (Tanga et al. 2012). Therefore, observations taken right before second contact (such as the ingress image) or right after third contact give the closest direct indication of the intensity of the aureole when the venusian disc is entirely within the solar disc. The intensity of the aureole also varies with azimuth. This is, at least in part, because it is modulated by the spatial distribution of photospheric intensity (Tanga et al. 2012) and variation in the physical struc-ture of the venusian atmosphere with latitude (Pasachoff et al. 2011).
Here we looked at the intensity of the aureole in the ingress image over the minor sector marked in Fig. 9 (blue lines), where it is relatively stable with azimuth.
The radial intensity profile over the minor sector marked in Fig. 9 is plotted in Fig. 10 (circles, top panel). The peak near the edge of the venusian disc (dashed line) corresponds to the aureole while the slowly varying background is largely instrumental scattered light from the solar disc. We subtracted the polynomial fit to the background (red curve) from the radial intensity profile. To the background-subtracted radial intensity profile (circles, bottom panel) we fit the linear combination of two Gaussian functions (blue curve). We then scaled this fit by the quotient of the integrated photospheric intensity behind the venusian disc in the mean transit image and in the ingress image 5 . The result (green curve) represents an estimate of the radial intensity profile of the aureole in the mean transit image.
In Fig. 8 (middle panel) we compare the PSF retrieved after first subtracting the estimated radial intensity profile of the aureole from the mean transit image (green curve) with K 1 (black dashed curve). In Fig. 6c we have the radial intensity profile in the test transit image, before and after image restoration with this PSF. The effect of removing the contribution by the aureole to observed intensity on the retrieved PSF and the ringing artefact in the restored test transit image is similar as that from introducing Gaussian blur to the edge of the disc of zeroes in the artificial image. The retrieved PSF is slightly narrower than K 1 at the core. The ringing artefact in the restored test transit image is slightly weaker. As the aureole is concentrated near the edge of the venusian disc, removing it from the mean transit image made little difference to the retrieved PSF beyond a few arcseconds from the core.
In removing the contribution of the aureole from the mean transit image as described above, we have made two simplifying assumptions: Fig. 6. Top: Radial intensity in the test transit image, corrected for limb darkening, as a function of distance from the centre of the venusian disc before (black dotted curves) and after image restoration with the various PSF estimates. a) With K 1 (black solid curve). b) With the PSFs obtained by blurring the edge of the disc of zeroes in the artificial image with kernels representing Gaussian functions with standard deviations of 0.2, 0.3 and 0.4 arcsec (blue dotted, dashed and solid curves). c) With the PSF retrieved by subtracting the estimated aureole intensity from the mean transit image (green solid curve). d) With K 2 (red solid curve). Middle and bottom: Blow-up insets of the boxed areas. The radius of the venusian disc, a free parameter in the LMA optimization, is in all instances about 29.3 arcsec and not marked to avoid cluttering. The horizontal dashed lines follow unit intensity. The test transit image was corrected for limb darkening by normalizing it by the surface fit, computed as done for the mean transit image in Sect. 2.2.
-One, that the intensity of the aureole is directly proportional to the integrated photospheric intensity behind the venusian disc. -Two, that the intensity of the aureole does not change with azimuth. Tanga et al. (2012) recently published a model of aureole intensity, relating it to the spatial distribution of photospheric intensity and physical structure of the venusian atmosphere. This is, to our knowledge, the only model of its kind reported in the literature. Given the fact that the aureole is blurred by instrumental scattered light, the uncertainties over the structure of the venusian atmosphere, and in the interest of simplicity, we favoured the rather approximate approach taken here over a more rigorous computation based on the model of Tanga et al. (2012). The estimated peak intensity of the aureole in the mean transit image is about 1500 DN/s (blue curve, Fig. 10), much smaller than the photospheric level (∼ 5 × 10 4 DN/s, Fig. 4). Taking into account this as well as the relatively minor effect of subtracting the radial intensity profile of the aureole from the mean transit image on the retrieved PSF, we surmise that the uncertainty introduced by the two assumptions listed is likely minimal.
By repeating the derivation of the PSF and restoration of the test transit image, first blurring the edge of the disc of zeroes in the artificial image or subtracting the estimated contribution by the aureole to the mean transit image, we have demonstrated that the interaction between solar radiation and the venusian atmosphere has a palpable impact on the width of the core of the retrieved PSF. Both adjustments yielded PSFs that were narrower at the core compared to K 1 (Fig. 8). And the narrower the core of the PSF, the weaker the ringing artefact in the restored test transit image (Fig. 6). The width of the core of K 1 , derived with no consideration of the venusian atmosphere, is over-estimated and the over-sharpening this produces when used to restore HMI data shows up as ringing artefacts near where the signal is changing rapidly.

Final estimate of the PSF
We arrived at our final estimate of the PSF by making the following changes to the derivation procedure described in Sect. 2.2.

Fig. 8.
Comparison between K 1 (black dashed curves), the ideal diffraction-limited PSF (black solid curves) and the other retrieved PSFs. The blue curves (top) represent the PSFs retrieved after blurring the edge of the disc of zeroes in the artificial image by kernels representing Gaussian functions with standard deviations of 0.2 (dotted), 0.3 (dashed) and 0.4 arcsec (solid). The green curve (middle) corresponds to the PSF found by subtracting the estimated aureole intensity from the mean transit image. The red curve (bottom) corresponds to K 2 . For illustration purposes, we set the value of A i at zero (i.e., ignoring the azimuthal dependence) and normalized each PSF to the level at r = 0. As the retrieved PSFs represent estimates of the pixel integrated true PSF, the ideal diffraction-limited PSF was smoothed with a box function of pixel scale width to allow a direct comparison.
-Firstly, we subtracted the estimate of the radial intensity profile of the aureole from the mean transit image. -Secondly, we blurred the edge of the disc of zeroes in the artificial image with a Gaussian kernel, the width of which we allowed to be a free parameter in the LMA optimization. -Lastly, we fixed the width of the narrowest Gaussian component in the guess PSF such that the full width at half maximum, FWHM of the component is similar to that of the pixel-integrated ideal diffraction-limited PSF. The pixel integration was achieved by smoothing the ideal diffractionlimited PSF with a box filter of HMI pixel scale width. The edge of the venusian disc (as given by the point of inflexion onÎ r ) and of the solar disc are indicated by the red and green contours respectively. They do not coincide with the apparent boundaries due to the low grey scale saturation level. The grey scale is saturated at 3000 DN/s (∼ 5% of the mean photospheric level at disc centre) to allow the aureole, the bright arc on the part of the venusian disc outside the solar disc, which is much dimmer than the solar disc, to be visible. The blue lines mark the minor sector within which the intensity of the aureole is relatively stable with azimuth. The bright feature on the northwest quadrant of the venusian disc is an artefact of cosmic ray hits on the CCD.
The parameters of the PSF so derived, hereafter referred to as K 2 , are summarized in Table 2. The adjustments to the PSF derivation procedure yielded a PSF that is significantly narrower at the core compared to K 1 , though not more than the ideal diffractionlimited PSF (bottom panel, Fig. 8). The agreement between the aureole-subtracted mean transit image, and the convolution of the Gaussian-blurred artificial image with K 2 is similar as in the K 1 instance, illustrated in Figs. 3 and 4, and therefore not plotted here.
The best fit value of the scale factor applied to the artificial image is 1.0028 and the radius of the disc of zeroes 29.33 arcsec. The retrieved standard deviation of the Gaussian kernel is 0.26 arcsec. The scale height of the venusian atmosphere, at 15.9 km or approximately 0.08 arcsec, is of similar order. The degree of Gaussian blurring introduced is, as far as one can infer from such a comparison, physically plausible.
The intention here is to recover a conservative estimate of the PSF, making use of the fact that the PSF of the instrument cannot be narrower at the core than the ideal diffraction-limited PSF. Also, it was necessary to fix the width of the narrowest Gaussian component as allowing both this and the standard deviation of the Gaussian kernel to be free parameters leads to a degener- Fig. 10. Intensity in the ingress image, averaged over the minor sector marked in Fig. 9, as a function of distance from the centre of the venusian disc (circles); before (top panel) and after (bottom panel) subtracting the polynomial fit to the slowly varying background (red curve). The blue curve corresponds to the sumof-two-Gaussians fit to the background-subtracted series, while the green curve is the same after scaling by the quotient of the total photospheric intensity behind the venusian disc in the mean transit image and in the ingress image. The black dashed and dotted lines denote the position of the Venus limb (as given by the point of inflexion onÎ r ) and the zero intensity level, respectively. acy of the LMA optimization 6 . Though a conservative estimate, restoring the test transit image with K 2 still removed most of the intensity on the venusian disc while largely suppressing the ringing artefacts (Figs. 5 and 6d).
As stated in Sect. 2.2, a potential hazard of modelling the PSF as the linear combination of Gaussian functions is that it allows solutions with Strehl ratios greater than unity. This functional form is only appropriate when the weight and width of the broader Gaussian components, representing the non-ideal contribution to the PSF (instrumental effects other than aperture diffraction) are sufficiently high to avoid this (Wedemeyer-Böhm 2008). As evident in Fig. 11, this is indeed the case here for both K 1 (dashed curve) and K 2 (red curve). The greater integral under both PSFs compared to the pixel-integrated ideal diffractionlimited PSF, all normalized to the level at r = 0, indicates Strehl ratios of less than unity. (We cannot compute the Strehl ratio of K 1 and K 2 directly as they describe the pixel-integrated PSF.) 6 Specifically, the LMA converged to different solutions for the PSF, some of which are narrower at the core than the ideal diffraction-limited PSF, depending on the initial value of the free parameters. Fig. 11. As in Fig. 8 (bottom panel), but with the PSF on a logarithmic scale and over an extended radial range.

Partial lunar eclipse and solar limb observations
As stated in the introduction, we consider the observations of Venus in transit the most appropriate available for recovering the PSF of the HMI, preferring them over data from partial lunar eclipses and of the solar limb.
It is challenging to constrain the PSF in both the radial and azimuthal dimensions with data from partial lunar eclipses due to the combination of the geometry, as well as jitter and defocus issues brought on by the lunar occultation itself.
-The radius of curvature of the terminator, the edge of the lunar disc, is much greater than the width of the PSF. So at any given point along the terminator, the spatial distribution of signal smeared onto the lunar disc largely reflects the PSF in the direction of the centre of curvature. Therefore, a given partial lunar eclipse image only contains information about the PSF within a limited range of azimuths. Circumventing this limitation by looking at multiple images with the terminator at different orientations is not straightforward due to the variation of the PSF with position in the FOV. -The terminator is uneven from lunar terrain. This makes it complicated to model the aperture diffraction and stray lightfree image as we did here for the mean transit image with the artificial image (Sect. 2.2). A possible solution is to reduce the problem from 2D to 1D by looking at the radial intensity profile over segments of the terminator relatively free of lunar terrain features. This is, however, only appropriate when the terminator is near solar disc centre, where we can take the solar background to be uniform. -The image stabilization system, ISS of the instrument was not always functional during the partial lunar eclipses due to the lunar disc blocking the diodes necessary for its operation, increasing the jitter. -Having the lunar disc occult a significant proportion of the solar disc, and therefore greatly reducing the amount of impinging radiation, causes the front window of the instrument to cool, resulting in defocus (Schou et al. 2012b). -There are observations made when the lunar disc was just starting to cover the solar disc and not blocking the ISS diodes. These data do not suffer jitter and defocus problems, but we cannot resolve the lunar terrain issue by reducing the problem from 2D to 1D as described above, as the variation in the solar background from limb darkening is significant here.
Our approach in this study is to constraint the PSF by the spatial distribution of intensity about a closed bright and dark boundary as this allows us to recover the full azimuthal dependence (i.e., all directions). For this we can either employ observations of Venus in transit or of the solar limb. The PSF of HMI likely varies with position in the FOV, as shown for the part of the FOV transversed by Venus in Sect. 2.1. The longer the boundary used to constrain the PSF, the greater the contribution by the variation of the PSF with position in the FOV to observed intensity fluctuation along and near the boundary, which introduces bias to the retrieved PSF. The venusian disc occupies only about 0.06% of the FOV by area, and the solar disc, over 60%. The variation of the PSF over the part of the FOV occupied by the venusian disc is likely minimal, making these observations more suited for the purpose.
In view of the issues associated with deducing the PSF from partial lunar eclipse and solar limb data, we utilised the observations of Venus in transit though the interaction between solar radiation and the venusian atmosphere is challenging to account for, leaving us with only a conservative estimate of the PSF (Sect. 2.4).

Granulation contrast
Restoring HMI data with K 2 is not exact. This is due to the approximate account of the influence of the venusian atmosphere in the derivation of K 2 (Sect. 2.4) and from applying a single PSF to the entire FOV (so ignoring the variation of the PSF with position in the FOV, discussed in detail in Sect. 4.1). In this subsection we examine the effect of image restoration with K 2 on apparent granulation contrast, represented by the RMS intensity contrast of the quiet Sun 7 . We compare the values deduced from HMI continuum observations and from synthetic intensity maps generated from a 3D MHD simulation. The purpose is to demonstrate that image restoration with K 2 , with all its limitations, still yields reasonable estimates of the aperture diffraction and stray light-free intensity contrast. The side CCD continued to observe in the continuum for about an hour after the end of the transit of Venus. For this analysis we employed a continuum filtergram from this period (recorded at 04:35:59 UTC, June 6, 2012), hereafter referred to as the test continuum filtergram. Of the various types of data available from HMI, the continuum filtergram represents the closest to a near instantaneous continuum capture (exposure time of ∼ 0.135 seconds). This implies minimal loss of apparent contrast from averaging in time. It is worth noting however, that the continuum bandpass (−344 mÅ from line centre), whilst close to the clean continuum, may be slightly affected by the far wing of the Fe I 6173 Å line.
The intensity contrast of pixels corresponding to quiet Sun in the test continuum filtergram was computed largely following the method of Yeo et al. (2013), who examined the intensity contrast of small-scale magnetic concentrations utilizing the 45s continuum intensity and line depth data products from the front CCD. As in the cited work, the intensity contrast at a given image pixel is defined here as the normalized difference to the mean quiet-Sun intensity. 7 Intensity variation in the quiet Sun arises mainly from granulation. First, we identified magnetic activity present using the 45-s longitudinal magnetogram from the front CCD closest in time (< 1 minute) to the test continuum filtergram 8 . Let B l /µ denote the magnetogram signal, the mean line-of-sight magnetic flux density within a given image pixel, corrected (to first order) for foreshortening by the quotient with µ. The magnetogram was resampled to register with the test continuum filtergram. Image pixels in the test continuum filtergram corresponding to points where | B l |/µ > 10 G in the resampled magnetogram were taken to contain significant magnetic activity and masked, leaving quiet Sun.
The test continuum filtergram was corrected for limb darkening by normalizing it by a fifth order polynomial in µ fit to the quiet Sun pixels (following Neckel & Labs 1994). Let I/I 0 denote the limb darkening corrected intensity. Next, we derived the mean I/I 0 of the quiet Sun, I/I 0 QS as a function of position on the solar disc. As similarly noted for the 45-s continuum and line depth data products by Yeo et al. (2013), there are distortions in HMI filtergrams such that I/I 0 QS is not at unity but varying with position on the solar disc. (This is not to be confused with the spatial distortion present in HMI data discussed in Sect. 2.1.) We sampled the solar disc at 16-pixel intervals in both the vertical and horizontal directions. At each sampled point, we retrieved the median intensity of all the quiet Sun pixels inside a 401×401 pixel window centred on the point. We then fit a bivariate polynomial surface to the values so obtained from the entire disc. This surface describes I/I 0 QS as a function of position on the solar disc. The intensity contrast at a given image pixel is then given by the value of I/I 0 I/I 0 QS − 1 there. Finally, we derived the RMS intensity contrast of the quiet Sun as a function of µ. To this end we grouped the quiet Sun pixels by µ in bins with a width of 0.01 and took the RMS intensity contrast within each bin. The results are expressed in Fig. 12 (black curve). Also plotted are the values from first restoring the test continuum filtergram with K 1 (blue curve), and with K 2 (red curve). Quiet Sun pixels near the limb (µ < 0.2) were excluded. Towards the limb, the spread in measured intensity contrast in HMI data is dominated by scatter from the combination of the diminishing signal-to-noise ratio and the limb darkening correction (Yeo et al. 2013).
The decline in granulation contrast with distance from disc centre, seen here for the test continuum filtergram, is a known, well reported phenomenon (see Sánchez Cuberes et al. 2000Cuberes et al. , 2003, and references therein). Also within expectation, image restoration resulted in greater RMS contrasts, by a factor of about 2.6 near limb in the K 1 instance, going up to 3.2 at disc centre, and going from 1.9 to 2.2 for K 2 .
The apparent granulation contrast is not only significantly enhanced by image restoration but also rather sensitive to differences between K 1 and K 2 . This makes the RMS intensity contrast of the quiet Sun a suitable check of the goodness of K 2 for the restoration of HMI data. We compared the values obtained here with values from synthetic intensity maps, artificial images of the quiet Sun produced from a numerical simulation. To this end, synthetic Stokes spectra were generated by applying the LTE radiative transfer package SPINOR/STOPRO (Solanki 1987;Frutiger et al. 2000), to snapshots of a 3D MHD simulation performed with the MURaM code (Vögler 2003 ;  Fig. 12. RMS intensity contrast of the quiet Sun in the test continuum filtergram as a function of µ, before (black curve), and after image restoration with K 1 (blue curve) and with K 2 (red curve). The black circles represent the values from the synthetic intensity maps and the green circles the same, rescaled to reflect the proportion arising from spatial frequencies up to the cutoff spatial frequency of the restored (with K 2 ) test continuum filtergram (see text). Vögler et al. 2005), as done in, for example, Danilovic et al. (2010Danilovic et al. ( , 2013. The simulation, set up as in Danilovic et al. (2013), represents a layer encompassing the solar surface in the quiet Sun. The mean vertical magnetic flux density is 50 G. The simulation ran over about 23 minutes solar time after reaching a statistically steady state. Synthetic Stokes profiles were computed for ten snapshots of the simulation output, recorded at intervals of approximately two minutes solar time. From each snapshot we produced nine synthetic intensity maps corresponding to µ of 0.2, 0.3, 0.4 and so on, up to 1.0, rotating the snapshot along one dimension. The computational domain of the simulation spans 6 × 6 Mm in the horizontal, 1.4 Mm in depth, the top of the box lying about 0.5 Mm above the mean optical depth unity level, in a 288 × 288 × 100 grid. This translates into a pixel scale of (0.0287µ) arcsec and 0.0287 arcsec, in the rotated and static direction, in the synthetic intensity maps.
The Stokes I and Q components of the synthetic spectra were convolved with a Gaussian function with a FWHM of 75 mÅ and sampled at −327 mÅ from the centre of the Fe I 6173 Å line in order to yield synthetic intensity maps mimicking the polarization (Stokes I +Q) and bandpass of the test continuum filtergram. The FWHM and central wavelength of the continuum bandpass were estimated from the main lobe of the CCD centre filter transmission profile 9 .
The synthetic intensity maps were resampled in the foreshortened direction such that the pixel scale is similar along both dimensions. The RMS contrast of a given intensity map is given by the RMS value of I I − 1 over all points, I denoting the mean intensity of the map. The mean RMS contrasts from the synthetic intensity maps at each µ level for which we simulated 9 The filter transmission profiles of the HMI varies slightly with position in the CCD. The central wavelength of the main lobe, at −327Å from line centre, differs from the bandpass position of −344Å stated earlier. Quoted bandpass positions for HMI are theoretical figures derived assuming the filter transmission profiles are delta functions. data are plotted along the measured values from the test continuum filtergram in Fig. 12 (black circles).
The RMS intensity contrast of the quiet Sun in the test continuum filtergram and the synthetic intensity maps cannot be compared directly due to the gross difference in the pixel scale (0.504 versus 0.0287 arcsec). Resampling the synthetic intensity maps to HMI's pixel scale is not feasible as the resampled synthetic intensity maps will extend only 16 × 16 pixels in the µ = 1.0 case, going down to 3 × 16 pixels for µ = 0.2. Simulations with considerably larger computational domains are necessary to yield synthetic intensity maps from which we can compute the RMS contrast at HMI's pixel scale with statistical confidence. What we did instead was to estimate, by comparing the power spectra of the synthetic intensity maps and the test continuum filtergram, the contribution to intensity variations in the synthetic intensity maps by spatial frequencies up to the resolution limit of the test continuum filtergram.
In Fig. 13 we plot the encircled energy of the power spectrum of the 361 × 361 pixel crop, centred on solar disc centre, of the test continuum filtergram. There are no sunspots present in this crop. We define the cutoff spatial frequency as the spatial frequency at which the encircled energy of the power spectrum reaches 0.99, taken here as an indication of the resolution limit. The cutoff spatial frequency is 0.75 cycle/arcsec for the original test continuum filtergram (black curve), and 0.79 cycle/arcsec and 0.78 cycle/arcsec for the iterations restored with K 1 (blue curve) and with K 2 (red curve).
As mentioned in Sect. 2.2, image restoration with a PSF that is the linear combination of Gaussian functions can potentially introduce aliasing artefacts from the enhancement of spatial frequencies above the Nyquist limit (0.99 cycle/arcsec for HMI). While image restoration with K 1 and K 2 enhanced image contrast, indicated here by the rightward displacement of the encircled energy profile for the restored iterations of the test continuum filtergram, it made little difference to the resolution limit which is also significantly lower than the Nyquist limit. Even after image restoration, almost all energy is confined to spatial frequencies well below the Nyquist limit. Aliasing artefacts from the restoration, if present, are likely negligible.
At each µ level for which we generated synthetic intensity maps, we computed the power spectrum of each intensity map and then the encircled energy of the mean power spectrum. Following that we estimated the encircled energy at the spatial cutoff frequency of the restored (with K 2 ) test continuum filtergram, illustrated in Fig. 13 for µ = 1.0. The encircled energy here gives the proportion of observed intensity variation in the synthetic intensity maps arising from spatial frequencies up to the spatial cutoff frequency of the test continuum filtergram. The product of this quantity with the RMS intensity contrast of the quiet Sun from the synthetic intensity maps (green circles, Fig.  12) then represents an approximation of the RMS contrast if the spatial resolution of the synthetic intensity maps were similar to that of the test continuum filtergram. This treatment is very approximate, ignoring the fact that the spatial frequency response of the test continuum filtergram and synthetic intensity maps, up to the cutoff, are in all likelihood not similar.
In this analysis we had, -defined the cutoff spatial frequency as the level where the encircled energy of the power spectrum reaches 0.99, and -used the cutoff spatial frequency of the copy of the test continuum filtergram restored with K 2 to find the factors by which to rescale the RMS intensity contrast of the synthetic intensity maps (as the comparison between this restored ver- Fig. 13. The encircled energy of the power spectrum of the 361 × 361 pixel inset, centred on the centre of the solar disc, of the test continuum filtergram, before (black), and after image restoration with K 1 (blue) and with K 2 (red). The green series gives the encircled energy of the mean power spectrum of the synthetic intensity maps corresponding to µ = 1.0. The vertical dashed line marks the cutoff spatial frequency (see text) of the restored (with K 2 ) test continuum filtergram and the horizontal dashed line the encircled energy of the mean power spectrum of the µ = 1.0 synthetic intensity maps at this spatial frequency. The dotted line denotes encircled energy of unity.
sion of the test continuum filtergram and the synthetic intensity maps is of greatest interest).
As stated above, the restoration of the test continuum filtergram made little difference to the cutoff spatial frequency. Also, the encircled energy of the power spectrum of the synthetic intensity maps does not vary strongly with spatial frequency in the regime of the cutoff spatial frequency of the test continuum filtergram, as visibly evident for the µ = 1.0 example in Fig. 13. Hence, tests showed that the level of the rescaled RMS contrast is not sensitive to small variations in the threshold encircled energy level chosen in the definition of the cutoff spatial frequency. The result is also not changed significantly if we employ the cutoff spatial frequency of the unrestored and restored with K 1 versions of the test continuum filtergram to derive the rescaling factors instead.
The RMS intensity contrast of the quiet Sun in the restored (with K 2 ) test continuum filtergram (red curve, Fig. 12) and in the synthetic intensity maps, rescaled as described above (green circles), are of gratifyingly similar magnitude, less than or close to 0.01 apart at most µ, especially near disc centre. They do, however, differ in that the latter exhibits a steeper decline with distance from disc centre. The diverging trend with decreasing µ is likely, at least in part, from -the approximate way of accounting for the influence of the venusian atmosphere in the derivation of K 2 (Sect. 2.4), -applying a single PSF to the entire FOV, so ignoring the variation of the PSF with position in the FOV (discussed in detail in Sect. 4.1), -the difference in the spatial frequency response of the test continuum filtergram and the synthetic intensity maps, -sensor noise and its centre-to-limb variation (CLV), and -Doppler shift of the spectral line from the motion of SDO and the rotation of the Sun, which may produce small, µ-dependent effects on apparent intensity in the continuum bandpass through the line wing.
The observation that these two series are close, even with these factors present, confers confidence that image restoration with K 2 , though not exact, returns a reasonable approximation of the true aperture diffraction and stray light-free intensity contrast. A quantitative comparison of the RMS intensity contrast of the quiet Sun presented here for HMI and other measurements reported in the literature would require taking into account instrumental differences such as the spatial resolution and bandpass, which is beyond the scope of this study. Due to HMI's limited spatial resolution, the RMS contrast, even after image restoration with K 2 , remains below the values returned from spaceborne and balloon-borne (i.e., similarly seeing-free) observatories at finer spatial resolutions, namely Hinode (Danilovic et al. 2008;Mathew et al. 2009; Wedemeyer-Böhm & Rouppe van der Voort 2009) and SUNRISE (Hirzberger et al. 2010). (Note though, that the divergence is also due in part to the different bandpass of the various instruments.)

Effect of image restoration on the Dopplergram, longitudinal magnetogram, continuum intensity and line depth data products
In this subsection we discuss the effect of image restoration with K 2 on the Dopplergram, longitudinal magnetogram, continuum intensity and line depth data products. We examine the influence on the apparent continuum and line-core intensity, and magnetic field strength of small-scale magnetic concentrations, as well as sunspots and pores. We will also describe the result of image restoration on the apparent amount of magnetic flux on the solar surface and the line-of-sight velocity. For this purpose we utilised a set of simultaneous (generated from the same sequence of filtergrams) 720-s Dopplergram, longitudinal magnetogram, continuum intensity and line depth images from the side CCD, taken shortly after this CCD resumed collection of the regular filtergram sequence, about an hour after Venus left the solar disc (at 05:35:32 UTC, June 6, 2012). Here we will refer to the result of subtracting the line depth image from the continuum intensity image, giving the intensity in the Fe I 6173 Å line, as the line-core intensity image.
As mentioned in Sect. 2.1, HMI data products cannot be corrected for stray light by the deconvolution with the PSF but instead we must correct either the Stokes parameters or the filtergrams used to compute the data products. The data set was restored for stray light by applying image restoration with K 2 to the corresponding 720-s Stokes parameters, and returning the result to the HMI data processing pipeline. A 200 × 200 pixel inset of the original and restored version of the data set, near disc centre (µ > 0.93), featuring active region NOAA 11494, is shown in Fig. 14. The enhanced image contrast and visibility of small-scale structures is clearly evident.
The 720-s Milne-Eddington inversion data product includes the vector magnetogram. Since the inversion procedure employed to obtain this data product assumes a magnetic filling factor of unity everywhere, the process treats noise in the Stokes Q, U and V parameters as signal, creating pixel-averaged horizontal magnetic field strengths of ∼ 100 G in the vector magnetogram even in the very quiet Sun. For ease of interpretation we confined ourselves to the longitudinal magnetogram data product here. 720-s data products examined, before (top) and after (bottom) image restoration with K 2 . The grey scale is saturated at −1200 and 1200 ms −1 for the Dopplergrams, at −100 and 100 G for the longitudinal magnetograms, and at 0.6 and 1.2 for the continuum and line-core intensity images. The Dopplergram was corrected for the velocity of SDO relative to the Sun and for differential rotation (Sect. 3.2.4). Both the continuum and line-core intensity images were normalized to the mean quiet-Sun level (Sect. 3.2.1). The red and blue contours in the grey scale plot of the uncorrected longitudinal magnetogram and continuum intensity image follow I/I 0 = (I/I 0 ) QS,P , the quiet Sun to penumbra boundary. The colour coding is to distinguish the big sunspot feature (red) from the smaller sunspots and pores (blue), treated separately in Fig. 17.

Intensity contrast and magnetogram signal of small-scale magnetic concentrations
Both the original and restored continuum and line-core intensity images were normalized by the fifth order polynomial in µ fit to the quiet Sun pixels. Then the intensity contrast at each image pixel was computed following the procedure applied to the test continuum filtergram in Sect. 3.1. For the line-core intensity image, the normalization not only corrects for limb darkening, but also the centre-to-limb weakening of the Fe I 6173Å line (Norton et al. 2006;Yeo et al. 2013). Sunspots were identified by applying a continuum intensity threshold representing the quiet Sun-to-penumbra boundary, denoted (I/I 0 ) QS,P . We took the threshold value for MDI continuum intensity images, taken at 6768 Å, from Ball et al. (2012), 0.89, and estimated the equivalent level at HMI's wavelength, 6173 Å. Assuming sunspots to be perfect blackbodies and an effective temperature of 5800 K for the quiet Sun, the result is a threshold value of 0.88. This is a crude approximation, ignoring the difference in spatial resolution and variation in the continuum formation height with wavelength (Solanki & Unruh 1998;Sütterlin et al. 1999;Norton et al. 2006). Pores were also isolated by the application of this threshold. In the following we count these features to the sunspots and do not mention them separately.
We selected the image pixels where µ > 0.94 (i.e., near disc centre), excluding sunspots (i.e., all points with I/I 0 < (I/I 0 ) QS,P ) and all points within three pixels of a sunspot. The selected points were binned by | B l |/µ such that we end up with 800 bins of equal population. We then took the mean | B l |/µ, as well as the median continuum and line-core intensity con-trast within each bin. The values for the uncorrected and restored copy of the data set are represented by the black and red curves respectively in Fig. 15. These profiles depict the intensity contrast of small-scale magnetic concentrations as a function of | B l |/µ, which serves as an approximate proxy of the magnetic filling factor (Ortiz et al. 2002;Yeo et al. 2013), in the continuum and core of the Fe I 6173 Å line. This is effectively a repeat of part of the analysis of Yeo et al. (2013), except now on HMI observations corrected for aperture diffraction and stray light.
Comparing the magnetogram with the continuum intensity image, we found the magnetogram signal associated with sunspots to extend beyond the continuum intensity boundary, given by the I/I 0 = (I/I 0 ) QS,P locus (for example, in Fig. 14). This was similarly noted by Yeo et al. (2013), who attributed it to the encroachment of the magnetic canopy of sunspots, and the smearing of polarized signal originating from sunspots onto its surrounds by instrumental scattered light. Hence, close to sunspots, the magnetogram signal is not entirely from local, nonsunspot magnetic features alone and would introduce a bias into the intensity contrast versus | B l |/µ profiles (Fig. 15) if left unaccounted for. In the cited work pixels contiguous to sunspots and with | B l |/µ above a certain threshold level were masked. Here, we excluded only all points within three pixels of each sunspot, observing that excluding pixels further than this distance made no appreciable difference to the resulting intensity contrast versus | B l |/µ profiles. This measure is sufficient here as, unlike in the earlier study which examined almost all disc positions (µ > 0.1), we are only looking at image pixels near disc centre (µ > 0.94). Near disc centre, the influence of magnetic canopies, which are largely horizontal, on the longitudinal mag- Fig. 15. The continuum (top) and line core (bottom) intensity contrast of small-scale magnetic concentrations, near disc centre (µ > 0.94), as a function of | B l |/µ. The black and red curves correspond to the values from the original and restored (with K 2 ) data sets, respectively. netogram signal near sunspots is not as significant or extensive as at disc positions closer to the limb.
The continuum and line-core intensity contrast versus | B l |/µ profile of small-scale magnetic concentrations near disc centre presented here for the uncorrected data set (black curves, Fig. 15) is nearly identical to that by Yeo et al. (2013) (Figs. 9 and 10 in their paper), who employed similar data and method of derivation. The profiles from the restored data set (red curves) span a wider range, by a factor of about 1.3 in the continuum and line-core intensity contrast, and 1.7 in | B l |/µ, but are qualitatively similar in form.
Image restoration produced an absolute increase in the continuum and line-core intensity contrast everywhere except around the peak of the continuum contrast versus | B l |/µ profile. The lower maximum in the profile from the restored data set, compared to the profile from the uncorrected data set (2.6 × 10 −3 versus 5.7 × 10 −3 ), is likely from the enhanced contrast of dark intergranular lanes.
In Fig. 16 we show the uncorrected and restored continuum intensity and | B l |/µ along a 21-pixel cut across example magnetic features near disc centre (µ = 0.97). The troughs and peaks in the intensity curve (top panel) correspond to intergranular lanes and granules respectively. The magnetic features, the peaks in the | B l |/µ curve (bottom panel), sit inside the intergranular lanes. The | B l |/µ level at the core of these magnetic features lie in the regime of the peak of the continuum contrast versus | B l |/µ profile. The stray light correction boosted the magnetogram signal at the core of these magnetic features but also rendered them darker here, even from positive contrast to negative, as radiation originating from nearby granu- Fig. 16. The uncorrected (black circles) and restored (with K 2 , red circles) continuum intensity contrast (top) and | B l |/µ (bottom) along a 21-pixel section across magnetic features near disc centre (µ = 0.97). The plotted points represent image pixel values and are connected by straight lines to aid the eye. The dotted lines highlight the image pixels inside the magnetic features where the stray light correction effected a decrease in continuum intensity contrast accompanied by an increase in | B l |/µ. The dashed lines follow the zero level. lation is removed from the intergranular lanes. The spatial resolution of HMI is insufficient to resolve many of the magnetic elements. Consequently, measured intensities contain contributions not only from magnetic features but also from the intergranular lanes that host them.
The intensity contrast of small-scale magnetic concentrations in both the continuum and spectral lines component of the solar spectrum, in particular the variation with position on the solar disc and magnetic field strength, is an important consideration in understanding the contribution by these features to variation in solar irradiance (Yeo et al. 2013). To the extent tested, image restoration with K 2 enhanced measured intensity contrast and | B l |/µ significantly but made little qualitative difference to the dependence of apparent contrast on | B l |/µ. The analysis here was restricted to image pixels near disc centre (µ > 0.94).
To extend the analysis to other disc positions, we would need to examine multiple full-disc images from different times featuring active regions at various disc positions as done by Ortiz et al. (2002) and Yeo et al. (2013), beyond the scope of this paper.

Intensity and magnetogram signal of sunspots and pores
In Fig. 17 we illustrate the change introduced by image restoration with K 2 on | B l |, as well as the continuum and line-core in-tensity of the sunspots and pores defined by the I/I 0 = (I/I 0 ) QS,P contours in Fig. 14. Signal enhancement is expressed as a function of the original level, separately for the big sunspot bounded by the red contours, and the smaller sunspots and pores bounded by the blue contours. We binned the image pixels by the uncorrected | B l | in intervals of 100 G and plotted the bin-averaged change in | B l | against the bin-averaged original | B l | (Fig.  17a). This was repeated for the continuum and line-core intensity (Figs. 17b and 17c), taking a bin size of 0.05 in both instances. Within expectation, the influence of image restoration on | B l | and intensity is highly correlated to the original values of these quantities. This comes largely from the fact that the darker regions, where | B l | is also typically higher, are more affected by stray light as scattered radiation forms a greater proportion of measured intensity, and therefore respond more strongly to image restoration. Also within expectation, the effect of restoration is more pronounced (greater absolute change) for smaller features, which are more susceptible to instrumental scattered light. An exception is the peak in the line-core intensity profile for the big sunspot feature (red curve, Fig. 17c), which arose from the enhanced brightness of the bright filaments in the penumbra from the restoration, visible in Fig. 14.
Given the variation in the response of sunspots to image restoration, it could have a profound effect on the apparent radiant and magnetic properties of these features. A full account of the effect of image restoration on sunspots, including the variation with size and disc position, would require examining a much larger sample of sunspots from multiple images taken at different times, which is outside the scope of this work (see Mathew et al. (2007) for such a study, based on MDI data).

Amount of magnetic flux on the solar surface
We segmented the solar disc in the 720-s longitudinal magnetogram by µ (excluding points where µ < 0.1, ∼ 1% of the solar disc by area) into 50 annuli of equal area. Within each annulus, we computed the quantities listed below, plotted in Fig. 18. For each quantity, we derived the level in the uncorrected and restored magnetogram (black and red series, left axes), and the ratio of the restored and the uncorrected values (blue series, right axes), denoted by the ∆ preffix.
-The noise level, σ B l (Fig. 18a), given by the standard deviation of B l . The standard deviation was computed iteratively, points more than three standard deviations from the mean were excluded from succeeding iterations till convergence, to exclude magnetic activity. The variation of the noise level of HMI longitudinal magnetograms with position on the solar disc is dominated by a centre-to-limb increase (Liu et al. 2012;Yeo et al. 2013). It is therefore reasonable to represent the noise level within a given annulus by a single value of σ B l . Image restoration increased the noise level, on average, by a factor of 1.6. -The proportion of image pixels counted as containing significant magnetic activity, n mag (Fig. 18b), taken here as the points where | B l | > 3σ B l . -The mean | B l | of the image pixels counted as magnetic, ǫ | B l |,mag (Fig. 18c). -The product of n mag and ǫ | B l |,mag (Fig. 18d). The quantity ∆ n mag ǫ | B l |,mag represents the factor by which the apparent amount of line-of-sight magnetic flux changed from stray light removal. Image restoration resulted in less image pixels being counted as magnetic (around −10% to −25%, Fig. 18b), though the enhancement to the magnetogram signal (30% to 60%, Fig. 18c) meant that there is an overall increase in the apparent amount of line-of-sight magnetic flux (10% to 40%, Fig. 18d). Computing ∆ n mag ǫ | B l |,mag taking all the annulus as a whole, the total amount of line-of-sight magnetic flux over the solar disc increased by a factor of 1.2. In Fig. 19, we mark the location of image pixels counted as magnetic in the original and restored data, in a 201 × 201 pixel inset centred on the disc centre. Image restoration renders magnetic features spatially smaller as polarized radiation originating from these features, lost to the surrounding quiet Sun by aperture diffraction and stray light, is recovered (illustrated by the blue and red clusters). This change in the size of magnetic features likely depends on factors such as the surface area, and circumference to surface area ratio. The enhanced noise level also contributes to the smaller count in the restored data. Image restoration does recover some magnetic features smeared below the magnetogram signal threshold (| B l | = 3σ B l ) in the original data by instrumental scattered light (green clusters). Overall, less image pixels are counted as magnetic.
The overall increase in σ B l towards the limb is partly related to the increase in low-level magnetogram signal fluctuations from the ubiquitous weak horizontal magnetic fields in the quiet Sun internetwork (Lites et al. 1996(Lites et al. , 2008Beck & Rezaei 2009), which obtain a line-of-sight component near the limb, and magnetic features foreshortening towards the background noise regime when approaching the limb. A probable cause of Fig. 17. The change in | B l | (left), as well as in the continuum (middle) and line-core intensity (right) introduced by image restoration with K 2 , as a function of the original value. Both the continuum and line core intensities are normalized to the quiet-Sun level. The red and blue series follow the values derived from the sunspot and pore features encircled by the similarly colour-coded contours in Fig. 14. The black and green curves (left) correspond to the change in | B l | in the quiet Sun field depicted in Fig. 19, and in a 201 × 201 pixel active region field near disc centre (µ > 0.92), respectively. The dashed lines mark the zero level.
the overall centre-to-limb increase in ∆σ B l is the enhancement of these true signal contributions to apparent noise.
In Fig. 17a we display the change in magnetogram signal as a function of the original signal, in the quiet Sun field illustrated in Fig. 19 and in a 201 × 201 pixel crop of an active region near the disc centre (µ > 0.92), represented by the green and black curves, respectively. This was computed as done in Sect. Fig. 14, the results of which are also plotted for comparison (blue and red curves). The only difference is here we binned the image pixels by the uncorrected | B l | in intervals of 40G instead of 100G. As done in Sect. 3.2.1, we minimised the influence of pores present in the active region field by excluding the image pixels where I/I 0 < (I/I 0 ) QS,P and points up to three pixels away from them. (There are no image pixels where I/I 0 < (I/I 0 ) QS,P in the quiet Sun field.) The result from the quiet Sun and active region fields represent the effect of image restoration on the magnetogram signal of quiet Sun network, and active region faculae, respectively.

for the sunspots and pores in
As noted for sunspots and pores (Sect. 3.2.2), the enhancement of the magnetogram signal of network and faculae from image restoration is highly correlated to the original level. This is possibly from the restoration enhancing the signal in the core of magnetic features, where it is also typically stronger, while depressing the signal in the fringes, from the recovery of polarized radiation scattered from the core to the fringes and surrounding quiet Sun, as discussed above and visible for the magnetic features depicted in Fig. 16.
The effect of image restoration on network and faculae is also more pronounced than in sunspots and pores, in particular for network. This is likely related to the smaller spatial scale of these features, which makes them more susceptible to stray light, and consequently they respond more acutely to restoration, than sunspots and pores. The stronger response of network compared to faculae is probably due to the fact that they appear in smaller clusters and the restoration of small-scale mixed polarities in the quiet Sun smeared out by instrumental scattered light.
As image restoration affects different magnetic features differently, the overall effect on the apparent amount of magnetic flux fluctuates with prevailing magnetic activity. This is the likely reason neither ∆n mag , ∆ǫ | B l |,mag nor ∆ n mag ǫ | B l |,mag ex-hibit any obvious trend with µ, modulated by the magnetic features present within each annulus. Importantly, the relatively acute effect of image restoration on network, and the fact that the solar disc is, by area, predominantly quiet Sun means most of the increase in the measured amount of magnetic flux comes from the enhancement of these features. This is consistent with the findings of Krivova & Solanki (2004).

Line-of-sight velocity
Here we are interested in the part of measured line-of-sight velocities in HMI Dopplergrams arising from convective motions on the solar surface. To this end, we corrected the 720s Dopplergram for the contribution by the rotation of the Sun and the relative velocity of SDO to the Sun 10 , v SDO , following the procedure of Welsch et al. (2013). Oscillatory motions associated with p−modes are largely undetectable in the 720-s Dopplergram data product as it is a weighted combination of filtergram observations from a 1350-s period, much longer than the period of these oscillations (∼ 5 minutes).
The rotation rate of the Sun varies with heliographic latitude, Φ. Let v rot denote the velocity of the surface of the Sun from its rotation. We first determined the Stonyhurst latitude and longitude at each image pixel within the solar disc. Then, we derived the v rot at each latitude from the differential rotation profile by Snodgrass (1983), which relates angular velocity, w = |v rot | R ⊙ cos Φ (R ⊙ being the radius of the Sun in metres) to Φ. The contribution by v rot and v SDO to measured velocity at a given image pixel is then given by the projection of v rot and v SDO onto the line-of-sight to the point, taking the small-angle approximation. The projection of v SDO , in this instance, varied between 500 and 800 ms −1 with position on the solar disc. The significant magnitude and variation of this with disc position arises from SDO's geosynchronous orbit about Earth and Earth's orbit about the Sun. Fig. 18. Plotted as a function of µ, a) the noise level of the 720-s longitudinal magnetogram, σ B l , b) the proportion of image pixels counted as containing significant magnetic activity, n mag , c) the mean | B l | of these points, ǫ | B l |,mag , d) and the product of n mag and ǫ | B l |,mag . Left axes: the uncorrected (black series) and restored with K 2 levels (red series). Right axes: the quotient of the restored and uncorrected values (blue series).
Let v l represent the signed Dopplergram signal, the mean line-of-sight component of the vector velocity over a given image pixel.
As done in Sect. 3.2.3, we segmented the solar disc by µ, into 50 equal annuli, excluding points where µ < 0.1. The image pixels where | B l |/µ > 10G in the 720-s longitudinal magnetogram were masked, leaving quiet Sun. Within each annulus, we binned the unmasked points by the uncorrected v l in intervals of 20 ms −1 , and retrieved the median original and restored v l within each bin, ignoring bins with less than 100 points. The factor enhancement of v l from image restoration, ∆ v l QS is then given by the slope of the linear regression fit to the restored bin-median v l against the original, illustrated for the disc centremost interval of µ (µ > 0.99) in Fig. 20a. By performing this computation over small intervals of µ, we avoid introducing scatter or bias in ∆ v l QS from the µ dependence of the convective blueshift of the spectral line.
The enhancement of the Dopplergram signal in the quiet Sun from image restoration with K 2 is significant and exhibits an acute CLV; ∆ v l QS increases monotonically with µ, from about 1.4 near the limb to 2.1 at disc centre (Fig. 20b).
In looking only at the quiet Sun, we excluded phenomena localised in active regions (for example, Evershed flow in sunspots), leaving signal largely from granulation and supergranulation. Supergranulation flows are largely horizontal. The line-of-sight velocities of supergranulation flows are thus greatest near the limb and diminishes towards disc centre from fore-shortening. In contrast, the apparent line-of-sight velocities of granulation flows diminish towards the limb. Approaching the limb, granulation is more and more difficult to resolve from foreshortening and the line-of-sight increasingly crossing into multiple granulation cells. The typical diameter of granulation and supergranulation cells is about 1 Mm and 30 Mm, respectively. Granulation is therefore more affected by stray light and experiences greater signal enhancement from image restoration than supergranulation. The observed CLV of ∆ v l QS is consistent with the converse CLV of the line-of-sight velocities of granulation and supergranulation flows, and the stronger effect of image restoration on granulation compared to supergranulation.
By correcting both the original and restored Dopplergram for differential rotation with Eqn. 3, we had implicitly assumed that this component of measured line-of-sight velocity is not significantly changed by stray light or its removal. Given the line-ofsight component of v rot varies gradually across the solar disc, this is true except very close to the limb. Therefore, the effect on this analysis is likely minute and confined to the annuli closest to the limb.
The pronounced Dopplergram signal enhancement effected by image restoration with K 2 could have an impact on the characterization of plasma flows in the solar surface with HMI data. In this study we will not attempt to examine the effects of image restoration on apparent Doppler shifts in active regions, p−mode oscillations (detectable in the 45-s Dopplergram data product of the front CCD) or the individual physical processes driving plasma motion on the solar surface.

Variation of the PSF within the FOV, between the HMI CCDs and with time
Derived from observations of Venus in transit recorded on the side CCD, K 2 characterizes the stray light in the employed data, at the position in the FOV occupied by the venusian disc. Here we discuss the applicability of K 2 to the entire FOV, to data from the front CCD and, importantly, from other times.

Variation of the PSF with FOV position
Taking the test continuum filtergram (from Sect. 3.1), we segmented the solar disc into eight equal sectors and computed the RMS intensity contrast of the quiet Sun within each sector. The level before and after image restoration with K 2 are illustrated in Fig. 21a. There is scatter in the RMS contrast between the sectors which is more pronounced in the restored data. This en- Fig. 21. RMS intensity contrast of the quiet Sun as a function of µ, before (black lines) and after (red) image restoration with K 2 . a) In the test continuum filtergram, the solar disc segmented into eight equal sectors. b) In the near-simultaneous filtergrams of similar bandpass and polarization from the side (dotted lines) and front (dashed) CCD.
hanced divergence is, at least in part, caused by the fact that we restored the entire solar disc with a single PSF when the true PSF varies from sector to sector. The scatter in RMS contrast is, however, at least to the extent tested, relatively small in comparison to the absolute level. More importantly, the divergence between the sectors in the restored data (red curves) is small compared to the difference between the restored and the original data (black curves). This implies that the inhomogeneity introduced by applying a single PSF to the entire FOV is small in comparison to the contrast enhancement. Nonetheless, for sensitive measurements, care should be taken, where possible, to average measurements from different positions in the FOV after deconvolution with the PSF deduced here.
Next, we looked at the variation, over the solar disc, of the effect of image restoration with K 2 on the 720-s longitudinal magnetogram from Sect. 3.2. Sampling the solar disc at 16-pixel intervals in both the north-south and east-west directions, we centred a 401 × 401 pixel window over each sampled point and took the mean | B l | of all the solar disc pixels within the window, denoted ǫ | B l | . Let ∆ǫ | B l | represent the ratio of ǫ | B l | in the restored and uncorrected data, representing the factor enhancement to ǫ | B l | from the restoration.
Expectedly, ∆ǫ | B l | varied with position on the solar disc (Fig.  22b). This variation is driven by: Fig. 22. a) Mean unsigned magnetogram signal, ǫ | B l | of the original (not corrected for stray light) 720-s longitudinal magnetogram. a) Factor enhancement of ǫ | B l | from image restoration with K 2 , ∆ǫ | B l | . c) Scatter plot of ∆ǫ | B l | against the original ǫ | B l | .
-differences in the magnetic activity present in the sampling window (image restoration affects different magnetic features differently, Sect. 3.2.3) and -fluctuations in the effect of image restoration from the variation of the stray light behaviour of the instrument across the FOV.
The scatter plot of ∆ǫ | B l | versus the original ǫ | B l | reveals an inverse relationship between the two quantities (Fig. 22c). The cause of this correlation is that the restoration enhances the magnetogram signal in the quiet Sun more strongly than in active regions (Fig. 17a). The relatively weak spread of the scatter plot suggests the variation in ∆ǫ | B l | with disc position is dominantly due to the inhomogeneous distribution of magnetic activity (Fig.  22a) and the diverging effects of restoration on different magnetic features. This is further evidence that it is a reasonable approximation to restore the entire FOV of HMI for instrumental scattered light with a single PSF.

Variation of the PSF between the HMI CCDs and with time
In Fig. 21b we show the RMS intensity contrast of the quiet Sun in two near-simultaneous filtergrams, one from each CCD, taken less than one minute apart. The two filtergrams were recorded about an hour after Venus left the solar disc (at around 05:36 UTC, June 6, 2012), shortly after the side CCD resumed collection of the regular filtergram sequence. The two near-simultaneous filtergrams were taken in the same bandpass (-172 mÅ from line centre) and polarization (Stokes I − V). Any disparity in the RMS contrast between the two would arise mainly from differences in the performance of the two CCDs, including the stray light behaviour. The RMS contrast in the two filtergrams is very similar, even after image restoration with K 2 (red curves). Since we expect any disparity due to differences in the stray light behaviour of the two CCDs to be amplified by the application of the side CCD PSF to a front CCD filtergram, this agreement is encouraging.
Comparing the close similarity in the RMS intensity contrast of the quiet Sun in the two near-simultaneous filtergrams to the scatter between different FOV positions in the test continuum filtergram (top panel), it appears that the difference in the stray light behaviour of the two CCDs is much smaller than the variation with position in the FOV of the side CCD. The side and front CCDs are identical and share a common optical path (Schou et al. 2012b), it is therefore within reason that the stray light behaviour, even the variation of the PSF with position in the FOV, is broadly similar.
The SDO satellite is in a geosynchronous orbit. Since the HMI commenced regular operation (May 1, 2010), the side and front CCDs recorded a continuum filtergram each during the daily pass through orbital noon and midnight. For the purpose of investigating the stability of the stray light behaviour of the instrument over time, we examined the solar aureole, the intensity observed outside the solar disc arising from instrumental scattered light, in these daily data 11 . We examined 2307 orbital noon and midnight continuum filtergrams from each CCD, spanning the 1157-day period of May 1, 2010 to June 30, 2013.
For each continuum filtergram, we averaged the solar aureole over all azimuths. From the resulting radial intensity profile, we determined the intensity of the solar aureole at distances of 1 and 10 arcsec from the edge of the solar disc. The derived intensities, normalized to the limb level, are expressed in Figs. 23a and 23b, respectively.
We excluded the points that are spurious or from continuum filtergrams with missing pixel values, leaving 2248 and 2288 points from the side and front CCDs respectively. To show up the broad trend with time we interpolated each time series at one day intervals and smoothed the result by means of binomial smoothing (Marchand & Marmet 1983). The time variation in the relative (to the limb level) intensity of the solar aureole at 1 and 10 arcsec from the limb reflects changes to the shape of the PSF near the core and in the wings respectively.
There is clear point-to-point fluctuation in the relative intensity of the solar aureole at 1 arcsec from the limb. This is due to the fact that near the limb, the intensity of the solar aureole decays rapidly with radial distance such that small variations in the width of the core of the PSF show up as large swings in the relative intensity at a fixed distance from and near the limb. Overall, the magnitude of the scatter, given by the standard deviation, is below 2% of the mean level. Also, the side and front CCD series are relatively stable and similar, with no overt long term trends or divergence from one another. This suggests that the width of the core of the PSFs of the two CCDs are, to the extent tested, broadly similar and constant over the period examined.
For the relative intensity of the solar aureole at 10 arcsec from the limb, there is an approximately synchronous periodic variation between the two CCDs. There is also a gradual overall drift between May 2010 and July 2011, and between August 2012 and June 2013. The fluctuation of the two time series and the divergence between them is minute, less than 5% of the overall level. The time variation of, and difference between the wings of the PSFs of the two CCDs, implied by these fluctuations, has likely little effect on image contrast. Even with the ∼ 3% offset between the front and side CCD time series around the time of the Venus transit, the RMS intensity contrast of the quiet Sun in the near-simultaneous filtergrams from the two CCDs (taken about an hour after the end of the transit) is practically identical (Fig. 21b).
Going from 1 to 10 arcsec from the limb, the time dependence of the relative intensity of the solar aureole changes gradually from the trend seen at 1 arcsec to that seen at 10 arcsec. Beyond 10 arcsec the variation with time does not change significantly. The relative intensity of the solar aureole at 1 and 10 arcsec from the limb therefore constitute a reasonable representation of variation in the shape of the PSFs of the two CCDs with time.
From the near identity of the RMS intensity contrast of the quiet Sun in the near-simultaneous filtergrams from the two CCDs (Fig. 21b) and the minute time variation of the PSFs of the two CCDs implied by the relative stability of the shape of the solar aureole in daily data (Figs. 23a and 23b), we assert that K 2 can be applied to observations from both CCDs for the period examined (May 1, 2010 to June 30, 2013) without introducing significant error.
This assertion is consistent with the state of the focus of the instrument over the period examined. The PSF of HMI, like any optical system, is strongly modulated by the focus. The instrument is maintained in focus by varying the heating of the front window and the position of two five-element optical wheels (Schou et al. 2012b). By varying the elements of the two optical wheels placed in the optical path, they allow the focus to be adjusted in 16 uniform, discrete steps, each corresponding to about two-thirds of a depth of focus. In Fig. 23c we plot the position of best focus, in units of the focus steps, from the regular (roughly weekly) focus calibration of the sensor, over the same period as the daily data. The focus of the two CCDs are remarkably similar and stable, differing from one another and varying over the period of interest by much less than a depth of focus. The contribution by focus to the variation of the PSF between the two CCDs and with time is most probably minute.

Summary
In this paper we present an estimate of the PSF of the SDO/HMI instrument. The PSF was derived from observations of Venus in transit. We convolved a simple model of the venusian disc and solar background with a guess PSF iteratively, optimizing the agreement between the result of the convolution and observation. We modelled the PSF as the linear sum of five Gaussian functions, the amplitude of which we allowed to vary sinusoidally with azimuth. This azimuthal variation was necessary to reproduce the observations accurately. Recovering the anisotropy of the PSF was also shown to be important for the proper removal of stray light from HMI data by the deconvolution with the PSF. The interaction between solar radiation and the venusian atmosphere is complex and not straightforward to account for. The result is a conservative estimate of the PSF, similar in width to the ideal diffraction-limited PSF in the core but with more extended wings.
The PSF was derived with data from one of the two identical CCDs in the sensor. It therefore represents the stray light behaviour of that particular CCD, at the time of the transit of Venus, at the position in the FOV occupied by the venusian disc in the employed observations.
Comparing the apparent granulation contrast in different parts of a single image, we showed that although the variation in the stray light behaviour of the instrument with position in the FOV introduces uncertainty to measured contrast, amplified by restoring observations with a single PSF, the scatter is relatively minute and will likely have little quantitative influence if care is taken to average measurements from multiple FOV positions. This was confirmed by an examination of the uniformity, over the FOV, of the effect of image restoration on the 720-s longitudinal magnetogram data product.
The time variation of the shape of the solar aureole in daily data was taken as an indication of PSF changes over the period examined (May 1, 2010 to June 30, 2013). Based on the relatively weak time variation of the aureole, and the similarity of the aureole and granulation contrast in data from the two CCDs, we assert that the PSF derived here can be applied to observations from both CCDs over the period examined without introducing significant error. Apparent granulation contrast, given here by the RMS intensity contrast of the quiet Sun, in HMI continuum observations restored by the deconvolution with the PSF, exhibit reasonable agreement with that in artificial images generated from a 3D MHD simulation at equal spatial sampling. This demonstrates that the PSF, though an approximation, returns a competent estimate of the aperture diffraction and stray light-free contrast. The restoration enhanced the RMS intensity contrast of the quiet Sun by a factor of about 1.9 near the limb (µ = 0.2), rising up to 2.2 at disc centre.
We also illustrated the effect of image restoration with the PSF on the 720-s Dopplergram and longitudinal magnetogram data products, and the apparent intensity of magnetic features.
-For small-scale magnetic concentrations, image restoration enhanced the intensity contrast in the continuum and core of the Fe I 6173 Å line by a factor of about 1.3, and the magnetogram signal by a factor of about 1.7. -Magnetic features in the longitudinal magnetogram are rendered smaller, as polarized radiation smeared onto surrounding quiet Sun by instrumental scattered light is recovered. -Image restoration increased the apparent amount of magnetic flux above the noise floor by a factor of about 1.2, mainly in the quiet Sun. This may be, in part, from the recovery of magnetic flux in opposite magnetic polarities lying close to one another partially cancelled out by stray light. -The influence of image restoration on sunspots and pores varied strongly, as expected, within a given feature and between features of different sizes. -Line-of-sight velocity due to plasma motions on the solar atmosphere increases by a factor of about 1.4 to 2.1. The variation comes from the restoration enhancing granulation flows more strongly than larger scale supergranulation flows. Given the spatial scale dependence, the effect on Doppler shifts from large scale motions such as the meridional flow and differential rotation is probably minute.
The pronounced effect of image restoration on the apparent radiant, magnetic and motional properties of solar surface phenomena could have a significant impact on the interpretation of HMI observations. For instance, the observation that restoring HMI longitudinal magnetograms renders magnetic features smaller while boosting the magnetogram signal, and the increase in the amount of magnetic flux is dominantly in the quiet Sun, can influence models of variation in solar irradiance based on HMI data. Specifically, with models that relate the contribution by small-scale magnetic concentrations to solar irradiance variations to the number density and magnetogram signal (for example, Wenzler et al. 2006;Foukal et al. 2011;Ball et al. 2012).