Spherical Cap Harmonic Analysis Techniques for Mapping High-Latitude Ionospheric Plasma Flow—Application to the Swarm Satellite Mission

This chapter describes spherical cap harmonic analysis (SCHA) for mapping ionospheric plasma flows measured by the Swarm satellites. In Sect. 9.1, SCHA is introduced as a tool for mapping a variety of one, two, and three-dimensional parameters. Section 9.2 provides a detailed summary of the theory pertaining to SCHA including a discussion of the spherical cap coordinate system, boundary conditions and basis functions, calculation of non-integer degree, and practical considerations. Section 9.3 provides a practical example of SCHA mapping of ionospheric plasma flow for a ground-based data set, and Sect. 9.4 focuses on two-dimensional SCHA mapping of Swarm ion drift measurements both independently and in conjunction with measurements from other instruments.


Introduction
A wealth of data exists to describe physical parameters in the near-Earth environment with data sets taken from instruments that are either discretely located or in constant motion taking measurements that range in spatial and temporal resolution. Although examination of these individual data sets provides important information on the evolution of the parameter at a single location over time, or at several discrete locations at a single time, it is often desirable to ascertain what is happening over a specific spatial region at a given time through interpolation or mapping techniques. The technique examined in this Chapter is a form of harmonic analysis, which involves the series expansion of an infinite set of appropriately chosen basis functions. The choice of which basis functions to use is dependent on the distribution of data, the area of interest, and the nature of the function being mapped. For data distributed about the entire spherical Earth, the normal approach is spherical harmonic analysis with basis functions that are comprised of the Associated Legendre polynomials in co-latitude and trigonometric functions in longitude. However, when either the data or region of interest are confined to only a portion of the sphere, a spherical harmonic expansion cannot be applied because it is not defined across the entire natural interval (i.e. the sphere), and new basis functions must be defined for the relevant portion of the sphere. Although the new basis functions are less convenient because the function is not likely periodic over the subinterval, they are mathematically correct and allow the expansion to be applied. In the case of mapping data over a portion of a sphere, a spherical cap harmonic analysis (SCHA) technique has been developed.
Spherical cap harmonic analysis was originally developed by G. V. Haines for mapping regional magnetic fields, and has been applied to create regional maps across the globe (e.g. Haines 1985aHaines , 1988Haines , 2007An et al. 1998;De Santis et al. 1997b;Feng et al. 2015;Ji et al. 2006;Kotze, 2014;Pavón-Carrasco et al. 2008;Pothier et al. 2015;Stening et al. 2008;Tozzi et al. 2013;Weimer 2013;Waters et al. 2015). As a practical example, the Canadian Geomagnetic Reference Field (CGRF) is a regional magnetic field map that was produced every 5 years from 1985 to 2005 over Canada and adjacent regions (Haines and Newitt 1997).
Spherical cap harmonic analysis has been used for mapping a wide variety of ionospheric and magnetospheric parameters including secular variation over Canada (Haines 1985c(Haines , 1993, China , Europe (Korte and Haak 2000), Italy (De Santis et al. 1997a), the North Atlantic (Pavón-Carrasco et al. 2013), South Africa (Nahavo et al. 2011) and Spain (Garcia et al. 1991;Torta et al. 1992); vertical magnetic field anomalies poleward of 40° (Haines 1985b); magnetic field intensity (Kotzé 2002); Birkeland current systems ; equivalent current systems (Gaya-Pique et al. 2008;Haines and Torta 1994); ionospheric total electron content (TEC) (Liu et al. 2011(Liu et al. , 2014Ghoddousi-Fard et al. 2011;Otsuki et al. 2011); electric fields (Fiori et al. 2010), ionospheric conductance estimates (Green et al. 2007); and the critical frequency of the F 2 layer (f o F 2 peak) (De Santis et al. 1991Lazo et al. 2004). Notably, SCHA algorithms have been incorporated into the Assimilative Mapping of Ionospheric Electrodynamics (AMIE) mapping algorithm (Richmond and Kamide 1988). In addition to ionospheric and magnetospheric parameters, SCHA has been applied for mapping other quantities. One example is regional gravity field modelling on the moon (Han 2008), and on the Earth to which SCHA was originally applied by Jiancheng et al. (1995) with clarifications and corrections on its use by De Santis and Torta (1997) and additional work by Hwang et al. (2012). Another example is modelling sea level data (Hwang and Chen 1997).
This Chapter discusses the application of SCHA for mapping plasma flow in the high-latitude ionosphere based on data from multi-satellite missions such as is available from the Swarm mission.

Theory
The theory of SCHA was originally described in Haines (1985a) for mapping regional magnetic fields. It is assumed that a data set or region of interest is described on a limited portion of the spherical Earth described by a spherical cap. Data may be mapped in one, two or three dimensions. For the purpose of the electrostatic potential and plasma flow, two-dimensional mapping is considered. The necessary theory is summarized here with discussions on the relevant boundary conditions and recommendations on the appropriate choice of mapping parameters.

Spherical Cap Geometry
The spherical cap is constructed by extracting a conical section of angular radius θ c from a sphere and considering the outer slab of the section which extends from radius r 1 to r 2 , see Fig. 9.1. A spherical cap coordinate system is defined with respect to the centre of the outer shell of the spherical cap with θ and φ representing co-latitude and longitude, respectively, in the spherical cap coordinate system. Co-latitude spans from 0°to θ c whereas ϕ spans the full 0°-360°range. For the two-dimensional mapping considered here, r 1 = r 2 and the spherical cap reduces to a thin spherical cap shell. In general, the parameter being mapped is given in a spherical coordinate system (i.e. geographic or geomagnetic) and it is necessary to first transform both coordinate locations and the vector-pointing directions to the spherical cap coordinate system to simplify calculations. Figure 9.2 illustrates the transformation from an arbitrary spherical coordinate system to the spherical cap coordinate system. Consider an arbitrary point P in the spherical coordinate system having coordinates (θ , φ ) measured with respect to the North Pole (NP). Point P has corresponding coordinates of (θ, φ) in the spherical cap  Cartoon illustrating the transformation of the north-pole centred coordinate system to the spherical-cap coordinate system coordinate system which is centred about the spherical cap pole (SCP), which does not necessarily coincide with NP. If the location of SCP corresponds to (θ SCP , ϕ SCP ) in the spherical coordinate system, then (θ, φ) can be determined from (θ , φ ) using spherical trigonometry as follows: cos θ = cos θ cos θ SC P + sin θ sin θ SC P cos ϕ − ϕ SC P (9.1) where Eq. (9.2) can be rearranged to solve for φ cos ϕ = cos θ cos θ SC P − cosθ sin θ sin θ SC P .
Appropriate selection of the size and location of the spherical cap is necessary to ensure optimal performance of the SCHA algorithm. Both the central location of the spherical cap and θ c should be chosen to ensure adequate data coverage across the entire spherical cap to support the desired spatial resolution of the resultant mapped data (e.g. see Sect. 9.5). When data are not distributed uniformly techniques can be applied to describe the region of the spherical cap which is adequately constrained by data to produce an accurate map. Such techniques are discussed in Sect. 9.5.

Mapping Electrostatic Potential and Ion Flow by Series Expansion
It is often desirable to represent the electrostatic potential ( E ) over a global or discrete region. For regional mapping, SCHA may be applied. Consider a spherical cap located on a thin spherical shell within the ionosphere on which the potential is to be mapped. Regional mapping of E is performed by representing E by series expansion (e.g. Fiori et al. 2010) where θ and ϕ represent co-latitude and longitude in the spherical cap coordinate system, P m n k (m) (cosθ ) are the Associated Legendre functions of the first kind having a non-integer degree n k (m) and order m, k is an integer degree-indexing term, and K max and M max are the maximum degree-index and order which truncate the series expansion. M max ≤ K max and the choice of both M max and K max is dependent on the desired latitudinal and longitudinal mapping resolution and the distribution of data within the spherical cap. In the following notation, M max is taken to be k. In Eq. (9.4), coefficients A km and B km are constants for each combination of k and m which represent the amplitude of the harmonics. These coefficients must be determined to describe E at any point within the spherical cap. Equations for calculating the Associated Legendre functions with non-integer degree follow in Sect. 9.2.3.
Electrostatic potential is related to the electric field (E) and velocity (v) on the spherical shell through where B is magnetic field and is commonly taken to be the radial component of either the dipole magnetic field or of the International Geomagnetic Reference Field (IGRF), although measurements could be used. Breaking Eq. (9.5) into components yields which can be substituted into Eq. (9.6) to describe velocity as (9.10) In Eqs. (9.7)-(9.10) r represents the radius of the spherical shell on which the surface is mapped. Typically this is taken to be the radius of measurement. For representing ionospheric plasma flow this is more commonly the radius of the Fregion ionosphere (typically~300 km altitude), and it is sometimes necessary to map measurements to this altitude.
Coefficients A km and B km are determined by minimizing the difference between parameters that are measured by the instrument and represented using Eqs. (9.4), (9.7) and (9.8), or (9.9) and (9.10), depending on the parameter being measured. Minimization is performed using a method such as linear regression or singular value decomposition (SVD) (Press et al. 1992;Brandt 1998). To minimize anomalies due, for example, to a poorly constrained solution over a portion of the spherical cap, the coefficient rejection procedure described in Haines and Fiori (2013), which eliminates non-significant fitting coefficients, can be applied.
To better understand how the fitting coefficients are determined regardless of whether E , E, or v is known, consider observations of some arbitrary parameter f (r, θ, ϕ) scattered across a spherical cap which can be represented as where A km and B km are fitting coefficients as before, and c km (r, θ, ϕ) and d km (r, θ, ϕ) are basis functions. Here there are (K max + 1) 2 fitting coefficients. To model f(r, θ, ϕ) anywhere within the spherical cap, physical measurements f i must be substituted into Eq. (9.11) to solve for the fitting coefficients where Consider N observations of some measured quantity f i (r i , θ i , ϕ i ). An array of N equations may be written as follows: f 1 = A 00 c 00 1 + B 00 d 00 1 + A 10 c 10 1 + B 10 d 10 1 + · · · + A K K c K K 1 + B K K d K K 1 f 2 = A 00 c 00 2 + B 00 d 00 2 + A 10 c 10 2 + B 10 d 10 2 + · · · + A K K c K K 2 + B K K d K K 2 . . .
where, for simplification, the notation K = K max , c km i = c km (r i , θ i , ϕ i ), and d km i = d km (r i , θ i , ϕ i ) has been used. Such equations may be written in matrix form as or more simply as where F represents an N × 1 matrix of the measured quantities, CD is an N × (K max + 1) 2 matrix, and AB is a (K max + 1) 2 × 1 matrix composed of the A km and B km fitting coefficients. In the case of electrostatic potential, electric field, and plasma flow considered in this Chapter, parameter f i is taken to represent measured values of E , or measured components of E or v, and CD is derived from Eq. (9.4) for E , and Eqs. (9.7) and (9.8) for E, or Eqs. (9.9) and (9.10) for v. It is worth noting that matrix CD is entirely dependent on measurement coordinates. Applications of SCHA requiring the repeated mapping of data from fixed stations may take advantage of this fact as CD need only be calculated once. Such a consideration greatly enhances the speed of calculation.

Associated Legendre Functions
It is useful to define the Associated Legendre Functions and their calculation with a non-integer degree term. Haines (1985aHaines ( , 1988 describe the Associated Legendre Functions of non-integer degree, n k (m), and order, m, as a power series given by A j (m, n) sin 2 j θ 2 (9.14) with a derivative with respect to θ given by where A j (m, n) is given by and K m n is a normalization constant. Normalization is necessary to ensure manageable calculations in determining the solution of the expansion coefficients. Sample normalizations include the Schmidt or Neumann normalizations which take K m n = 1 for m = 0, and for m = 0 where Eq. (9.17) represents the Schmidt normalization and Eq. (9.18) represents the Neumann normalization with the Condon-Shortley phase term. Ultimately, the choice of normalization coefficient is not in itself crucial, as long as the same normalization is used consistently throughout the calculation. When dealing with a non-integer degree term, the factorials in the normalizations constants given by Eqs. (9.17) and (9.18) are replaced by where the gamma function ( ) is given by In practice, the power series in Eq. (9.16) is truncated at J determined by evaluating each term during computation. Haines (1988) suggest a truncation limit of 60 terms.

Boundary Conditions and Basis Functions
The solution of Eq. (9.4) is, of course, subject to boundary conditions. The first boundary condition requires continuity in longitude such that restricting m to be both real and integer valued. The second boundary condition requires that E be independent of ϕ at the spherical cap pole thereby ensuring regularity of E . This condition has already been satisfied by using Associated Legendre Functions of the first kind in Eq. (9.4) and excluding those of the second kind. The final boundary condition requires E and ∂ E ∂θ be arbitrary at the boundary of the spherical cap (θ = θ c ): where f(r, ϕ) and g(r, ϕ) are arbitrary functions. This boundary condition is met by choosing n k (m) such that forming two sets of basis functions having a real degree n k (m) which is not necessarily an integer (Haines 1985a).
Although two basis functions are defined (Eqs. (9.25) and (9.26)) it is not necessary, and sometimes not advisable, to use both; there may be a physical significance behind choosing only one basis function, or it might be desirable to simplify the solution. The choice of basis functions depends on the parameter being mapped with consideration of the significance and cost of using one or two basis functions.
There are many examples in the literature where only the k-m = odd basis function (Eq. (9.25)) is used. Green et al. (2007) apply SCHA to mapping ionospheric conductance combining magnetic data from satellites and magnetometers, and electric field data from the Super Dual Auroral Radar Network (SuperDARN) and the Defense Meteorological Satellite Programs (DMSP) satellites. SCHA techniques are applied to all data sets using only the k-m = odd basis function, which forces the mapped parameter to zero at the boundary of the spherical cap. They do this by setting the spherical cap boundary to zero equatorward of the current systems to reduce the impacts on the mapped current systems. In one instance they set θ c = 50°M LAT, but limited the plotting region to θ > 40°. Limiting the solution by calculating n k (m) using the k-m = 0 condition can be useful if it physically significant for the mapped parameter to be zeroed at the boundary of the spherical cap. Green et al. (2006) follow similar techniques in mapping the Birkeland currents based on Iridium and SuperDARN data. In another example, Weimer (2005) and Fiori et al. (2010) make use of this technique for mapping the ionospheric convection pattern using a spherical cap centred at the geomagnetic pole and extending to the equatorward boundary of the convection zone, where the plasma flow is expected to be zero. It should be noted that using only the k-m = odd basis function can lead to Gibb's phenomenon (often referred to as ringing) at the boundary of the spherical cap. Torta et al. (1992) propose using a spherical cap much larger than the region mapped to accommodate the larger wavelength to solve this problem. Solutions outside of the mapping region are ignored. Limiting the solution using the k-m = 0 basis function forces the mapped parameter to zero at the boundary of the spherical cap which is a useful tool when it is physically significant to do so.
Other situations have required the use of only the k-m = even basis function (Eq. (9.26)), thereby forcing the derivative of the mapped parameter to zero at the spherical cap. Examples include Weimer et al. (2010), Weimer (2013) and Pothier et al. (2015) who use the k-m = even basis functions to map geomagnetic perturbations from ground-based magnetometer data for cap-sizes ranging from 50°to 90°. These three papers are related and use the SCHA algorithm described here with only the k-m = even basis functions to reduce unnatural oscillations at the low-latitude boundary of the spherical cap where data are more sparsely distributed. A widely used application of the k-m = even basis function is in the Assimilative Mapping of Ionospheric Electrodynamics (AMIE) technique which maps various electrodynamic quantities in the high-latitude ionosphere. AMIE fits data over the hemisphere using SCHA functions with k-m = even basis functions poleward of 56°magnetic latitude followed by another tapering function from 56°magnetic latitude to the equator (Richmond and Kamide 1988).
The selection of what basis function(s) to use requires a discussion of both uniform convergence and orthogonality of the function. Haines (1990) explains that independently these basis functions are uniformly convergent and orthogonal, but their derivatives are not uniformly convergent unless of course the solution really does have a zero slope at the boundary of the spherical cap. Considering both basis functions in the solution ensures that both the parameter being mapped, and its derivative is uniformly convergent.
The consequence of the uniform convergence gained by using both sets of basis functions is sparse non-orthogonality of the system over the expansion interval. The two functions P m n j (m) (cosθ ) and P m n k (m) (cosθ ) are orthogonal when j = k and when j-m and k-m are either both even or both odd but they are not orthogonal when one is even and one is odd. Non-orthogonality means that the expansion terms must be expressed using a specific truncation limit (i.e. not infinity) and the coefficients determined are therefore dependent on the maximum truncation level and are dependent on the choice of K max . In terms of computation of the solution, non-orthogonality causes nondiagonal terms (ill-conditioning) in the least-squares matrix affecting the solution of the fitting coefficients. Korte and Holme (2003) criticize the commonly used practice of coefficient rejection discussed in Sect. 9.2.2 as having no physical justification in SCHA due to the incomplete orthogonality of the basis functions. Problems are more pronounced for high truncation levels, particularly if the field being mapped has a large amplitude, and for small spherical caps. Although this non-orthogonality is sparse, and it is possible to minimize the impacts, it should be considered when using both sets of basis functions.
Extreme care should be taken in determining whether or not one or both basis functions should be used. In general, limiting the solution with the k-m = odd basis functions severely limits the solution and should only be applied when it is physically significant to force the solution to zero at the boundary of the spherical cap. To allow the solution to take on an arbitrary value at the boundary of the spherical cap (unless of course the solution is required to be zero at the boundary), it is, therefore, recommended that if SCHA is to be applied with only one boundary condition, then the k-m = even boundary condition should be used. Although it may be desirable to promote orthogonality by using only one set of basis functions, keep in mind that the consequence is essentially throwing out half the solution, and this is a consequence that must be considered.  Table 9.1 provides an example of the n k (m) values for all combinations of k and m for θ 0 = 30°. Before continuing, it is useful to take a moment to fully understand what the non-integer degree term n k (m) represents. In ordinary SHA, n k (m) is equivalent to the integer-valued degree-indexing term k and describes the sectioning of features in both latitude and longitude across the sphere; there are k-m divisions in latitude and m divisions in longitude. In SCHA, k and m also describe sectioning, but over the spherical cap opposed to the entire sphere; there are (k-m + 1)/2 divisions in latitude and 2 m divisions in longitude. Here sectioning defines the resolution of features that can be mapped using either SHA or SCHA, with a minimum resolution described for k = K max and m = 0 (for example see Fig. 9.2 of Fiori et al. 2014).

Non-integer Degree
Regional mapping of ionospheric parameters using SCHA has advantages over global-scale mapping of the same parameters. Most notably, the distribution of ground-based observatories is highly dependent on the location of land and on political boundaries. It is, therefore, possible to obtain a higher resolution map over a specific region of interest (i.e. a specific country or continent) than over the globe. Both Haines (1990) and Amm and Viljanen (1999) point out that since n k (m) > k (see Table 9.1), the SCHA techniques uses higher order Associated Legendre functions than the SHA technique, and is, therefore, able to achieve a higher spectral resolution over SHA. As an example, the CGRF, which is a regional version of the IGRF with a spherical cap centred over Canada, is able to achieve a higher resolution depicting spatial variations of 833 km compared to 4000 km for the IGRF. In the case of a sparse global data set with irregularly spaced pockets of high-resolution data an SHA solution may require more basis function than data points resulting in a poor fit whereas an SCHA fit over a specific region of dense measurement offers a higher resolution fit with fewer basis functions. Practical considerations In a theoretical setting, data are uniformly distributed about the spherical cap and the resolution of the mapped structures is a known quantity. Realistically conditions are much less ideal. This Section addresses some of the considerations necessary to apply SCHA based on a more realistic data set.
In practice, data are not uniformly distributed about the entire spherical cap as instrument locations are limited by physical parameters such as a satellite orbit or the availability of land. Mapping using a measurement-only data set has an optimal solution in the sense that the differences between the measured and calculated parameters are minimized. However, the coefficients are only well constrained over the region of measurement. Over regions not constrained by measurements, the same coefficients can cause wildly unrealistic solutions for the mapped parameter. If a smooth solution is required over the entire spherical cap, the fitting must be constrained over regions lacking measurements, using, for example, data from a statistical or empirical model.   There are numerous examples where a statistical model has been used to constrain a non-uniform data set (e.g. Richmond and Kamide 1988;Shepherd and Ruohoniemi 2000). Although the use of a model is sometimes statistically significant or necessary, care should be taken to ensure there are enough data points to overwhelm the model. Alternatively, weighting factors can be used to put more emphasis on measured data compared to the model. For an example of weighting applied to spherical harmonic mapping see Ruohoniemi and Baker (1998) who mapped ionospheric plasma flow using a modified form of spherical harmonic analysis, or Rogers and Honary (2015) who mapped absorption derived from riometer measurements.
Often it is not desirable to constrain an under sampled parameter with contributions from a statistical or empirical model, and other solutions must be explored. Walker (1989) faced a similar problem in applying SCHA techniques for mapping magnetic data based on a sparse distribution of magnetometer stations across Canada. He performed his mapping by reducing the number of longitudinal coefficients by selecting M max < K max in the spherical cap harmonic expansion to effectively reduce the longitudinal resolution of the model. He argues that this is applicable to magnetic data as the mapped features tend to have more latitudinal than longitudinal structure and reducing the number of longitudinal coefficients enhances zonal features. Such a process also serves to prevent the number of coefficients from exceeding the number of observations and provides a first order estimate of the mapped parameter. Weimer (1995) also proposes smoothing the data by selecting M max < K max for the purpose of mapping electrostatic potentials at high-latitudes, although it should be noted that their technique relies on a modified SHA algorithm opposed to SCHA. Weimer et al. Another solution to handle an under sampled spherical cap is to apply a masking algorithm to map the mapped parameter only where constrained by data. Fiori et al. (2014) describe such an algorithm which they apply to limit mapping to a region of reliability surrounding measurement data points. They call the mapped region the 'region of constraint' or RoC. The method of determining the RoC is summarized here.
Essentially, a radius θ is defined to describe the region surrounding each data point around which the function is considered to be well constrained: where θ c and K max are described as before, and p represents the number of points that must be known along a given wavelength to accurately map a given wavelength.
For each data point, the number of additional data points located within θ of the data point being evaluated is counted. If there are at least p data points, the region defined by θ is considered valid. The sum of all valid regions constitutes the RoC.
For a given θ c and K max , accurate portrayal of the mapped parameter requires an appropriate definition of the RoC, which, from Eq. (9.27) is entirely dependent on the selection of p. The appropriate choice of p is somewhat ambiguous. Theoretically, a uniform distribution of data points would require p = 2 (i.e. the Nyquist frequency) for each spatial dimension being mapped. For a more realistic distribution of points, larger values of p are recommended. An incorrect selection of p can unnecessarily restrict (p too large) or inflate (p too small) the RoC. Restricting the RoC would potentially cause the loss of valuable information, resulting in a smoothed solution, whereas inflating the RoC risks the inclusion of poorly constrained portions of the mapped function, which are not representative of the true mapped parameter. Figure 9.4 presents examples of the RoC applied to hypothetical coordinates for the Swarm satellite mission. For the purpose of this Figure, data are considered at a 2 Hz resolution over a 4-min interval along a possible satellite path where the lower satellite pair (Swarm A/C) is illustrated in blue and green and the upper satellite (Swarm B) is illustrated in red. Figure 9.4a, b are for the case where the spherical cap is large and covers the entire high-latitude convection zone with θ c = 32°, and the RoC is calculated for K MAX = 6. The RoC in Fig. 9.4a is shown for p = 6 and is much larger than the RoC of Fig. 9.4b where a more conservative value of p = 28 was chosen. In Fig. 9.4c a spherical cap centred over the area of measurement is considered and the RoC is shown for K max = 2 and p = 6.
Regardless of the data distribution, it is necessary to select an appropriate value for K max , and therefore n k (m), to ensure an accurate representation of the mapped parameter based on the available data. Selecting too low a value of K max will result in an overly smooth map whereas too large a value will cause overfitting of the data. Consider, for example, mapping some arbitrary function on a spherical cap having a surface area A where If there are n data points uniformly distributed about A, then the spacing, θ, between points is given by (9.29) and the minimum wavelength (λ min ) that can be mapped is given by (e.g. Bullard 1967) where p is the minimum number of points that must be present on a given wavelength. (9.31) Equation (9.31) defines the maximum values of n k (m) appropriate for mapping a given data set assuming a uniform distribution of points. For the case of small m, n k (m) can be approximated by (Haines 1988) (9.32) Equation (9.31) can then be used to approximate the maximum degree-index as (9.33) In reality, data are not distributed uniformly and it is necessary to select a lower value of K max , and therefore n k (m). Too large a value results in the formation of unphysical flow structures in the mapped field in regions of the spherical cap where the λ min defined by K max is less than the θ characterizing measurement locations within that specific region of the spherical cap. Such problems are more pronounced along the edges of the spherical cap as the solution is only bounded on one 'side' (i.e. within the spherical cap). However, this problem can be improved by including data from outside the spherical cap where possible, even though the solution to E is limited to within the spherical cap. Alternatively, or additionally, a coefficient rejection procedure can be implemented to reject any insignificant coefficients which, although they may add a slight reduction to the minimization performed in the fitting procedure, do not contribute to the solution (Haines and Fiori 2013). Green (2006) points out that the choice of K max must also necessarily depend on the number of available observations within the spherical cap. As K max increases (i.e. the spatial resolution decreases), the number of basis functions (i.e. the number of coefficients in the series expansion) increases. Care should be taken to ensure that the number of basis functions does not exceed the number of data points. Green (2006) provides an excellent example in their Sect. 9.3. From Eq. (9.33) it is obvious that determination of the appropriate maximum value of n k (m) to map a given data set is dependent on an appropriate choice of p. As noted above, p = 2 is the absolute minimum, requiring 2 observations per wavelength. However, for a real data set with irregularly spaced observations most likely contaminated by noise, a larger value of p is more practical to ensure a good fit (Fiori et al. 2010). Bendat (1958) actually suggests that p should be chosen in the range of 10-20, but the author's experience suggest that such a dense distribution of measurements is an unreasonable assumption. In practice the choice of p is largely dependent on the typical distribution and quality of data for a given data set and is up to the discretion of the user. As an example, Fiori et al. (2010) suggest p = 6 for mapping two-dimensional plasma flow based on a data set smoothly distributed throughout the spherical cap. In examining satellite data confined to a narrow track transecting the spherical cap, Fiori et al. (2014) provide recommendations for selecting p based on evaluating the goodness-of-fit of the resultant map.
An additional consideration is the location and size of the spherical cap, given by θ c . Ideally, the cap should be placed either centred over the data set having a radius which fully encompasses the data, or over a specific geographic (or geomagnetic) region of interest. Errors associated with cap-size may arise when attempting to map wavelengths that are larger than the spherical cap, for example, when mapping secular variation. Such a problem is commonly encountered when mapping magnetic field data and is solved by subtracting a known reference field, such as the IGRF, to represent the residual value, and adding the reference field back after solving for the fitting coefficients. Haines (1985a) proposes this as a solution to a poor fit at the boundary of the spherical cap due to not including data outside of the spherical cap.

Practical Example of Mapping Ionospheric Plasma Flow Using SHA and SCHA Approaches
The Super Dual Auroral Radar Network (SuperDARN) (Greenwald et al. 1995;Chisham et al. 2007) samples the high-latitude plasma flow pattern every 1-2 min in both the northern and southern hemisphere. The advantage of the large spread of measurements has been modelling of the ionospheric electric potential. Restriction of measurements to only roughly 1/3 of the sphere leads to ill-conditioning of the leastsquares modelling of the potential using SHA approaches. Ruohoniemi and Baker (1998) instead take the approach of redistributing the data in co-latitude across a larger region in a method commonly referred to as either the map potential or FIT technique. The FIT technique redistributes the data located poleward of a predefined boundary (θ FIT ) across the entire sphere opposed to the hemisphere. The redistribution is performed by scaling co-latitude by α = 180 • /θ F I T to effectively 'stretch' the data across the sphere. Following redistribution, SHA is applied in the usual way by representing the electrostatic potential as a series expansion built with Associated Legendre Functions of integer degree and order. Once the electrostatic potential is modelled, the model is carefully 'un-stretched' from the entire sphere to the highlatitude region poleward of θ FIT . Redistribution of data across the entire sphere forces the boundary defined by θ FIT to a single point at θ = 180°thereby forcing the electrostatic potential at θ FIT to zero. Although undesirable for general mapping, the consequence to mapping the electrostatic potential does have physical significance, as the ionospheric convection pattern is expected to close at some low-latitude boundary (i.e. Hairston and Heelis 1990;Heppner and Maynard 1987;Rich and Hairson, 1994;Weimer 1995;Fiori et al. 2016). In the FIT technique, the low-latitude boundary given by θ FIT is determined based on the distribution of low-velocity (<100 m/s) measured velocities. Zeroing the electrostatic potential at θ FIT would be difficult to achieve using SHA without redistribution of the data and would require a very-high-order fit. In contrast, the SCHA algorithm could be used with only the k-m = odd basis functions, which has been investigated by Weimer et al. (2005) and Fiori et al. (2010Fiori et al. ( , 2013. Care should be used when applying the FIT technique in general. It is not clear what impact the changing data density caused by the redistribution of data has on the overall fit. For example, consider two pairs of observations separated by 111 km located at θ 1 = 29.5°and θ 2 = 10°for θ FIT = 30°. In the transformed regime, θ 1 = 177°and θ 2 = 60°, and the pair of points are now separated by 12 km and >500 km, respectively. The impact of this redistribution is unclear. Mapping electrostatic potential through the FIT technique also requires the exact location of the low-latitude boundary of the ionospheric convection pattern, defined by θ FIT to be known. For example, Fiori (2011) show that one consequence of a boundary located too far equatorward is the reduction of the calculated cross-polar cap potential (CPCP), which is a significant finding as SuperDARN electrostatic potential maps are shown to consistently report lower CPCP compared to values determined by other means using other instruments (i.e. Shepherd 2007). Fiori et al. (2010) point out that constraints applied by the FIT technique to ensure a smooth fit over the high-latitude region, namely forcing a low-latitude boundary to the flow and the use of a statistical convection model (see Sect. 9.5), potentially distort the mapped convection. They apply an SCHA algorithm for mapping ionospheric convection based on SuperDARN measurements using the techniques discussed above and examine the impacts on both global-scale and regional-scale mapping. The SCHA technique is shown to perform comparably to the FIT technique over regions of good data coverage, and to provide a better solution over regions of highly variable flow, particularly near the low-latitude boundary of the convection zone near θ FIT .

Application of SCHA for Mapping Ionospheric Plasma Flow Based on Swarm Satellite Ion Drift Measurements
An application of the SCHA algorithm discussed in this Chapter is the mapping of ionospheric data from multi-spacecraft missions. Satellite data from various missions have been incorporated into single or multi-instrument data sets using techniques not limited to SCHA for magnetic field mapping (e.g. An et al. 1998;AMIE;Green et al. 2007;Haines 1985b;Kotzé 2002), or for mapping statistical convection patterns based on satellite data collected over a long period of time (e.g. Heppner and Maynard 1987;Rich and Maynard 1989;Hairston and Heelis 1990;Rich and Hairston 1994;Papitashvili et al. 1999;Papitashvili and Rich 2002;Weimer 1995). However, as of the time of writing, the authors of this Chapter are not aware of the application of SCHA to the instantaneous mapping of satellite data. However, extensive work has been performed in Fiori et al. (2013Fiori et al. ( , 2014 to evaluate the potential for mapping ionospheric plasma flow based on artificially generated Swarm ion drift measurements. This Section provides a summary of this work. One objective of the Swarm mission is an investigation of electric currents flowing in the Earth's ionosphere which drive ionospheric electric fields and ion drift. Each satellite is therefore equipped with an electric field instrument (EFI) capable of measuring the three-dimensional ion drift (Knudsen et al. 2003(Knudsen et al. , 2017. Ion drift measured in the along-track and cross-track directions by two orthogonal bi-dimensional Thermal Ion Imagers (TIIs) are combined to create a two-dimensional ion drift vectors describing plasma flowing in the horizontal plane. Such vectors may be processed using the SCHA mapping procedures described in this Chapter to map the twodimensional plasma flow. The algorithm is fairly straightforward and is described as follows.
(1) For the interval of interest, combine along-track and cross-track ion drift measurements to create two-dimensional vectors of the horizontal ion drift. If desirable these ion drift vectors can be mapped down from the satellite altitude to the F-region peak of the ionosphere (e.g. Walker and Sofko 2015). For example, ion drifts mapped down from 470 km to 300 km, would be reduced by approximately 4%.
(2) Build the matrices described by Eq. (9.13). If there are N measurements, then matrix F represents a 2 N × 1 matrix of the measured ion drift in the θ (v θ ) and ϕ (v ϕ ) directions. Note that each ion drift component is calculated from the twodimensional ion drift and then considered separately. CD is a 2 N × (K max + 1) 2 matrix derived from Eqs. (9.9) and (9.10) for v θ and v ϕ , and AB is a (K max + 1) 2 × 1 matrix composed of the A km and B km fitting coefficients. (3) The fitting coefficients are solved as described in Sect. 9.2.2. (4) Fitting coefficients are used to calculate the two-dimensional ion drift within the spherical cap where adequately constrained by data. This SCHA algorithm has been applied to (1) examine convection mapping on a global-scale spanning the entire convection zone in the high-latitude region based on both a Swarm-only data set and a multi-instrument data set , and (2) explore the possibility of convection mapping with a Swarm-only data set over a localized region centred over the satellites' orbit, and determine parameters for evaluating the appropriate size of the localized region and the goodness-of-fit that can be obtained (Fiori et al. 2014). Note that due to the unavailability of definitive Swarm data at the time of publication, Fiori et al. (2013Fiori et al. ( , 2014 rely on artificially generated ion drifts emulated from a statistical model along hypothetical Swarm satellite tracks. For a full description of the emulation technique, see either paper. The SCHA techniques described here could equivalently be applied to hypothetical or real data. Fiori et al. (2013) examined SCHA for mapping the high-latitude ionospheric convection pattern based on a Swarm data set using a global-scale spherical cap. In order to map the entire high-latitude convection patter, the spherical cap was centred at the north magnetic pole extending to~60°MLAT (θ c = 30°). They show that even when all three satellites cross the spherical cap at the same approximate time, the Swarm data coverage is insufficient to support such large-scale convection mapping based on a Swarm-only data set; the RoC does not exceed the measurement location. However, they do show that inclusion of the Swarm data with a complementary data set has the potential to increase the region of the spherical cap populated by data thereby improving resultant convection maps.
In the case of Fiori et al. (2013), the complementary data set under consideration was the SuperDARN (Greenwald et al. 1995;Chisham et al. 2007) which samples the high-latitude plasma flow pattern continuously every 1-2 min in both the northern and southern hemisphere. Currently, SuperDARN consists of radars with a collective field of view that covers the majority of the high-latitude region (within~30°of either magnetic pole), extending to mid-latitudes. However, despite this superior coverage, there are frequently gaps in the data due to a variety of circumstances including geomagnetic activity, solar activity, season, and magnetic local time (MLT) of observation (Ruohoniemi and Greenwald 1996;Danskin et al. 2002;Shepherd et al. 2002;Koustov et al. 2004;Shepherd 2007). It is common practice within the SuperDARN community to supplement real data with data from a statistical convection model to produce a well-constrained and smooth map (Ruohoniemi and Baker 1998;Shepherd and Ruohoniemi 2000;Ruohoniemi and Greenwald 2005;Cousins and Shepherd 2010;Pettigrew et al. 2010). Statistical models are useful in expanding convection data so that the RoC covers the entire high-latitude region during periods of stable convection but do not always accurately represent the true plasma flow during more turbulent conditions (e.g. Fiori et al. 2010). In such instances, it is more useful to include data from other instruments, such as is available from the Swarm satellites to fill in gaps in the SuperDARN data set in order to increase the overall RoC that can be mapped.
Examples presented in Fiori et al. (2013) demonstrate how effectively data from the Swarm satellite can increase the RoC for global-scale convection mapping with SuperDARN. For instance, Fiori et al. (2013) present one case (reproduced in Fig. 9.5) where despite excellent SuperDARN coverage the RoC is insufficient to determine the cross-polar cap potential (CPCP) without adding contributions from a statistical model or other instruments. Figure 9.5a illustrates hypothetical measurement locations for the SuperDARN and Swarm instruments. In Fig. 9.5b, convection is mapped based on a global-scale spherical cap (θ c = 32°) centred at the north magnetic pole for K max = 6 and p = 6. Black contours indicate the electrostatic potential associate with the convection pattern, and the plus sign indicates the maximum potential. Because the minimum potential cannot be mapped, it is not possible to determine the CPCP. Addition of data from a single Swarm satellite (here data has been artificially generated based on a statistical model based on solar wind and IMF conditions), slightly enlarges the RoC. Inclusion of hypothetical data from all three Swarm satellites increases the RoC sufficiently to allow determination of the CPCP. Fiori et al. (2013) show that the addition of Swarm ion drift data to a SuperDARN data set can cause an average relative increase in the RoC of 12.5% for periods when 1-3 Swarm satellites are located in the high-latitude region, with the greatest contributions being made when Swarm data are located at auroral latitudes.
In addition to supplementing other data sets for the purpose of global-scale convection mapping, Swarm data may also be considered independently for mapping more localized regions. For localized convection mapping data may be considered for three different satellite configurations: a single satellite track (upper satellite Swarm B), a double satellite track (lower satellite pair Swarm A/C), or for the case where all three satellites overlap. As an example, consider a regional spherical cap with θ c = 10°, which corresponds to roughly 4-min of observation processed with K max = 3. Figure 9.6 shows two statistical convection models within such a spherical cap centred at 80°magnetic latitude and 12 MLT. Figure 9.6c indicates the location of sample satellite tracks. Artificially generated Swarm ion drift vectors generated from these statistical models along the satellite paths illustrated in Fig. 9.6c can be used to map convection on the localized spherical cap. Such maps are shown in Fig. 9.7 where the RoC is described by p = 6. Maps in Fig. 9.7a, b can be compared to the original statistical model in Fig. 9.6a, b (and mapped using black vectors in Fig. 9.7), respectively. The visual comparison indicates good overall agreement between the mapped vectors and the statistical model, with the greatest difference occurring at the outlying region of the RoC, suggesting the RoC could be reduced by increasing the value of p.
Although a three-satellite map offers more data for convection mapping, and is, therefore, more likely to produce a more accurate map, it is not a frequent occurrence. In the next example, consider the case where only the lower satellite pair is available for mapping. In Fig. 9.8a the IMF B z > 0 convection pattern illustrated in Fig. 9.6b is  Fiori et al. (2013Fiori et al. ( , 2014) are used. c shows a 4-min segment of the Swarm A (blue), C (green), and B (red) satellite orbits Fig. 9.7 Coloured vectors indicate convection determined based on Swarm measurements artificially generated along the satellite tracks shown in Fig. 9.6c based on the statistical models mapped in a Figs. 9.6a, b for a spherical cap centred at 80°MLAT and 12 MLT with θ c = 10°and K = 3. The RoC is defined with p = 6 used to artificially generate Swarm ion drifts for the Swarm A/C satellite pair which follow a dawn/dusk orientation. Artificially generated ion drifts are processed to create the convection pattern shown where the RoC is limited by p = 12. In Fig. 9.8b a similar map is generated for a noon/midnight satellite orientation using the IMF B z < 0 statistical convection model shown in Fig. 9.6a. Both maps indicate good agreement between the mapped convection and the statistical convection model. Fiori et al. (2014) examined the use of SCHA for mapping convection using a localized spherical cap centred over the lower Swarm satellite pair. Convection maps Fig. 9.8 Coloured vectors indicate convection calculated for θ c = 10°and K max = 3 for a spherical cap centred at 70°MLAT and 12 MLT for Swarm A and C measurements artificially generated using the a IMF B z > 0 convection pattern for a Swarm A satellite track offset 80°from the 12 MLT meridian and p = 12 and b IMF B z <0 convection pattern for a Swarm A satellite track offset 170°f rom the 12 MLT meridian and p = 12. Black vectors in (a) and (b) indicate the direction of the statistical model convection were created using the SCHA technique based on artificially generated Swarm measurements within a localized spherical cap having an angular radius, θ c, ranging from 4°to 15°. These maps used a K MAX that was calculated so that the SCHA mapping resolution matched that of the statistical model used to generate measurements. Within the study, the artificially generated Swarm data were used to generate 2502 maps for a variety of satellite orientations with RoC determined for varying values of p. Comparisons were made between the statistical model used to create the artificially generated measurements and the convection mapped using SCHA. These comparisons were used to categorize the maps as being well constrained or poorly constrained. Based on this analysis it was determined that the SCHA algorithm ideally maps Swarm data for θ c, = 10°, and was unreliable for θ c, ≥ 14°. Fiori et al. (2014) determined that Swarm-based measurements could successfully map convection over a localized region surrounding the satellite track to examine smallscale features in the flow, and that larger scale convection mapping can be achieved through combining multiple spherical caps.

Summary
This Chapter provides detailed explanations of how to map ionospheric plasma flows in the high-latitude region based on hypothetical ion drifts from the Swarm satellites using spherical cap harmonic analysis. SCHA is a useful technique for mapping data limited in space, and is closely related to spherical harmonic analysis which is commonly applied on a larger global scale. Although originally developed for mapping the three-dimensional magnetic field on a regional scale, SCHA techniques have been used to map a variety of one-, two-and three-dimensional properties. This Chapter provides a summary of the relatively new application of SCHA to two-dimensional mapping of ion drift.
Section 9.2 provides the necessary theory for applying SCHA to mapping ionospheric plasma flow, or convection. Equations for mapping electrostatic potential, electric field, and plasma flow in the ionosphere are provided along with discussion regarding the relevant basis functions and boundary conditions considered in the solution. Practical considerations such as the appropriate cap-size to use for a given data set and how to determine where the solution is adequately constrained by measurements are discussed. Section 9.3 provides an example of SHA and SCHA mapping of ionospheric convection based on the SuperDARN data. In Sect. 9.4 the theory developed in this Chapter is applied to the mapping of ionospheric ion drift measured by the Swarm satellites. Sample convection maps are presented which illustrate SCHA mapping of Swarm ion drift data (1) on a global scale in combination with measurements from additional ground-based instruments and (2) on a local scale using satellite measurements alone.
This Chapter clearly demonstrates the application of spherical-cap harmonic analysis techniques for mapping plasma flow patterns based on ion drift measurements from the Swarm satellite.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.