Introduction to Spherical Elementary Current Systems

This is a review of the Spherical Elementary Current System or SECS method, and its various applications to studying ionospheric current systems. In this chapter, the discussion is more general, and applications where both ground-based and/or satellite observations are used as the input data are discussed. Application of the SECS method to analyzing electric and magnetic ﬁeld data provided by the Swarm satellites will be discussed in more detail in the next chapter.


Introduction
At high magnetic latitudes, the ionospheric current system basically consist of horizontal currents flowing around 100-150 km altitude, and almost vertical field-aligned currents (FAC) flowing along the geomagnetic field, thus connecting the ionospheric currents to the magnetosphere. The magnitude, spatial distribution, and temporal variations of the horizontal currents and FAC can be estimated from the magnetic field they produce. Over the years, several techniques have been developed for this task, as discussed in various Chapters of this book (see also Vanhamäki and Juusola 2018, and reference therein). The present chapter gives an overall introduction to the The original version of this chapter was revised. Electronic Supplementary Material has been added to this chapter. The correction to this chapter is available at https://doi.org/10.1007/978-3-030-26732-2_13 Spherical Elementary Current System (SECS) method, while Chap. 3 deals with the specific application of the SECS method to magnetic data provided by the Swarm satellite mission.
Mathematically speaking, the elementary systems form a set of basis functions for representing two-dimensional vector fields on a spherical surface. This can, of course, be done in other ways too, e.g., by using spherical harmonic or spherical cap harmonic functions. The main difference is that the elementary systems represent the vector field in term of its divergence and curl, whereas harmonic functions are used to represent the scalar potential and stream function of the vector field. In principle, these methods should be equivalent, but in practice, each has its strengths and weaknesses. As will be seen, advantages of the SECS method include adjustable grid resolution, variable shape of the analysis region and no requirement for explicit boundary conditions.
The chapter begins with a summary of some basic electrodynamic properties of ionospheric current systems and the most commonly used approximations in Sect. 2.2. The 2D SECSs are introduced in Sect. 2.3. Their applications to analysis of two-dimensional vector fields and magnetic fields are discussed in Sects. 2.4-2.7. A one-dimensional variant of the SECS method, applicable to studies of singlesatellite magnetic measurements, is discussed in Sect. 2.9. Some practical issues when applying the SECS method are discussed in Sect. 2.10. Finally, a short overview of some of the studies where the SECS method has been used is given in Sect. 2.11.
An example MATLAB code demonstrating the use of SECS in the specific task of estimating ionospheric equivalent current from ground magnetic measurements is included as supplementary material in the electronic version of the book, including data from the IMAGE (International Monitor for Auroral Geomagnetic Effects 1 ) magnetometer network.

Short Review of Ionospheric Electrodynamics
A short summary of the relevant properties of ionospheric electrodynamics, especially at high magnetic latitudes (i.e., the auroral oval), is given in this section. For a more comprehensive introduction see, for example, Richmond and Thayer (2000). In the context of this chapter, ionospheric electrodynamics is described by the electric field, and the Hall and Pedersen conductivities and currents. Additionally, the magnetic perturbation created by the ionospheric currents is an important quantity in many studies. Thus, the focus is on macroscopic electric parameters, while many interesting phenomena, such as various chemical processes and particle dynamics, are ignored.
In the commonly used thin-sheet approximation (see e.g., Untiedt and Baumjohann (1993)) the ionosphere is assumed to be a thin, two-dimensional spherical shell of radius R at a constant distance from the Earth's center. The thin-sheet approxi-7 mation is justified by the fact that the horizontal currents flowing in the ionosphere are concentrated to a rather thin layer around 100-150 km altitude, where the Pedersen and Hall conductivities have their maxima. Thus the thickness of this layer is small compared to the horizontal length scale of typical ionospheric current systems. However, in some cases, three-dimensional modeling is required (Amm et al. 2008).
Above the ionospheric current sheet there is perfectly conducting plasma, where magnetic field lines are equipotentials, and below is the nonconductive neutral atmosphere. The electric field is assumed to be roughly constant in altitude through the thin current layer. Thus the Pedersen and Hall conductivities can be height integrated into Pedersen and Hall conductances, while the sheet current density J is obtained by similarly height integrating the horizontal part j h of the 3D current j.
In summary, the main electrodynamic variables are: horizontal sheet current density J, field-aligned current density j , horizontal electric field E, magnetic field B and height-integrated Hall and Pedersen conductances Σ H and Σ P . These variables are related through Maxwell's equations, Ohm's law, and current continuity: (2.4) In the last equation, the FAC density j just above the ionospheric current sheet is obtained by integrating the continuity equation ∇ · j = 0 ⇔ ∂ z j z = −∇ h · j h through the current sheet. Equations (2.1)-(2.4) employ the frequently used assumption of a radial magnetic field, so thatê = B/|B| = −ê r at the northern hemisphere. Due to the thinsheet approximation, only the radial component is needed in Eq. (2.1). According to Untiedt and Baumjohann (1993) and Amm (1998), the effect of the tilted field lines is negligible for inclination angles χ > 75 • , which covers the auroral zone. At lower latitudes the inclination of the magnetic field could be taken into account by modifying the Hall and Pedersen conductances in Eq. (2.3) (see e.g., Brekke 1997, Chap. 7.12) and by calculating the FAC as j = ∇ · J/ sin χ .
In a thin-sheet ionosphere the electric field E and horizontal current J are twodimensional vector fields, each of which can be represented by two potentials The function φ E is the usual electrostatic potential and ψ E is related to the rotational inductive part of the electric field (see e.g., Yoshikawa and Itonaga 1996;Sciffer et al. 2004). It is usually assumed that ∇ψ E = 0, but this does not hold in some situations (e.g., Vanhamäki and Amm 2011, and references therein). The current potential φ J is connected to FAC through Eq. (2.4), while ψ J represents a rotational current that is closed within the ionospheric current sheet. The latter part is also related to so called ionospheric equivalent current and ground magnetic disturbance, as discussed in Sect. 2.7.

Elementary Current Systems
In Sect. 2.2, the electric field and current were described in terms of potentials. This kind of representation is very common in many fields of physics, and can be applied by expanding the potential in terms of some basis functions, such as Fourier series, spherical harmonics or spherical cap harmonics (see, for example, Backus 1986, and Chap. 9 in this Book).
However, the fields can equally well be represented in terms of their sources and rotations, that is by their divergence and curl. This approach is used in the elementary system method. It is based on Helmholtz's theorem, which states that any wellbehaved (e.g., continuously differentiable) vector field is uniquely composed of a sum of curl-free (CF) and divergence-free (DF) parts.
Elementary current systems, as applied to ionospheric current systems, were introduced by Amm (1997). Although for historical reasons the name refers to currents, they can be used to represent any two-dimensional vector field. Basically, they represent a localized curl or divergence of the vector field. Such elementary systems can be defined either in spherical or Cartesian geometry, and they are called SECS and CECS, respectively. In this chapter, the spherical variant is used.
In accordance with Helmholtz's theorem, there are two different types of elementary systems: one is DF and the other CF. The spherical elementary systems, shown in Fig. 2.1, are defined in such a way that the CF system has a Dirac δ-function divergence and the DF system a δ-function curl at its pole, with uniform and oppositely directed sources elsewhere. It is easy to show (Amm 1997) that the vector fields have the desired properties of 1 Two-dimensional curl-free (CF) and divergence-free (DF) Spherical Elementary Current Systems (SECS). The CF SECS is shown with associated radial FAC. Adapted from Amm and Viljanen (1999) ∇ × V C F r = 0 (2.10) (2.12) Here, S C F and S DF are the scaling factors of the elementary systems, while R is the radius of the sphere (e.g., ionosphere) where elementary systems are placed. The above formulas are given in a spherical coordinate system (r, θ , φ ), with unit vectors (ê r ,ê θ ,ê φ ), oriented so that center of the elementary systems is at θ = 0. This coordinate system is used in the definition of the elementary system, as the expressions take the most simple form there. In the actual analysis, the elementary systems are rotated to a more suitable coordinate system, such as the geographical or geomagnetic system, as discussed in Sect. 2.5. Using the theory of Green's functions it can be shown (e.g., Vanhamäki and Amm 2011) that the CF and DF SECS form a complete set of basis functions for representing two-dimensional vector fields on a sphere. An individual CF SECS with its pole located at (R, θ el , φ el ) represents a source or sink of a vector field at that point, while a DF SECS represents rotational vector field around that point. Thus, by placing a sufficient number of CF and DF SECS at different locations at the ionosphere, one can construct any two-dimensional vector field from its sources and curls, in accordance with Helmholtz's theorem. In principle, the spatial resolution of the representation depends on the number and distribution of the elementary systems. However, in practical applications the amount of available data is a limiting factor.

Current and Magnetic Field
When using the SECS to represent currents, the DF systems form a rotational current that is closed within the ionospheric current sheet. This part of the current is described by ψ J in Eq. (2.6). The CF systems represent the same part of the current as φ J in Eq. (2.6), and are connected to the FAC via Eq. (2.4). The FACs are assumed to flow radially toward or away from the ionosphere, as illustrated in Fig. 2.1. As mentioned before, this is a reasonable assumption only at high magnetic latitudes. In addition to the δ-function at its pole, each CF SECS is also associated with a uniform FAC distributed all around the globe. However, in practice, the actual FACs are described by the δ-functions. The reasons is that if the analysis area is large enough, the sum of the SECS's scaling factors (i.e., sum or integral of the upward and downward FACs) is expected to be close to zero, so that the uniform FACs of the CF SECS will almost cancel each other.
When observing ionospheric current systems, the measured quantity is almost always the magnetic field produced by the currents. In order to use the SECS in these studies, the magnetic fields produced by the currents in individual CF and DF SECS need to be calculated, including the FAC in the case of CF SECS. Amm and Viljanen (1999) did this calculation for the DF systems, by straightforward (although somewhat tedious) evaluation of the vector potential from the Biot-Savart law. The result is that the magnetic field has only r -and θ -components, given by (2.13) where s = min(r, R)/max(r, R). The magnetic field of the CF system, with associated FAC, is most easily calculated using Ampere's circuit law, following the same reasoning as in Appendix A of Juusola et al. (2006). The important thing is to first convince oneself that, due to symmetries, the magnetic field must have the form B C F = B φ (r, θ )ê φ . After that it is easy to evaluate the circuit law and obtain the field as

Fig. 2.2
Geometry of the coordinate transformation. Elementary system is located at (θ el , φ el and the result is evaluated at (θ k , φ k ). θ is the colatitude of the point (θ k , φ k ) in the coordinate system centered at the elementary system. Adapted from Vanhamäki et al. (2003) It is left as an exercise to the reader to check that Eqs. (2.13)-(2.15) give the correct magnetic field. This is most easily done by verifying that (1) divergence of B C F and B DF is zero, (2) the discontinuity at the ionospheric current sheet (r = R) gives the horizontal current in Eqs. (2.7) and (2.8), (3) elsewhere the curl of B DF is zero and (4) the curl of B C F gives the correct FAC above the ionosphere.

Coordinate Transformations
The fields of individual CF and DF SECS in Eqs. (2.7) and (2.8) and (2.13)-(2.15) are given in a coordinate system that is centered at the SECS pole. Typically, the analysis is done in the geographical or geomagnetic coordinate system, which is now the unprimed system. Assume that measurements at locations (r k , θ k , φ k ), k = 1 . . . K , are available, and place the SECS at various locations (R, θ n , φ n ), n = 1 . . . N , in the ionosphere. In order to use the SECS, the colatitude θ and unit vectors (ê θ ,ê φ ) need to be transformed from the SECS-centered coordinate system to the geographical or geomagnetic system. The radial coordinate and unit vector require no transformation, as they are the same in both systems. This is a straightforward rotation of the coordinate system, but for completeness sake one possible method is presented here. The geometry of the situation is illustrated in Fig. 2.2. According to spherical trigonometry the colatitude θ is given by cos θ = cos θ k cos θ el + sin θ k sin θ el cos(φ el − φ k ).
(2.16) From Fig. 2.2 the unit vectors can be expressed as It is a straightforward exercise in spherical trigonometry to show that (2.20) With these expressions, it is easy to calculate the current or magnetic field at geographical location (r k , θ k , φ k ) that is produced by a SECS located at geographical point (R, θ el , φ el ).

Vector Field Analysis with SECS
In practical calculations, the elementary systems are placed at some discrete grid, and the scaling factors give the divergence and curl of the vector field in the grid cell. In some arbitrary grid cell n, the scaling factors are where da is the area element. This means that the curl and divergence distributed over the grid cell are represented by point sources at the center of the cell. With SECS a vector field (e.g., the ionospheric horizontal current or electric field) is composed of rotational and divergent parts as The composite vector V contains the θ -and φ-components of the vector field V at the grid points r k = (R, θ k , φ k ), (2.24) The vectors S C F and S DF contain the scaling factors of the CF and DF SECS, respectively, at grid points r el Here S DF (r el ) and S C F (r el ) should be interpreted as the average divergence and curl of V over the grid cells, as in Eqs. (2.21) and (2.22). The components of the transfer matrices M 1,2 can be calculated using Eqs. (2.7) and (2.8), as explained in detail by Vanhamäki (2011). Figure 2.3 illustrates how an irrotational potential field can be modeled with just CF elementary systems. In this case the vector S DF in Eq. (2.23) is zero.
A given vector field V could be represented with elementary systems by evaluating the integrals in Eqs. (2.21) and (2.22) over a suitable grid. However, it is often more practical to rewrite Eq. (2.23) as where the CF and DF parts have been combined, Now, the equation can be inverted for the unknown scaling factors contained in the vector S C D . This inverse problem can be solved in various ways, for example, employing singular value decomposition (SVD) of the matrix M 12 . The solution method and possible regularization of the inverse problem (see Sect. 2.10.3) may have some effect on the solution, especially when the matrix is under-determined (more unknowns than measurements). If it is known a priori that the vector field V is either curl-or divergence-free (e.g., the ionospheric electric field is often assumed curl-free), it is only necessary to use one type of the elementary systems, thus reducing the size of the inverse problem by a factor of two. If the vector field V is known globally (e.g., everywhere in the ionosphere), it is completely determined by its curl and divergence. However, if the vector field is specified in only some limited region, it may contain a Laplacian part that has zero curl and divergence inside this region. In a potential representation, such as in Eqs. (2.5) and (2.6), this Laplacian part would be determined by the boundary conditions at the edge of the area where V is known. In the SECS representation, the Laplacian part can be included by placing some elementary systems outside the region of interest. These "external" SECS represent the effect that distant sources (i.e., divergences or curls) have inside the analysis area. Therefore, in regional studies, it is important to make the SECS grid somewhat larger than the area of interest (see Sect. 2.10.1), but it should be remembered that in the outlying areas the SECS representation is no longer unique.
This kind of vector field representation was one of the original uses of the elementary current systems. When Amm (1997) introduced the CECS and SECS ionospheric studies, he was searching for a practical way to decompose vector fields into curlfree and divergence-free parts and also to interpolate the fields in a way that would conserve their curl-free and/or divergence-free character.

Analysis of Ground Magnetic Measurements
An important application of the SECS method has been the estimation of the ionospheric current system based on the magnetic disturbance field it creates at the ground. This is a classical problem in geosciences, and many methods have been developed to tackle it, see e.g., Chapman and Bartels (1940), or Untiedt and Baumjohann (1993), Amm and Viljanen (1999) and references therein. Most of the previously used methods were based on harmonic analysis, where the magnetic field is expanded as a sum of suitable basis functions, for example, spherical harmonics. In the SECS analysis, it is the current system that is expanded in terms of elementary systems, whose amplitude is then fitted to match the measured magnetic disturbance field.
An important practical question is how to separate the disturbance field from the total magnetic field that is measured by magnetometers. Detailed discussion is beyond this review, but we mention that with ground magnetometer data this is usually done by determining some quiet-time reference level and removing it from the data. van de Kamp (2013) present one realization of this method.
The seminal work in ionospheric current studies using SECS analysis was by Amm and Viljanen (1999), who first derived analytical formulas for the magnetic field of the DF SECS and showed how the DF SECS could be used to estimate the ionospheric equivalent current from ground magnetic measurements. They also compared the SECS analysis with more traditional spherical cap harmonic analysis of the magnetic field, and demonstrated the practical advantages of the SECS method.
An important question is the relationship between the ionospheric equivalent current and the real ionospheric current. At high magnetic latitudes the curl-free part of the ionospheric horizontal current, together with associated FAC, does not produce any magnetic field below the ionosphere. Fukushima (1976) showed this by assuming uniform ionospheric conductances, but the result is valid independent of the conductance distribution (Amm 1997). The crucial assumption needed in deriving this result is that the FAC should flow radially. For strictly radial FAC, the ground magnetic disturbance from ionospheric current is produced solely by the divergencefree part, as is evident also in Eqs. (2.13)-(2.15). This is only approximately true even at the auroral zone, and breaks down completely at lower latitudes, where the magnetic field has larger inclination.
When the magnetic field lines are tilted, the FACs and associated horizontal curlfree currents make some contribution to the ground magnetic disturbance. As for example Tamao (1986) showed, this contribution can be reasonably large even at ∼60 • magnetic latitude. Luckily, the ground magnetic field due to tilted FACs is typically spatially smoother than that due to divergence-free currents, as is evident in Fig. 6 by Tamao (1986). Therefore contributions from opposite FACs should readily almost cancel each other, with the remaining magnetic effect being rather small and spatially smooth. For FACs tilted in the north/south direction the ground magnetic field is mostly in the east/west direction, which should show up as north/south equivalent current (see, e.g., Fig. 12 in Untiedt and Baumjohann 1993). Taking all this into account, it should be safe to assume that at high magnetic latitudes the ionospheric equivalent current is approximately equal to the divergence-free part of the actual ionospheric current, possibly apart from a relatively small and smooth north/south directed background current. For a more thorough discussion about the concept of equivalent current see, for example, Sect. 3 in Vanhamäki and Amm (2011) and references therein.
When calculating the ionospheric equivalent current with the SECS method, the horizontal components of the ground magnetic disturbance B G measured by magnetometers at locations r n = (R E , θ n , φ n ) during some time instant are collected into a composite vector (2.29) The unknown scaling factors of the DF SECS located at r el n = (R, θ el n , φ el n ) are collected into another vector as in Eq. (2.26). These vectors are connected by a transfer matrix T, so that The components of the transfer matrix T give the magnetic field caused by each individual unit SECS at the magnetometer sites, and is therefore known and depends only on geometry. For example, T 2,4 gives the y-component (East) of B G at r 1 caused by the SECS centered at r el 4 . Details of calculating the matrix T and inverting Eq. (2.30) for the unknown scaling factors S DF using truncated singular value decomposition are given by Amm and Viljanen (1999) and Pulkkinen et al. (2003b). Once the scaling factors are known, the actual ionospheric equivalent current J eq,ion can be calculated using Eq. (2.8) for each individual DF SECS.
A matlab code included as supplementary material demonstrates the process of calculating the ionospheric equivalent current with the SECS method. Readers are encouraged to study the code and experiment with it. However, the code should not be directly applied to other magnetometer networks, as some parameters may have to be adjusted with changing geometry of the network. This is further discussed in Sect. 2.10. Quick-look plots of the equivalent currents calculated with the SECS method are provided by the Finnish Meteorological Institute. 2

Separation into Internal and External Parts
In the above discussion, only the horizontal part of the ground magnetic disturbance was used, and all the elementary systems were placed at the ionosphere (radius R), thus determining the ionospheric equivalent current. However, due to geomagnetic induction, the observed ground magnetic perturbation also has internal telluric sources, especially during disturbed geomagnetic conditions (Tanskanen et al. 2001). Using all three components of the observed ground magnetic disturbance, it is possible to separate the measured field into internal and external parts, which can be represented by two layers of equivalent currents (e.g., Haines and Torta 1994).
As far as the SECS method is concerned, this kind of separation was first applied by Pulkkinen et al. (2003b). The method is very similar to the above discussion of ionospheric equivalent currents, but in this case all three magnetic field components are used and there are two layers of elementary systems, one in the ionosphere and the other inside the ground.
The measured ground magnetic disturbance B G at magnetometer locations r n = (R E , θ n , φ n ) are collected into a composite vector, (2.31) The external (=ionospheric) DF SECS are located at r el,e n = (R, θ el,e n , φ el,e n ), while the internal DF SECS are placed at r el,i n = (R i , θ el,i n , φ el,i n ). Note that in general there can be a different number of internal and external elementary systems, and they can be located at different latitudes and longitudes. The scaling factors are collected into vectors (2.34) These matrices can be calculated in a completely similar manner as discussed in the previous section, except that in this case, the matrices also include the vertical component of the magnetic field. For solving the unknown scaling factors, Eq. (2.34) is again written as a single matrix equation The equivalent currents can mimic the magnetic field produced by all the currents that are located behind them, as seen from the ground surface. That is, external and internal equivalent currents represent currents that are located either above the ionospheric layer or below the internal layer, respectively. As the induced telluric currents can flow at any depth, and also very close to the surface especially in the highly conductive oceans, in principle it would be best to place the internal equivalent current just below the ground surface. However, that may lead to numerical problems, as the finite grid spacing and the singular nature of the SECS mean that one SECS pole placed close to a magnetometer station would make an unrealistically large contribution to the measurement. As a reasonable compromise between numerical stability and inclusion of near-surface currents, Pulkkinen et al. (2003b) placed the internal current layer at 30 km depth.
Making the separation into internal and external equivalent currents is in principle more accurate than calculating only the external current from Eq. (2.30). However, the separation has also some drawbacks in practice. First of all, the inverse problem becomes less stable compared to the external-only calculation, as the number of observations increase from two to three components per station, but typically the number of SECS is doubled. Furthermore, even though the separation is in principle unique when done globally (and with perfect data coverage), Thébault et al. (2006) demonstrated that in local studies, the internal and external sources mix to some degree. In practical applications, the limited amount of input data lead to further ambiguities in the solution. Thébault et al. (2006) considered spherical cap harmonic analysis of the ground magnetic field, but similar problems are expected also in SECS analysis, although this has not been studied in detail. For these reasons, the telluric contributions have been neglected in many SECS studies, which can be expected to lead to some overestimation of the ionospheric equivalent currents, especially during disturbed conditions when time variations are rapid.

Analysis of Satellite Magnetic Measurements
In the above discussion, the focus was on calculating the ionospheric equivalent current from ground magnetic measurements, which has arguably been the most successful and widely used application of the SECS method. The main limitation is that only the equivalent current, not the whole ionospheric current containing the CF, DF, and FAC parts, can be calculated from ground magnetic data alone. Getting the full current would require some further assumptions about the ionospheric electric field or electric conductivity, as discussed, e.g., by Untiedt and Baumjohann (1993) or Vanhamäki and Amm (2011). This is not a shortcoming of the SECS method, but a general limitation inherent to magnetic fields and currents.
The situation is quite different when there are magnetic measurements from loworbiting satellites, such as CHAMP (CHAllenging Minisatellite Payload, https:// www.gfz-potsdam.de/champ/) or Swarm (Olsen et al. 2013). The satellites pass through the FACs, so their effect dominates the observed magnetic disturbance. The ionospheric horizontal currents, assumed to flow in a thin sheet at E-region altitude, are usually several hundred kilometers below the satellite, and therefore make a smaller contribution to the measured field. As the satellite magnetic data contains information on the FAC, and associated CF current via Eq. (2.4), as well as the DF ionospheric current, the whole current system may be estimated by fitting both CF and DF SECS to the measurements. Therefore satellite data can in principle provide the "real" current distribution.
Often data from only one satellite at any specific region or instant of time are available. Therefore assumptions about gradients perpendicular to the satellite track have to be made, or combined data from several orbits (typically several months or years) are used. Exception to this are the Swarm mission and the AMPERE (Active Magnetosphere and Planetary Electrodynamics Response Experiment Anderson et al. 2014) project. For further discussion of AMPERE, see Chap. 8. The SECS method tailored for Swarm data analysis is discussed in detail in Chap. 3, while analysis of single-satellite passes with assumption of vanishing gradients is discussed in the next section. Juusola et al. (2014) presented a statistical analysis of CHAMP satellite's magnetic data using the SECS method. They first projected all the magnetic measurements into a regular grid in the geomagnetic coordinate system, and then averaged and binned the data with respect to solar wind conditions. The ionospheric current system, including the FAC and both CF and DF parts of the horizontal current, was determined by fitting CF and DF SECS to the gridded magnetic data. Apart from including the CF systems, the approach is very similar to the analysis of ground magnetic data.
The gridded magnetic disturbances measured by CHAMP are collected into a composite vector similar to Eq. (2.31). The CF and DF SECS are placed at selected positions in the ionosphere, and their scaling factors are collected into vectors as in Eqs. (2.21) and (2.22). In general, there can be a different number of CF and DF elementary systems, and they can be located at different latitudes and longitudes. The vectors are connected by transfer matrices T c f and T d f , so that (2.36) These matrices can be calculated in a completely similar manner as discussed in the previous section, using Eq. (2.15) for the CF SECSs and Eqs. (2.13) and (2.14) for the DF SECSs. The fitting problem is again combined into a single matrix equation and solved for the unknown scaling factors. It should be noted that the assumption of perfectly radial FAC used in the CF SECS will lead to some errors when analyzing satellite data. This is most clearly manifested as a slight southward shift in the ionospheric location of the FAC, which is caused by using radial instead of field-aligned mapping from the satellite altitude (typically ∼400 km) to the ionospheric E-region. However, Juusola et al. (2014) estimated that at high latitudes the error was at most 0.9 • , and thus smaller than the latitude resolution of their statistical grid.
When using only satellite data, the ionospheric currents and induced telluric currents can not be separated. The reason is that both current systems are below the satellite, so they produce qualitatively similar magnetic effects. Despite the large distance between the satellite and induced telluric current, in some cases, they may have a large effect on the measured magnetic disturbance, as shown by Vanhamäki et al. (2005). The telluric currents may be approximated by placing a perfect conductor inside the Earth at a certain depth (depending on the ground conductivity), in which case the internal currents would be mirror images of the ionospheric currents. This approach was used by Olsen (1996), but in a statistical comparison of satelliteand ground-based currents Juusola et al. (2016) found it inadequate.

1D SECS
In many situations, data are only available along a single line, and not on a twodimensional area. Typical cases are passes of a single satellite, or a (North-South) chain of magnetometers. In these cases, for single events, some additional assumptions are necessary. For example, the SECS method discussed in Sect. 2.7 is not directly applicable, as it produces reliable results only if measurements are available in a suitably large two-dimensional area.
One approach is to use a "1D assumption", where gradients of the studied parameter (current, electric field, conductances, …) are assumed to vanish in one specific direction. This is identified as the "zero-gradient direction", while the perpendicular direction is the "1D direction" (e.g., along a magnetic meridian). For example, assume that ionospheric current depends only on latitude so that gradients in the longitudinal direction vanish. It should be noted that this zero-gradient direction need not be exactly perpendicular to the satellite path or magnetometer chain, but the angle should still be large enough so that good coverage is achieved in the 1D direction. Also, even though the analysis maybe simplified by assuming some a priori fixed 1D direction (e.g., geomagnetic meridian), there exist methods (e.g., minimum variance analysis, Sonnerup and Scheible 1998) that can be used to determine the optimum The azimuthal horizontal current, shows a sharp shear at colatitude θ 0 direction from the data. Some method should also be used to check how good the 1D assumption is in each specific case, e.g., by estimating how small the gradients in the "zero-gradient direction" actually are, because in reality, the situation is never perfectly one-dimensional.
One-dimensional variants of the CF and DF SECS were defined by Vanhamäki et al. (2003) and Juusola et al. (2006), respectively. In order to distinguish them from the elementary systems discussed thus far, the terms 1D and 2D SECS are used here. The 1D variants can be obtained by placing the poles of the respective twodimensional SECS around a circle at a constant latitude θ 0 , essentially integrating over the position of the 2D SECS's poles (Vanhamäki et al. 2003). The resulting current systems are The 1D SECS are illustrated in Fig. 2.4 and may look deceptively similar to the 2D SECS introduced in Sect. 2.3. However, the crucial difference is that the 1D SECS are defined in the global coordinate system (often geographical or geomagnetic), where the 1D direction is in the meridional plane (all azimuthal gradients vanish). Therefore Eqs. (2.37) and (2.38) have no prime in θ or φ.
The 1D CF SECS has a ring of δ-function divergence at colatitude θ 0 , with uniform and opposite divergence elsewhere. Similarly, the 1D DF SECS has a band of δ-function curl, compensated by uniform curl elsewhere. This is actually an alternative way to define the 1D SECS and to derive Eqs. (2.37) and (2.38). Similar to the general 2D SECS, the CF and DF 1D SECS are basis functions for any continuously differentiable vector field on a sphere, with vanishing gradients in the azimuthal direction. By using several 1D SECS with different amplitudes and different "critical co-latitudes" θ 0 , any such vector field can be constructed.
The magnetic field of the 1D DF systems (when used to represent currents) was calculated by Vanhamäki et al. (2003). With s = min(r, R)/max(r, R) and defining two auxiliary functions the components can be written more compactly as Here, P l and P 1 l are the unnormalized 0th-and first-order-associated Legendre polynomials. The magnetic field of the 1D CF SECS (with associated radial FAC) was calculated by Juusola et al. (2006) using Ampere's law: The 1D SECS are used in a completely analogous way to the 2D systems discussed in Sect. 2.7. For ground magnetic analysis, the B θ -component (southward in the chosen coordinate system) can be used to calculate the ionospheric equivalent current, which in a 1D situation has only φ-component (as 1D current in θ -direction can not be completely divergence-free). Alternatively, both the B r -and B θ -components can be used for the internal/external separation. The B φ -component should be much smaller than the other two, which can be used as one check of the quality of the 1D assumption.
In satellite applications, the southward current J θ is computed from the eastward magnetic disturbance by fitting 1D CF SECS to the data. The eastward divergencefree current is associated with magnetic disturbances in the radial-and θ -directions. If only B r is used in fitting the 1D DF SECS, the measured B θ may be compared to the magnetic disturbance calculated from the fitted DF SECS in order to estimate how good the 1D assumption is. This line of reasoning was applied by Juusola et al. (2007), who used it to search for the best 1D direction by allowing the North Pole of the coordinate system to move. In case they did not find good enough agreement in B θ for any North Pole location, the event was considered 2D and removed from analysis. It is better to use B r in the fitting and B θ in the checking rather than the other way round, as the horizontal component is more easily affected by 2D structures in the FAC. However, due to non-radial FAC, it would be even better to use field-aligned magnetic disturbance in fitting the 1D DF SECS. That can be done by taking the appropriate linear combination of the r -and θ -components.

Some Practical Considerations
In this section, several practical issues related to the application of the SECS methods are considered. Some of them are also discussed and solved in the example code that is included as supplementary material in the book. However, issues such as grid selection and regularization of the matrix inversion depend on the geometry of each situation, and must be adjusted for each magnetometer network.

Grid and Boundary Effects
The SECS method does not require any explicit boundary conditions, even when applied to regional studies. This is different from potential representations of the electric field or current, like Eqs. (2.5) and (2.6), which require explicit boundary information. In contrast, in the SECS analysis, there is an implicit condition that the vector fields are smooth and source-free outside the analysis area. The CF and DF SECS represent all sources of the vector field, so in regions where there are no SECSs both the curl and divergence must vanish. Of course, explicit boundary conditions may be added using virtual data points at the edges of the analysis area, requiring that the vector field has a certain value at these points.
As mentioned in Sect. 2.6, in order to minimize boundary effects caused by the implicit boundary conditions and the possible presence of a Laplacian field, the SECS grid should be somewhat larger than the area of interest. This is illustrated in Fig. 2.5, where a given vector field shown in panel (a) is divided into CF and DF parts using Eq. (2.27). The original vector field was constructed from a curl-free part with sources inside the shown area and a divergence-free part with sources outside, see panels (b-d). In this case, the data region is the area where the vector field shown in panel (a) is given. The SECS grid used in the analysis is the colored area in panels (e-d), where also the data region is shown as a black rectangle. Note that although this example was done with Cartesian Elementary Current Systems (CECS), the same principle holds for SECS.
When the given vector field in panel (a) is decomposed into DF and CF parts using elementary systems, the local curl-free part is correctly represented in terms of CF systems inside the area where the vector field was originally specified. This is seen  (2007) by comparing the estimated scaling factors shown in panels (e-f) with the model CF scaling factors that are inside the black rectangle in panel (d). The estimated CF scaling factors inside the data region agree very well with the model, while the estimated DF scaling factors are nearly zero. However, the remote divergence-free part gets represented in terms of both CF and DF systems located just outside the data region. This is seen by comparing the areas outside the black rectangle in panels (d-f): In the model there are only DF CECS outside the black rectangle, but in the fit results both CF and DF CECS have nonzero amplitudes there. This demonstrates that in general, outside the data region, the decomposition is no longer unique, and a (locally) Laplacian field may equally well be caused by either remote curls or divergences, or some combination of them. In global studies, there is no such fundamental ambiguity, because the Laplacian field must vanish or be physically unreasonable. In the case of Fig. 2.5, the Laplacian field corresponds to the remote currents shown in panel (c), caused by the DF CECS located outside the data region in panel (b).
In summary, the division of local field into CF and DF parts is in principle unique, but remote fields, whose sources are outside the data region, can not be decomposed in a unique way. This is not a limitation of the elementary system method, but similar ambiguities (related to boundary conditions) would appear also in potential representations like Eq. (2.6). Finally, it should be kept in mind that in practical applications data availability and quality are often serious limiting factors. Measurements are rarely as extensive, detailed and noise-free as the model field shown in panel (a) of Fig. 2.5.
The recommendation is to make the SECS grid somewhat larger than area of interest. Figure 2.6 illustrates typical SECS and output grids used in the calculation of equivalent currents with data from the IMAGE magnetometer network. Role of the outlying SECS is to provide an equivalent representation of distant current systems, that do not have sources (in this case curls) directly above the magnetometer network.

Singularities
The elementary systems defined in Eqs. (2.7) and (2.8) are unfortunately singular, as there is divergence at the SECS pole where θ = 0. Consequently, the magnetic field of a DF SECS given in Eqs. (2.13) and (2.14) has a singular point at (r = R, θ = 0), while the CF SECS's field in Eq. (2.15) is singular along the line (r ≥ R, θ = 0). These singularities should be kept in mind, as they may cause numerical problems.
In many applications, it is sufficient to select the SECS grid carefully, so that there is no need to evaluate the fields (either the SECS's vector field or magnetic field) too close to singular points. This is usually the case, e.g., in the calculation of equivalent currents from ground magnetic data, discussed in Sect. 2.7 and demonstrated in the example code. If the vertical separation between the SECS layers and the magnetometers is large enough, the singularities in the magnetic field do not matter. Similarly, the resulting equivalent current vectors can be calculated at the midpoints between the SECS locations, as illustrated in Fig. 2.6.
However, in some applications it is necessary to calculate the fields near the singularities. In this case, the elementary systems in Eqs. (2.7) and (2.8) may be modified to When α = cot 2 (θ 0 /2), the vector fields are continuous at θ = θ 0 . Moreover, the δ-function source at the elementary system's pole is now spread uniformly inside a spherical cap of width θ 0 . In a similar way the 1D SECS can be redefined so that the divergence or curl that in Eqs. (2.37) and (2.38) is a δ-function at colatitude θ 0 is uniformly spread to a spherical zone θ 0 − Δ ≤ θ ≤ θ 0 + Δ. Inside this zone the 1D DF SECS has current density cos θ 0 cos Δ − (1 − sin θ 0 sin Δ) cos θ sin θ 0 sin Δ sin θê φ , (2.45) while outside it is the same as in Eq. (2.38). The current density of a 1D CF SECS has the same expression, but in theê θ direction. Assuming radial FAC, the magnetic field of the modified CF SECS can be calculated using Ampere's law, as before. In fact, for a general ionospheric curl-free current J c f (θ, φ), with (∇ × J c f ) r = 0, and radial FAC, the magnetic field is This general result is evident from the magnetic field and current of CF SECS, given in Eqs. (2.15) and (2.7), respectively. Remember that the CF SECS form a complete set of basis functions for curl-free vector fields. However, the result can also be verified by checking that the magnetic field is divergence-free and gives the correct current distribution via Ampere's law. Equation (2.46) forms the basis for many analysis techniques for satellite magnetic data, including the analysis of AMPERE data, discussed further in Chap. 8. In contrast, it is quite unlikely that the magnetic field of the modified nonsingular DF SECS could be calculated in a closed form. Possibly a series expansion could be derived using the same methods as in Vanhamäki et al. (2003). However, in the attached example code this problem is simply ignored: Equation (2.44) is used for the vector field, while the magnetic field is calculated using Eqs. (2.13) and (2.14). This is slightly inconsistent, but does not appear to affect practical applications.
The effects of the singularities can be further reduced in a rather straightforward manner by subdividing the SECS into smaller units. This is not the same as making the original SECS grid finer, as that would increase the number of scaling factors. Rather, if one SECS with scaling factor S n is normally placed into a grid cell n, then the cell is divided into N equal parts and SECSs with amplitudes S n /N are located into each one. This way the size of the system matrix in Eq. (2.27) or (2.30) stays the same, but the matrix elements are calculated as sums of sub-elementary systems placed at different corners of the original grid cells. This does not completely remove the singularity, but reduces it into a smaller area, which can be either handled by using the redefined nonsingular SECS in Eqs. (2.43) and (2.44), or ignored completely. For example, if the original grid cell is divided into 100 sub-cells, then removing the one sub-cell where the calculation point is located should amount to roughly 1% error.

Inversion Regularization
When applying the SECS method, matrix equations such as Eq. (2.27) or (2.30) need to be inverted. Often these are either under-determined (more unknown scaling factors than measurements), or otherwise ill-conditioned. In either case, direct attempt to invert the equation will lead to nonsensical results. In this kind of situation, the problem requires regularization, either by adding some constraints or assumptions about the solution.
There are several possible methods to deal with these situations, but the traditional method of choice in SECS analysis has been the Singular Value Decomposition (SVD, see, e.g., Press et al. 1992, Sect. 2.6). In SVD the system matrix, e.g., T in Eq. (2.30), is decomposed into a product of three matrices where U and V are unitary matrices, S is a diagonal matrix containing the singular values (nonnegative, arranged from largest to smallest) and * denotes conjugate transpose. In the case of Eq. (2.30), the rows of V * represent different, mutually orthogonal configurations of the SECS scaling factors, while the columns of U give the corresponding (also mutually orthogonal) magnetic field configurations at the magnetometer stations. In some sense the corresponding singular values in S indicate how distinguishable these modes are in the magnetic field. A large value S n,n means that the corresponding magnetic field configuration is easy to find in the data, while those with small values can be lost in the noise. Thus SVD may be used to locate and remove the ill-conditioned parts of the system matrix, making the inversion numerically stable. In practice Eq. (2.30) is inverted as where σ is a diagonal matrix with elements σ n,n = 1/S n,n if S n,n > εS 1,1 0 otherwise (2.49) Here, ε is a parameter that determines the cut-off point for small singular values, with respect to the largest value S 1,1 . The important question is how to choose ε. Too small a value will lead to problems with noisy data (e.g., spurious structures appearing in the solution), while too large value means that good data are rejected. Perhaps the only sure way is to test the analysis with simulated data, where the correct answer is known, and try different ε-values. In these tests, it is important to use realistic models and to add a realistic amount of noise to the simulated data. This kind of ε-optimization has been done, e.g., by Weygand et al. (2011) andVujic andBrkic (2016).
The SVD approach seems to work well in practice, but there are also other possible ways to regularize the inversion problem. One could add extra constraints to the system matrix by demanding that the spatial gradient of the SECS scaling factors must be as small as possible. Readers are encouraged to consider and test alternatives to the SVD.

Tilted Field Lines
When representing ionospheric currents with SECS, the FAC is connected to the CF systems. In the present formulation, the FAC are assumed to flow radially, as shown in Fig. 2.1 and assumed in deriving Eq. (2.15). As noted in Sect. 2.4, this assumption is a reasonable approximation only at high magnetic latitudes, where inclination of the magnetic field is large. At lower latitudes, the field lines are noticeably tilted, and Eq. (2.15) becomes an increasingly worse approximation.
However, in principle, this is a problem only when analyzing satellite magnetic measurements. The CF and DF systems still form a basis for representing horizontal vector fields (including the horizontal current) at middle and low latitudes, and the ground magnetic field can still be represented in terms of equivalent currents. Unfortunately, interpretation of the ionospheric equivalent current at lower latitudes is more problematic, as it equals the divergence-free part of the real current only at high magnetic latitudes.
In satellite analysis, one can try to correct small errors caused by the radial/tilted discrepancy, e.g., by introducing a "forbidden zone" between the assumed and actual locations of the FAC at satellite altitude (see Fig. 3 in Juusola et al. 2006), and by shifting the resulting FAC and curl-free current slightly poleward by the amount the field line moves between the satellite altitude and ionospheric E-layer (e.g., Juusola et al. 2016). However, these approximate corrections are reasonably accurate only at high magnetic latitudes, where the field lines are almost vertical.
The CF systems could be improved by assuming a more realistic geometry for the FAC. At high and middle latitudes it might be sufficient to model the FAC as semi-infinite line currents that are oriented along the magnetic field. There is a closedform analytical expression for the magnetic field of such a line current, so the 2D CF SECS could be redefined by replacing the semi-infinite radial line current at the pole (the δ-function current) with a tilted one. There is no pressing need to redefine the uniform radial FAC, as those should mostly cancel when summing several different 2D CF SECS with different amplitudes. For even lower latitudes the semi-infinite line currents should probably be replaced with FAC flowing along the actual magnetic field lines, or at least along a dipole field. For the 1D CF SECS the horizontal current may be redefined so that it is antisymmetric between the (geomagnetic) hemispheres, Assuming that the FAC flows along dipole field lines between conjugate points, the magnetic field can be calculated using Ampere's law (Juusola et al. 2006;Deguchi 2014), Here, θ I = arcsin R r sin θ is the colatitude mapped along a dipole field to the ionosphere. One could also consider other modifications, where the FAC would be terminated at the equatorial plane (Deguchi 2014). They would have the advantage that the current system is not forced to be anti-symmetrical between the hemispheres. For the 2D CF SECS, these non-radial modifications have not been investigated.

Equivalent Current as a Proxy for FAC
As mentioned in Sect. 2.7, the divergence-free equivalent current may be calculated using only ground magnetic data. Thus, strictly speaking, no information is available about FAC. However, it is well known that certain patterns in the equivalent current are good indicators of FAC (e.g., Untiedt and Baumjohann 1993). These estimates can be made more formal by noting that under certain conditions the curl of the equivalent current is directly proportional to the FAC (see, e.g., Amm et al. 2002).
First of all, assume that the equivalent current is equal to the divergence-free part of the actual ionospheric current. This should be valid at high magnetic latitudes, as discussed in Sect. 2.7, although distortions created by internal induced currents and magnetospheric current systems may cause small deviations. More crucially, further assume that the Hall to Pedersen conductance ratio α = Σ H /Σ P is spatially constant and that conductance gradients are perpendicular to the electric field. Under these assumptions j = −(∇ × J eq ) r /α, which is easy to verify by comparing the curl and divergence of ionospheric Ohm's law in Eq. (2.3).
This kind of reasoning has been used from time to time (e.g., Amm et al. 2002;Juusola et al. 2009;Weygand and Wing 2016), but it should be kept in mind that this relation is only approximate and relies on assumptions that are not generally valid. Therefore (∇ × J eq ) r should be only considered as a proxy for FAC.

How SECS Have Been Used
As mentioned in Sect. 2.6, the elementary systems, as used in ionospheric studies, were originally introduced by Amm (1997) in order to optimally interpolate vector fields and to divide them into CF and DF parts. Since then the SECS method has found many other applications, most prominently in the analysis of satellite or ground-based magnetic measurements. The method to calculate ionospheric equivalent currents from ground-based data was developed by Amm and Viljanen (1999), as discussed in Sect. 2.7. It was extensively tested and expanded to include the internal/external separation by Pulkkinen et al. (2003a) and Pulkkinen et al. (2003b), while Vanhamäki et al. (2003) introduced the 1D variant for ground-based analysis. Since then the method has been used in numerous studies, especially with the IMAGE magnetometer network.
Other research groups have adapted the SECS method. For example McLay and Beggan (2010) applied the method to very sparse magnetometer arrays in order to interpolate the external magnetic disturbance field over large distances. Weygand et al. (2011) used the ground-based SECS method to calculate equivalent currents over North America and Greenland, by constructing an irregularly shaped grid for the elementary systems. They also carefully validated and optimized the inversion method by using simulated measurements based on a known ionospheric current model. Instead of calculating equivalent currents, Vujic and Brkic (2016) used the SECS method to construct a regional model of the crustal magnetic field using data from repeat stations and ground survey sites around the Adriatic Sea.
Satellite applications of the SECS method were developed by Juusola et al. (2006) and Juusola et al. (2014) for the 1D and 2D cases respectively, as described in Sects. 2.8 and 2.9. Juusola et al. (2007) carried out a large statistical study of the ionospheric current system by analyzing 6112 individual CHAMP passes with the 1D SECS method. To our knowledge the 2D SECS analysis of gridded and averaged CHAMP measurements by Juusola et al. (2014) was the first study where the 2D ionospheric current system, both CF and DF horizontal currents as well as FAC, was directly estimated from satellite magnetic data. Amm et al. (2015) developed a tailored SECS-based method for analyzing electric and magnetic data from the Swarm multi-satellite mission. This application is discussed in detail in Chap. 3.
Apart from magnetic data analysis, the SECSs can be used as basis functions for representing general vector fields and potentially transforming differential and integral equations into algebraic ones. This is very similar to using spherical harmonic functions in solving differential equations. For example, Vanhamäki et al. (2006) and Vanhamäki (2011) have used the elementary systems for solving ionospheric induction problems starting from Ohm's law and Maxwell's equations. Meanwhile, Vanhamäki and Amm (2007) introduced a new, local variant of the KRM (Kamide-Richmond-Matsushita) method (Kamide et al. 1981) for calculating the ionospheric electric field from ground magnetic data and estimated ionospheric conductances. In these applications, the elementary systems are used to transform the partial differential equations into matrix equations, which can be solved much more easily.
Finally, Amm et al. (2010) used the SECS method for local analysis of the ionospheric plasma convection (or electric field) measured by the SuperDARN radars. This application is very close to the original purpose of Amm (1997), as here the SECS method was used to combine and interpolate/extrapolate the radar line-of-sight velocity measurements into a divergence-free map of the plasma convection. The main advantages over the standard SuperDARN analysis (Ruohoniemi and Baker 1998) is that the SECS method can be used locally, relies only on measured data without any underlying statistical model, and does not require any explicit boundary conditions. formed. Colin Waters provided a large number of comments, which improved the text considerably. The authors thank the institutes who maintain the IMAGE magnetometer array. IMAGE magnetometer data are available at http://www.space.fmi.fi/image. The editors thank Akimasa Yoshikawa for his assistance in evaluating this chapter. This work was supported by the Academy of Finland project 314664.