1 Introduction

High-resolution observations of solar granulation from the balloon-borne solar observatory Sunrise (Barthol et al., 2011) reveal sub-structures such as granular lanes that typically consist of a bright rim and a dark edge. They travel from the visible boundary of granules into the granule itself (Steiner et al., 2010). By comparing the observations with numerical simulations, Steiner et al. (2010) interpreted these structures to be signatures of vortex tubes, which are a fundamental structure element of turbulence and are important for transferring energy from large to small scales. On the other hand, granules are also considered good tracers of the large-scale flows (Stangalini, 2014), particularly that of supergranular flows (Hart, 1956). Leighton, Noyes, and Simon (1962) and Simon and Leighton (1964) showed that the edges of supergranular cells coincide with the chromospheric emission network. This suggests that the large-scale horizontal flow is responsible for advecting magnetic fields along the network boundaries. Solar granulation thus serves as a proxy for the transport of small-scale magnetic fields and their subsequent accumulation and intensification at the network. Hence it is important to have tools that can identify and track granular flows on the solar surface.

There are several methods to track solar granulation. Of these, local correlation tracking (LCT; November, 1986; November and Simon, 1988; Welsch et al., 2004; Fisher and Welsch, 2008) is the oldest and most frequently used routine. LCT computes the relative displacement of small sub-regions centred on a particular pixel. A Gaussian window, whose full-width-at-half-maximum (FWHM) needs to be roughly the size of the structures that are to be tracked, is used to apodize the sub-regions. Thus, the horizontal speed at each pixel can be determined knowing the displacement, image scale, and the time interval. The “balltracking” method of Potts, Barrett, and Diver (2004) also produces results with the same accuracy as LCT, but is significantly more efficient computationally. On the other hand, the feature-tracking routine of Strous (1995) allows determining physical characteristics of individual small features. Other tracking routines include the induction method (IM; Kusano et al., 2002), inductive local correlation tracking (ILCT; Welsch et al., 2004), Fourier local correlation tracking (FLCT; Welsch et al., 2004), minimum-energy fit (MEF; Longcope, 2004), minimum-structure reconstruction (MSR; Georgoulis and LaBonte, 2006) method, differential affine velocity estimator (DAVE; Schuck, 2006), and nonlinear affine velocity estimator (NAVE; Schuck, 2005). All these techniques, except for FLCT, are based on the ideal induction equation and are used to track the magnetic footpoint velocity using magnetograms. Welsch et al. (2007) performed tests with these routines (except NAVE) on synthetic magnetograms generated from anelastic MHD simulations of Lantz and Fan (1999) and concluded that DAVE estimated the magnitude and direction of velocities slightly more accurately than the other methods, while MEF’s estimates of the fluxes of magnetic energy and helicity were far more accurate than the others. While these methods have varying computational demands, LCT is the fastest routine among these.

Verma, Steffen, and Denker (2013) used simulated continuum images from the CO5BOLD code (Freytag et al., 2012) to compare plasma flows with those retrieved by LCT. A similar analysis was performed by Yelles Chaouche, Moreno-Insertis, and Bonet (2014) using synthetic continuum maps generated by the STAGGER code (Beeck et al., 2012). These studies revealed that the horizontal proper motions are not effectively retrieved by LCT. This drawback has been attributed to the nature of granules whose motions are representative of the large-scale plasma flow for length and time scales greater than 2.5 Mm and 30 min, respectively, (Rieutord et al., 2001). While the comparison of horizontal flows retrieved from LCT on synthetic data is the best way to validate the method and to determine its limitations, it is not immediately clear if the proper motions derived from LCT can and should be compared directly with simulated horizontal plasma motions. Firstly, LCT tracks contrast fluctuations between two images, which is not the same as the underlying plasma motions. Secondly, LCT only determines the relative displacement between two images that are separated in time and for a pixel of interest. The resulting morphology would thus reflect displacements and not velocity, despite using a constant scaling factor (arising from the spatial sampling and time step) for all pixels in the field of view. Thirdly, LCT is formally not consistent with the normal component of the induction equation, which can be expressed as a continuity equation; but rather with the advection equation (Schuck, 2005). Furthermore, it is not known whether a Gaussian apodizing window is or would be the best choice when using LCT.

In this article, we evaluate the performance of LCT on convection simulations for different shapes of apodizing windows, taking advantage of the fact that LCT is the simplest and one of the most computationally efficient velocity determination tools. Our aim is to determine whether a different apodizing function can significantly improve LCT results that could then be used in future studies. Such a study, to the best of our knowledge, has not been carried out before. As a secondary product of these tests, we also validate LCT and discuss its advantages and limitations with respect to simulations, as well as its implications for solar observations.

2 Nirvana Simulations of Convection

The two-dimensional (2D) images showing temperature and horizontal velocity components in Figure 1 are snapshots from a three-dimensional box simulation of magneto-convection in a stratified gas layer. The simulation box is rectangular and contains two layers of gas. The temperature stratification is convectively unstable in the upper layer and stable in the lower layer. The Rayleigh number in the unstable layer is 107, the thermal and magnetic Prandtl numbers both assume values of 0.1. Density and temperature both assume values of the order one, while the isothermal sound speed is 100 and the pressure increases from 104 at the top to 105 at the bottom. The magnetic field is vertical and the field strength has been chosen to be near equipartition with the gas density at the top of the box.

Figure 1
figure 1

Left panel: temperature snapshot from the Nirvana simulation. The corresponding x- and y-components of the velocity vector are shown in the middle and right panels, respectively.

The setup is the same as used in Rüdiger, Küker, and Schnerr (2012). We used the Nirvana MHD code (Ziegler, 2004) to solve the equation of motion, the induction equation, and the conservation equations for mass and energy in Cartesian coordinates for an ideal gas of constant molecular weight. The aspect ratio of the simulation box is 8×8×2 in the x, y, and z coordinates. Stratification is along the z axis with the gravity vector pointing in the negative direction, i.e. the z axis pointing upwards. The bottom of the box is at z=−2, the top at z=0. The horizontal cross sections were taken at z=−0.05.

The boundary conditions are periodic in the horizontal (x and y) directions. The vertical (z) boundary conditions prevent outflow, i.e. specify zero mass flow across the boundaries, and stress-free in the horizontal components. The temperature is kept fixed at the upper boundary, while the heat flux is prescribed at the lower boundary. We used a mesh with 513×513×128 points. The computations were carried out in the AIP Leibniz cluster using the message-passing interface with 256 CPU cores in parallel. Dimensionless units were used for all quantities.

The time separation in the simulations was chosen to be sufficiently smaller than the characteristic time scale of the granules and to have a high correlation between successive frames so as perform tracking on consecutive temperature maps. The temperature distribution exhibits two clear peaks that correspond to the dark cell boundaries and the granules that represent upflowing plasma. Since temperature is a dimensionless quantity, it is not possible to convert it into bolometric intensity to derive the image contrast. A proxy for the contrast was made in the following manner: The two-peak distribution was fitted with two Gaussians whose mean and σ are represented as m 1, σ 1 and m 2, σ 2. If 〈I〉 represents the mean value of the image, then the contrast is expressed as ((m 2+σ 2)−(m 1σ 1))/〈I〉. Using this expression, the contrast is estimated to be about 6 %. In comparison the contrast for solar granulation is about 14 % at 630 nm as shown by Danilovic et al. (2008) using MHD simulations.

3 Apodizing Windows for LCT

Inferring the velocity of features from a set of two images depends on two parameters: the apodizing window function and the time difference between the two images. Before computing the cross correlation, the first step is to generate the apodizing window function with a given width (σ). The window function is multiplied with sub-images in the reference frame and the object frame, thus smoothing both sub-images. The apodization also restricts the motion of the features to the window size. The choice of the time step depends on the evolution time-scale of the feature because a small time step might yield a poor correlation owing to a small shift, while a large time step could render the feature outside the apodizing window. Thus, a compromise between the width of the apodizing window and the time difference is necessary.

To compute the shifts, we used a Fast Fourier Transform (FFT) based cross-correlation program (Nisenson et al., 2003). The displacements were determined with sub-pixel accuracy by fitting a quadratic function to the cross-correlated values near the peak. This procedure yielded displacement vectors for all pixels in each frame and for the entire time sequence. The program is very fast, and on a 3.2 GHz Intel-core processor, it takes about 70 s for a Gaussian apodizing window with a width of σ=15 pixel and for an image of size 513×513 pixel. We generated 2D Gaussian, Lorentzian, trapezoidal, and triangular windows for widths of σ=10, 15, and 20 pixel. The windows were constructed such that for a given σ, the FWHM was the same for all, thus providing a basis for comparison. This is shown in Figure 2 for a one-dimensional (1D) plot of each window function for a width of σ=10 pixel.

Figure 2
figure 2

Different shapes of apodizing windows used in LCT. The 1D profiles correspond to a σ=10 pixel.

As mentioned in Section 2, the tracking was made on successive frames because we were interested in retrieving the instantaneous horizontal motions. The central 400×400 pixel region was chosen for analysis to avoid the edges that were affected by the apodization. The top panels of Figure 3 show running-difference maps of the simulated horizontal velocity from successive frames, while the bottom panel shows the displacements determined by LCT using a Gaussian apodizing window with a width of σ=10 pixel. The running-difference velocity maps, thus, reflect displacements, albeit with time as a dimensionless scale factor, and below we refer to them as velocities, unless otherwise stated.

Figure 3
figure 3

Top panels: velocity-difference maps in x-(left) and y-directions (right) obtained from successive frames of the simulation sequence. Bottom panels: example of horizontal velocities obtained after LCT was applied to the corresponding temperature maps. A Gaussian window of σ=10 pixel was used in this case. The black rectangle in the panels corresponds to the smaller region shown in Figure 5.

4 Results

4.1 Correlations Between LCT-Retrieved and Simulated Horizontal Velocities

We computed the Pearson linear correlation coefficient (CC) of the horizontal velocities retrieved by LCT and simulations for the different apodizing windows and widths for the entire time sequence. Figure 4 shows that the correlations in both x- and y-directions have a time-dependent behaviour that is reflected very similarly in all apodizing windows and for all widths considered. This time-dependence of the CCs is related to the temporal evolution of the convective pattern seen in the simulated velocity-difference maps. The correlation decreases as the width of the apodizing window increases. For the narrowest window with a width of σ=10 pixel, the correlation is the highest and nearly the same for all the apodizing windows. However, as the width of the window increases, we find a distinction in the correlations, the highest for the Lorentzian and triangular apodizing windows, followed closely by the Gaussian and the lowest for the trapezoidal window.

Figure 4
figure 4

Linear correlations between simulated velocities and that derived by LCT. Top panels: correlation coefficients in the x-direction as a function of time for different apodizing windows, shown with different symbols and inscribed in the left-most panel. Panels from left to right correspond to different widths of the apodizing window. Bottom panels: same as above, but for the y-direction.

The highest CCs for the Gaussian, Lorentzian, and triangular windows are about 0.64 in both the x- and y-directions for a width of σ=10 pixel, while the corresponding lowest values are 0.52 and 0.50, respectively. Similar values are seen with the trapezoidal window for the same width. With the exception of the trapezoidal window, where the lowest value of the CC is quite low for the largest width, the same is relatively modest for the triangular, Lorentzian and Gaussian windows. The difference between the highest (or lowest) CCs for σ=10 and 20 pixel vary by about 20 % for the trapezoidal apodizing window, while this variation is only about 10 % for the other three windows. Although we find a time dependence in the CCs, the lowest and highest CC values for the triangular, Lorentzian, and Gaussian apodizing windows differ by about 15 %.

4.2 Comparison of Flow Vectors

As mentioned in Section 2, the physical parameters are dimensionless, and to compare the simulated velocities pixel by pixel with those from LCT, we determined the scale factor relating the two quantities from a linear regression fit to the scatter plot (not shown) in the x- and y-directions. This exercise was performed for each map in the time sequence. Using the regression gradient as a scale factor, the horizontal flow field from the simulations and that from LCT can be directly compared and is illustrated in Figure 5 for all windows with a width of σ=10 pixel. We find that the flow vectors from LCT are in concordance with those from simulations. As seen earlier in Figure 3, the horizontal velocities retrieved from LCT lack the fine structure observed in the simulated data, although there is an overall morphological agreement between the two, and this is the reason for the modest correlation shown in Figure 4. Subsequently, the LCT flow vectors appear stronger than the simulated ones, particularly at locations where the intrinsic velocities are high. The movieFootnote 1 also shows the temporal evolution of the simulated flows, which match the LCT-determined flows quite well. The flow maps retrieved by LCT using the trapezoidal window are weaker in amplitude and spatially smoother than those in the other three windows.

Figure 5
figure 5

Comparison of horizontal flow vectors from LCT (black arrows) and simulations (green arrows) for the area indicated by the black box in Figure 3. The arrows have been drawn for every third pixel and are overlaid on the corresponding temperature map. Top panels – Gaussian (left) and Lorentzian (right) apodizing windows. Bottom panels – trapezoidal (left) and trianglular (right) apodizing windows.

4.3 Velocity-Dependent LCT Values

Following Figure 5, we investigated whether the correlations between simulated and LCT velocities depend on the intrinsic magnitude of the flows since the values determined in Section 4.1 consider the entire velocity distribution. This test serves to check whether LCT can recover lower velocities with the same accuracy as higher ones. From the histogram of the simulated velocities, we selected three bins corresponding to |V|<0.5, 0.5≤|V|≤1.5 and |V|>1.5, which represent low, intermediate, and high velocities in both x- and y-directions. The three bins represent about 78.8 %, 19.2 %, and 2.0 % of the 2D velocity distribution in both directions and in time. Here, 2 % corresponds to a sample of 3200 pixels. Note that the velocity bins described above correspond to dimensionless values and were chosen by hand from the velocity distribution. Table 1 summarises the CCs between the simulated velocities and those from LCT for the three velocity bins. It is evident that when considered separately, the correlations improve significantly, becoming strong especially for the intermediate and high velocity bins. Thus, the modest correlations obtained in Section 4.1 are due to the low velocities that dominate the distribution. The CCs for all windows and for the smallest width of σ=10 pixel are about 0.70 and 0.79 for the intermediate and high velocity bins in both x- and y-directions. Even in the case of the largest width (σ=20 pixel), the CC is greater than 0.6 for both x- and y-directions, except for the trapezoidal window. The CCs are nearly independent of the width for all windows in the low-velocity bin and in both directions, the variation being lower than 5 %. Even though the spatial domain is dominantly populated by weaker velocities, the global regression coefficient described in Section 4.2 is representative of the same from the intermediate-velocity bin.

Table 1 Correlation coefficients for different windows and widths for different simulated velocity bins in the x- and y-directions for the entire time sequence. Gau–Gaussian, Lor–Lorentzian, Tap–trapezoidal, Tri–triangle.

4.4 Spatial Distribution of Velocity Differences

Figure 6 shows a difference map of the horizontal velocities from simulations and those derived from LCT, in x- and y-directions, using the triangular apodizing window, for σ=10 pixel. This is also representative of the maps obtained with the Lorentzian and Gaussian windows of the same width. The relevant scale factor described in Section 4.2 was used for the simulated velocity map and in the figure, black (white) represents strong negative (positive) residuals. Using the contours from the corresponding temperature map, we find that the locations that agree well are confined to granules that represent upflowing material, while regions with strong residuals are located at or close to the boundaries of the granular cells. These residuals occur at specific locations in the field of view and not at all cell boundaries. On closer inspection, the flow vectors obtained from LCT and those from simulations reveal that there are subtle differences between the two even at the location of granules, but the inherent, weak horizontal flows mask the small residuals in comparison to those seen at the inter-granular lanes.

Figure 6
figure 6

Left panel: spatial difference map between LCT and simulated velocities in the x-direction for the triangular apodizing window. Right panel: same as left panel, but for the y-direction. The scaling of the images is indicated in the colour bar. The maps correspond to a width of σ=10 pixel. The contours correspond to a temperature of 1.05 and outline most of the intergranular lanes.

5 Discussion

We have used numerical simulations of convection to analyse the performance of LCT for different shapes of apodizing windows because such a study has not been carried out before. Since the horizontal velocities are known from simulations, they can be compared with those retrieved by LCT, and the latter was applied to the simulated temperature maps so as to mimic the situation often used in solar observations. We first discuss the effects introduced by the different apodizing windows and proceed with validating LCT on the simulated data.

5.1 Performance of Different Apodizing Windows

LCT was used on the simulations with four different shapes of apodizing windows: Gaussian, Lorentzian, trapezoidal, and triangular, with different widths. The width of the apodizing window is related to the size of the structure to be tracked and hence will vary on the spatial resolution. As the temperature maps from the simulations have significant structural detail and are not affected by instrumental and atmospheric effects, it is clear that the narrowest windows (albeit still significantly larger than the size element) would give better results. This was indeed the case, as all four windows performed nearly the same for the narrowest width, which agrees with Verma, Steffen, and Denker (2013), who used a Gaussian apodizing window function. Indeed, we performed these tests for a width of σ=5 pixel and found that although the results from all the windows yield the same correlation coefficient, the values are lower than that observed for the case σ=10 or 15 pixel. The lower correlations obtained with a width of σ=5 pixel imply that the displacement of the features exceeds the width of the window. We also examined the case when σ was increased to 25 pixel and found that the correlations decrease further than the σ=20 pixel case with a similar separation of values amongst the four windows. This suggests that apodizing widths within the range of 10 and 15 pixels are optimal for tracking intensity features in the simulations.

The Gaussian window was only marginally inferior to the triangular and Lorentzian windows in terms of the correlations obtained. However, the correlations from these three window functions were less sensitive to the width than the trapezoidal window. This could be attributed entirely to the width of the peak centred on the pixel of interest for a given σ. The outer wings or edges of the window do not affect the results as long as the window is wide enough to detect the motion of the structure in the chosen time step. The triangular window has an abrupt cut-off at its edge, while its peak has the smallest width, and retrieves the same, albeit marginally better, result than the Lorentzian and Gaussian windows, both of which have comparatively extended wings. By the same argument, the central peak or plateau of the trapezoidal window increases more rapidly with σ, which would explain why the correlations obtained with it are lower than the others.

5.2 Validation of LCT

The uniform image quality and high spatial content in the simulations allowed us to track consecutive frames, thus eliminating the need to vary the time step. In fact, the effectiveness of the tracking routine is established by the accuracy of the instantaneous flow field retrieved from successive frames and has critical physical implications for understanding energy transfer in the Sun at small spatial and temporal scales (Steiner et al., 2010; Moll, Cameron, and Schüssler, 2011). As the simulations presented here are dimensionless, it limits a direct comparison in terms of physical units that can be checked with those known from solar observations. This limitation aside, the comparison of results from LCT and simulations can be regarded as impartial and unbiased.

We reiterate that LCT only retrieves relative displacements between two sub-images and as such should strictly be compared with a running-difference of velocity and not directly with velocity itself. Applying a scale factor to obtain velocity from the LCT results will not in any way alter the nature of the horizontal flows. This would explain why the results obtained by Verma, Steffen, and Denker (2013) vary significantly. Even though the LCT flow maps appear to be a smoother version of that seen in simulations, there is an overall morphological agreement, which could be the reason for the moderate-to-high correlations obtained in our analysis. Despite this drawback, the fact that LCT is relatively simple and not computationally intensive, makes it a viable diagnostic tool for probing horizontal flows. The lack of fine structure in the LCT horizontal flow maps can explain the results of Yelles Chaouche, Moreno-Insertis, and Bonet (2014) who found that the Fourier spectra for the LCT-determined velocities is well below that from the actual velocity components. We have not carried out any spatial smoothing of the simulated data as Verma, Steffen, and Denker (2013) but have performed a pixel-to-pixel comparison. Our analysis also reveals that when the intrinsic velocities are sufficiently strong, the accuracy of LCT is also higher, which is reflected in the correlations corresponding to different velocity bins.

The spatial differences in the LCT-determined flow fields and simulations reveal that large residuals can occur close to or at the edge of the granular boundaries with very small differences at the granules themselves, as also seen in Welsch et al. (2007). This suggests that such sites could possibly reflect interesting physical processes that could be the topic of future investigations by employing other computationally intensive tracking routines.

6 Conclusions

We have tested the conventional use of a Gaussian apodizing window in LCT against other shapes of windows and found that for a given σ, the width of the peak centred on the pixel of interest influences the determination of the horizontal motions. On the basis of this result, the triangular window yields the best result and the trapezoidal window the worst. The LCT routine was tested on simulations of convection, but it remains to be seen if a similar result can be obtained with magneto-convective simulations, which replicate solar-like conditions (Vögler et al., 2005; Rempel et al., 2009; Cheung et al., 2010). In the course of this analysis we also tested the validity of LCT in determining known plasma motions, and we conclude that LCT can still be used as a first-order approach to derive horizontal proper motions, which is ideal for processing large data sets.