1 Introduction

The Terrain Correction is the computation of Newton’s integral, in terms of gravitational potential or attraction, for the masses distributed in the volume of the so-called topography, namely those that are located between the geoid or the Earth ellipsoid, depending on the height information available, and the actual topographic surface of the Earth. Such a computation is of very large use in physical geodesy where both the potential and the attraction are of interest (Sansò and Sideris 2013) and in geophysics where the main application is the computation of the so-called Bouguer Anomalies. Beyond the denomination problem, what is sought is the value of the corrections to the gravitational potential, \(\delta W = T_{t}\) or to its gradient, particularly the vertical component \(\delta g = - \mathbf {\nu } \cdot \bigtriangledown T_{t}\) (\(\mathbf {\nu }\) being the direction of the vertical in ellipsoidal geometry), by forward modelling the effects of topographic masses of known density and geometry.

The field quantities have to be computed at points P on the surface or “in the air” when corrections have to be made e.g. to airborne gravity measurements.

In this paper the focus is on the computation of the corrections \(\delta g_{t}\) for applications to geophysical exploration. So we shall concentrate on local areas (i.e. with a diameter smaller than 100/200 km) where the so-called planar approximation can be applied, namely considering \(\mathbf {\nu }\) as a field of parallel unit vectors. The situation of the various types of corrections we will encounter in the paper are represented in Fig. 1 where the notation is hereafter defined:

Fig. 1
figure 1

Basic notation and types of correction managed by GTE

  • \(P_{ot}\) is a computation point on the terrain;

  • \(P_{of}\) is a computation point on the flight track;

  • \(\rho _{r}\sim\) 2670 kgm\(^{-3}\), \(\rho _{w}\sim\) 1030 kgm\(^{-3}\), \(\rho _{s}\sim\) 2200 kgm\(^{-3}\) and \(\rho _{m}\sim\) 3300 kgm\(^{-3}\) are the densities of the crystalline crust, oceanic water, sediments and upper mantle respectively;

  • \(S_{t}\) is the exterior topography surface;

  • \(S_{w}\) is the surface of the sea floor;

  • \(S_{Mo}\) is the surface of the Moho;

  • \(h_{t}\) is the topographic height;

  • \(h_{w}\) is the bathymetry;

  • \(h_{Mo}\) is the depth of the Moho;

The literature on the subject is very large in both geodetic and geophysical environments. So we will limit ourselves to cite a few of them from the classical paper of MacMillan (1930), where the close formula of the attraction of a prism is given, to the followers (Nagy 1966; Nagy et al. 2000; Blais and Ferland 1983; Forsberg 1984; Tsoulis 1999); we mention as well several generalizations to different bodies particularly polyhedra (Talwani and Ewing 1960; Paul 1974; Götze and Lahmeyer 1988; Holstein and Ketteridge 1996; Petrovic 1996; Hansen 1999; Tsoulis and Petrovic 2001); indeed one has to recall too the approximation of Fast Fourier Transform (FFT) spectral methods like in the classical work of Parker (1972) as well as in the ones of Sideris (1984), Tsiavos et al. (1996) and Forsberg (1985). In both the classical approach by prisms as well as in the Fourier method one has to recall that the need arises of computing regular integrals (Klose and Ilk 1993; Tsoulis and Petrovic 2001). Along this line, we want to cite as well methods that combine Fourier and prism calculation as in (Sansò and Sideris 2013), and the TcLight software (Biagi et al. 2000; Sampietro et al. 2007); this line of thought in particular is also implemented in the software illustrated in this paper.

The GTE software is basically a revision of classical prisms and FFT methods improved and combined to maximize the result accuracy minimizing the computational time. The software is expressly thought for geophysical applications allowing not only the computation of the effects of the oceanic and topographic masses but also those due to sediments and Moho undulation. Finally, differently from most of the software available for the computation of terrain correction, GTE can exploit the velocity of FFT techniques to compute the gravitational effect at any given altitude, thus allowing for accurate and fast corrections of airborne data even when acquired close to the topography.

The organization of the work is as follows: in Sect. 2 we give some theoretical recalls specially to justify the planar approximation and, on the same time, to propose spherical corrections that allow to enlarge the area of applicability to some degrees. In Sect. 3 the different algorithms corresponding to several situations, recalled in Fig. 1, and implemented in the actual software are illustrated. In Sect. 4 several comparisons are displayed with results from our software and the corresponding results obtained from two academic software, namely GRAVSOFT (Tscherning et al. 1992) and Tesseroids (Uieda et al. 2011). Finally in Sect. 5 some conclusions are drawn.

2 Some theory

The primary goal of this section is to put clear limits to the validity of the planar approximation, providing on the same time the correction terms that could broaden the area of applicability of GTE, reminding that the fundamental parameters that drove the choices while developing the software have been accuracy and speed.

In this section we review the arguments leading to the use of a planar approximation for \(T_{t}\), \(\delta g_{t}\) in a local area, defined as one which can be inscribed in a cap of 100 \(\div\) 200 km diameter, providing an explicit expression for the largest part of the difference between terrain correction in spherical and planar approximations. In this way we have on the one hand control on the order of magnitude of such errors, on the other hand formulas that we plan to implement into our software in the future. Note should be taken that a different solution to the problem of spherical approximation has been given in 1990 by Strang van Hees (1990) and more recently in TcLight (Sampietro et al. 2007). As mentioned we will start from a spherical approximation, in particular considering a local sphere tangent to the earth ellipsoid at \(\overline{P}\), a “central” point of the area under consideration, with a radius R equal to the Gaussian radius of the ellipsoid at \(\overline{P}\) and a center O at distance R from \(\overline{P}\) along the ellipsoidal normal. The vector \(\mathbf {r}_{P}\), with modulus \(r_{p}\), is then the position vector of P with respect to O, \(\mathbf {e}_{P} = \frac{\mathbf {r}_{P}}{r_{p}}\); moreover we shall use the notation \(h_{P} = r_{P} - R\), \(\Delta h_{PQ}\) (or simply \(\Delta h\)) for \(\Delta h = h_{P} - h_{Q}\), \(\varepsilon _{P} = \frac{h_{P}}{R}\), \(l_{PQ} = \vert \mathbf {r}_{P} - \mathbf {r}_{Q} \vert\), \(\mathbf {e}_{z}\) for the axis z going along with \(\mathbf {\nu }_{P}\), \(\psi _{P} = \widehat{\mathbf {e}_{P} \mathbf {e}_{z}}\), \(s_{PQ}\) (or simply s) as the projection of \(l_{PQ}\) on the tangent plane in \(\overline{P}\) to the local sphere, \(\mathbf {e}_{OP}\) the unit vector along the projection of \(\mathbf {r}_{P}\) on the above tangent plane, \(\alpha _{PQ}\) (or simply \(\alpha\)) the angle in the tangent plane \(\widehat{\mathbf {e}_{OP} \mathbf {e}_{OQ}}\) (see Fig. 2).

Considering that the gravitational terrain effect can amount up to few hundreds of mGal, we shall consider approximations with terms of a relative order of \(10^{-3}\div 10^{-4}\) certainly disregarding terms below \(10^{-4}\). We observe that in cases of a very rugged topography with high mountains, we have at most \(\left| \xi \right|\), \(\left| \Delta \right| \sim 10^{-3}\), although it is clear that in such areas we expect the planar approximation to have a poorer performance.

We start from the well known identity (Sansò and Sideris 2013)

$$\begin{aligned} l_{PQ}^{2}&= r_{P}^{2}+r_{Q}^{2}-2r_{P}r_{Q}\mathbf {e}_{P}\cdot \mathbf {e}_{Q}\nonumber \\&= (r_{P}-r_{Q})^2+2r_{P}r_{Q}(1-\mathbf {e}_{P}\cdot \mathbf {e}_{Q}) \end{aligned}$$
(1)
Fig. 2
figure 2

Geometry of the local sphere and of the tangent plane

Considering Fig. 2, we see that \(\mathbf {e}_{P}= sin\psi _P\mathbf {e}_{OP}+cos\psi _P\mathbf {e}_{z}\) so that \(\mathbf {e}_{P}\cdot \mathbf {e}_{Q} = sin\psi _{P}sin\psi _{Q}cos\alpha +cos\psi _{P}cos\psi _{Q}\). In our local area we can substitute \(sin\psi \cong \psi\) and \(cos\psi \cong 1-\frac{1}{2}\psi ^{2}\) because at \(\psi =1^{\circ }\) we have, in radiants \(\psi \cong 1.7\times 10^{-2}\), \(\psi ^{2}\cong 3.10\times 10^{-4}\), \(\psi ^{3}\cong 5.30\times 10^{-6}\), \(\psi ^{4}\cong 9.30\times 10^{-8}\). As we see even the terms in \(\frac{1}{2}\psi ^{2}\) could be neglected with a relative error of \(1.5\times 10^{-4}\), which is about our lower acceptance limit. So we can write:

$$\begin{aligned}&2r_{P}r_{Q}(1-\mathbf {e}_{P}\cdot \mathbf {e}_{Q})\nonumber \\&\quad \cong 2(1+\varepsilon _{P})(1+\varepsilon _{Q})R^{2}(\frac{1}{2}\psi _{P}^{2}+\frac{1}{2}\psi _{Q}^{2}-\psi _{P}\psi _{Q}cos\alpha )\nonumber \\&\quad \cong (1+\varepsilon _{P}+\varepsilon _{Q})(s_{P}^{2}+s_{Q}^{2}-2s_{P}s_{Q}cos\alpha )\nonumber \\&\quad =(1+\varepsilon _{P}+\varepsilon _{Q})s_{PQ}^{2} \end{aligned}$$
(2)

where we have put \(s_{P}=Rsin\psi _{P} \cong R\psi _{P}\), \(s_{Q}=Rsin\psi _{Q}=R\psi _{Q}\). If we call \(\varepsilon _{PQ}=\varepsilon _{P}+\varepsilon _{Q}\) and \(L_{PQ}=\left[ \Delta h^{2}+s_{PQ}^{2}\right] ^{\frac{1}{2}}\), using Eqs. 1 and 2 we get:

$$\begin{aligned} \frac{1}{l_{PQ}}&= \left[ \Delta h^{2} + s_{PQ}^{2} + \varepsilon _{PQ} s_{PQ}^{2} \right] ^{ - \frac{1}{2}} \nonumber \\&\cong \frac{1}{L_{PQ}} - \frac{1}{2} \varepsilon _{PQ} \frac{s_{PQ}^{2}}{L_{PQ}^{3}}. \end{aligned}$$
(3)

We note that \(L_{PQ}\) by definition is just the Cartesian distance between two points which are mapped from P and Q, when \(h_{P}\), \(h_{Q}\) is taken as a z component, while \(s_{P}\mathbf {e}_{OP}\), \(s_{Q}\mathbf {e}_{OQ}\) are (almost) their projection on the tangent plane. The mapping is illustrated in Fig. 3.

Fig. 3
figure 3

The mapping of the topographic body B to the flattened B’

Now letting G be the Newton constant, and \(\rho\) the density of the body B, also assumed to be constant, and putting \(\mu = G \rho\) we have, considering that \(dr_{Q} = dh_{Q}\),

$$\begin{aligned} T_{t} = \mu \int dr \int r_{Q}^{2} \frac{dh_{Q}}{l_{PQ}}d \sigma , \end{aligned}$$
(4)

with \(d \sigma\) the differential solid angle. To proceed we need to analyse the area element

$$\begin{aligned} r_{Q}^{2} d \sigma = (1+\varepsilon _{Q})^{2}R^{2} d \sigma \cong (1+2\varepsilon _{Q})R^{2} d \sigma . \end{aligned}$$
(5)

On the other hand it is, for the area element \(d_{2} x\) on the tangent plane, \(d_{2} x = R^{2} d \sigma cos \psi \cong R^{2} d \sigma - \frac{1}{2} \psi ^{2} R^{2} d \sigma\), which can be reversed to:

$$\begin{aligned} R^{2} d \sigma \cong d_{2} x + \frac{1}{2} \frac{s^{2}}{R^{2}} d_{2} x. \end{aligned}$$
(6)

Using Eqs. (6) and (3) into Eq. (4) and retaining only terms in \(\varepsilon\) or \(\psi ^{2}\) we get:

$$\begin{aligned} T_{t}(P)&\cong \mu \int d_{2} x \int _{0}^{H_{Q}} d h_{Q} (1+2\varepsilon _{Q} + \frac{s_{Q}^{2}}{2R^{2}})( \frac{1}{L_{PQ}} - \frac{\varepsilon _{PQ}}{2} \frac{s_{PQ}^{2}}{L_{PQ}^{3}}) \nonumber \\&\cong \mu \int d_{2} x \int _{0}^{H_{Q}} \frac{dh_{Q}}{L_{PQ}} \nonumber \\&\quad + \mu \int d_{2} x \int _{0}^{H_{Q}} dh_{Q} (2 \frac{\varepsilon _{Q}}{L_{PQ}} + \frac{s_{Q}^{2}}{2R^{2}} \frac{1}{L_{PQ}} - \frac{\varepsilon _{PQ}}{2} \frac{s_{PQ}^{2}}{L_{PQ}^{3}}) \nonumber \\&= T_{t}^{P}(P) + T_{t}^{sc}(P). \end{aligned}$$
(7)

With \(T_{t}^{P}\) we denote the planar approximation to \(T_{t}\) and \(T_{t}^{SC}\) its spherical correction term.

To pass over to the gravity effect we can split our calculation between planar and spherical correction terms. As for the former, namely the planar terrain correction, we have:

$$\begin{aligned} \delta g_{t}^{P}(P)&= - \frac{\partial }{\partial h_{p}} \mu \int d_{2} x \int _{0}^{H_{Q}} \frac{dh_{Q}}{L_{PQ}} \nonumber \\&= \mu \int d_{2} x \Bigg \lbrace \frac{1}{L_{PQ}} - \frac{1}{L_{PQO}}\Bigg \rbrace \end{aligned}$$
(8)

In Eq. (8), referring to the notation of Fig. 4,

$$\begin{aligned} L_{PQ} = \left[ (h_{P} - H_{Q})^{2} + \vert \mathbf {\xi }_{P} - \mathbf {\xi }_{Q} \vert ^{2} \right] ^ \frac{1}{2} \end{aligned}$$
(9)

and

$$\begin{aligned} L_{PQO} = \left[ h_{P}^{2} + \vert \mathbf {\xi }_{P} - \mathbf {\xi }_{Q} \vert ^{2} \right] ^ \frac{1}{2}. \end{aligned}$$
(10)
Fig. 4
figure 4

Notation of points and distances in the flattened body geometry

Notice that the planar integral in Eq. (8) has to be extended to the actual base D of the topographic body. As for the spherical corrections, the following approximate expressions hold

$$\begin{aligned} \delta g_{t}^{sc}(P)&= 2 \mu \int d_{2} x \int _{0}^{H_{Q}} dh_{Q} \varepsilon _{Q} \frac{\partial }{\partial h_{Q}} \frac{1}{L_{PQ}} \nonumber \\&\quad + \mu \int d_{2} x \frac{s_{Q}^{2}}{2R^{2}} \int _{0}^{H_{Q}} dh_{Q} \frac{\partial }{\partial h_{Q}} \frac{1}{L_{PQ}} \nonumber \\&\quad - \frac{\mu }{2R} \int d_{2} x \int _{0}^{H_{Q}} \frac{s_{Q}^{2}}{L_{PQ}^{3}} dh_{Q} \nonumber \\&\quad - \frac{\mu }{2} \int d_{2} x \int _{0}^{H_{Q}} s_{PQ}^{2} \varepsilon _{PQ} \frac{\partial }{\partial h_{Q}} \frac{1}{L_{PQ}^{3}} dh_{Q} \nonumber \\&\equiv I_{1} + I_{2} - I_{3} - I_{4} \end{aligned}$$
(11)

with

$$\begin{aligned} I_{1}&= 2 \mu \int d_{2} x \frac{H_{Q}}{R} \frac{1}{L_{PQ}} - \frac{2 \mu }{R} \int d_{2} x \int _{0}^{H_{Q}} dh_{Q} \frac{1}{L_{PQ}} \nonumber \\&\cong 2 \mu \int d_{2} x \frac{H_{Q}}{R} \Bigg ( \frac{1}{L_{PQ}} - \frac{1}{L_{PQ_{0}}} \Bigg ) , \end{aligned}$$
(12)
$$\begin{aligned} I_{2} = \mu \int d_{2} x \frac{s_{Q}^{2}}{R^{2}} \Bigg ( \frac{1}{L_{PQ}} - \frac{1}{L_{PQ_{0}}} \Bigg ), \end{aligned}$$
(13)
$$\begin{aligned} I_{3}&= \frac{\mu }{2R} \int d_{2} x \int _{0}^{H_{Q}} \frac{s_{PQ}^{2}}{L_{PQ}^{3}} dh_{Q} \nonumber \\&\cong \frac{\mu }{2} \int d_{2} x \frac{H_{Q}}{R} \frac{s_{PQ}^{2}}{L_{PQ_{0}}^{3}}, \end{aligned}$$
(14)
$$\begin{aligned} I_{4}&= \frac{\mu }{2} \int d_{2} x s_{PQ}^{2} \Bigg ( \frac{h_{P}}{R} + \frac{H_{Q}}{R} \Bigg ) \frac{1}{L_{PQ}^{3}} - \frac{\mu }{2} \int d_{2} x s_{PQ}^{2} \frac{h_{P}}{R} \frac{1}{L_{PQ_{0}}^{3}} \nonumber \\&\quad - \frac{\mu }{2R} \int d_{2} x \int _{0}^{H_{Q}} \frac{s_{PQ}^{2}}{L_{PQ}^{3}} dh_{Q} \cong \frac{\mu }{2} \int d_{2} x s_{PQ}^{2} \frac{h_{P}}{R} \Bigg ( \frac{1}{L_{PQ}^{3}} - \frac{1}{L_{PQ_{0}}^{3}} \Bigg ) \nonumber \\&\quad + \frac{\mu }{2} \int d_{2} x s_{PQ}^{2} \frac{H_{Q}}{R} \Bigg ( \frac{1}{L_{PQ}} - \frac{1}{L_{PQ_{0}}} \Bigg ). \end{aligned}$$
(15)

For the above expressions taking into account that \(\frac{s_{PQ}}{L_{PQ}} \le 1\), we find roughly the following estimates

$$\begin{aligned} O(I_{1}) \sim 2\cdot 10^{-3} \delta g_{t}^{P} \end{aligned}$$
(16)
$$\begin{aligned} O(I_{2}) \sim 3\cdot 10^{-4} \delta g_{t}^{P} \end{aligned}$$
(17)
$$\begin{aligned} O(I_{3}) \sim \frac{1}{2}\cdot 10^{-3} \delta g_{t}^{P} \end{aligned}$$
(18)
$$\begin{aligned} O(I_{4}) \sim 10^{-3} \delta g_{t}^{P}. \end{aligned}$$
(19)

The above orders of magnitude are computed under rather extreme conditions, like \(\varepsilon _{P}, \varepsilon _{Q} \sim 10^{-3},\) \(( \frac{s_{Q}}{R} )^{2} \sim 3 \times 10^{-4},\) etc; indeed restricting the area e.g. to a 100 km diameter \(I_{2}\) becomes irrelevant and the other are reduced considering that R can be brought to a mean height and it is only in particular areas that one can have 6 km of height difference in 100 km horizontal distance.

In the GTE software just the planar approximation has been fully developed. As for the spherical part, only a prototype version, which numerically computes the correction, has been implemented. This prototype, which is not optimized, is here used to assess the order of magnitude of the correction itself. For this reason from now on we will consider that the topographic body is described in terms of Cartesian coordinates and its attraction is given by Eq. (8).

3 The GTE algorithms

The hypotheses we do now to compute formula in Eq. (8) are basically that the density is constant across the whole body and that the body itself is constituted by prisms. This means that we have a regular grid on the (xy) plane, with cells of size \(\Delta x\), \(\Delta y\); this is typical when we give the terrain in the form of a digital terrain model (DTM), the centers of the cells are thought as sampling points of the digital terrain, while throughout the cell the terrain has a constant height. Similar is the situation when we have to do with bathymetry, the difference with the above being that now \(h = -H < 0\), while for topography we have \(h = H \ge 0\). For a body not totally below the (xy) plane, like in the case of sediments, one can decompose the calculation between the upper surface of the body and the lower surface.

Considering also that the density in Eq. (8) is included in \(\mu = G \rho\), namely a multiplicative constant, it is clear that the algorithm is basically only one, adapted to different circumstances. So we shall concentrate on the topographic case, leaving to a few remarks the application to other cases. Since the formula for the attraction of a single prism is explicitly known and can be split into a contribution \(\delta g_{t}^{+}\) of the upper face and a contribution \(\delta g_{t}^{-}\) of the lower face, in principle we can compute as well exactly \(\delta g_{t}\) at any point P outside the body by summing up the effects of each prism:

$$\begin{aligned} \delta g_{t}(P) = \sum _{(j,k)} \left[ \delta g_{jk}^{+}(P) - \delta g_{jk}^{-}(P) \right] \end{aligned}$$
(20)

with \(\left( j,k\right)\) grid indexes. We do not report here the expressions of \(\delta g_{jk}^{\pm }(P)\) that depend indeed from the shape of the prism and the relative position of P with respect to the center of the face \(+\) or \(-\), but we send the reader to the mentioned literature (MacMillan 1930; Nagy 1966). This approach is classical and implemented in many algorithms and provides an “exact” solution, given our planar hypotheses. GTE implements the algorithm too, specially to compute \(\delta g_{t}\) at sparse points. However when the number of the grid points goes up to \(10^{6}\) and the number of computation points is of the same order of magnitude, due to the necessity of computing several times logarithms and arctangents, the approach can become very time consuming and therefore not efficient. The remark that the bases of the prisms can be conglomerated, to perform one computation only (Tsoulis 1999), therefore dividing by a factor two the computational time, is helping but does not solve the problem. A breakthrough to the solution of the problem has come from the idea of applying a FFT approach (Sideris 1984). However the numerical advantage of a Fourier approach is very large in terms of velocity when we have to compute convolutions and when the discretized form is referring to grids with size equal to a power of 2 (or using a mixed radix algorithm to a power of 2 by a power of 3 etc.). This requirement is usually satisfied by extending the DTM grid with zero height nodes, the so-called zero padding. More refined solutions can be given to avoid jumps on the edges (Sansò and Sideris 2013). Furthermore the fast version of the discrete Fourier Transform, implies the result to be computed on the same grid on which data are given. For this reason the main algorithm of GTE is computing terrain corrections on grids.

We distinguish two case:

  1. 1.

    When \(\delta g_{t}\) has to be computed on a grid on the DTM itself

  2. 2.

    When \(\delta g_{t}\) has to be computed on a grid at constant height, \(h_{P} \equiv \overline{H}\).

1. GTE on a grid in the DTM itself. Let us first workout Eq. (8) to obtain convolution integrals; in particular we shall concentrate on the top part, because the lower part can be computed exactly as the lower part of a prism. To simplify the writing let us agree that \(\mathbf {\xi }\) is the position vector of \(P_{0}\) in the (xy) plane while \(\mathbf {\eta }\) is the position vector of the running point \(Q_{0}\). Note also that \(h_{p} = H_{P} \equiv H_{\xi }\), when P is on the DTM, so that \(\delta g_{t}\) can be considered as function of the 2D vector \(\mathbf {\xi }\). Then we have

$$\begin{aligned} \frac{1}{L_{PQ}}&= \frac{1}{[ \vert \mathbf {\xi } - \mathbf {\eta } \vert ^{2} + (H_{\xi } - H_{\mathbf {\eta }})^{2}]^{ \frac{1}{2}}} \nonumber \\&\cong \frac{1}{\vert \mathbf {\xi } - \mathbf {\eta } \vert }- \frac{1}{2} \frac{( H_{\mathbf {\xi }} - H_{\mathbf {\eta }} )^{2}}{ \vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} + \frac{3}{8} \frac{( H_{\mathbf {\xi }} - H_{\mathbf {\eta }} )^{4}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{5}} +\cdots \end{aligned}$$
(21)

Indeed the series, that we have stopped to the fourth order term, is convergent if the condition

$$\begin{aligned} \frac{\vert H_{\mathbf {\xi }} - H_{\mathbf {\eta }} \vert }{\vert \mathbf {\xi } - \mathbf {\eta } \vert } < 1 \end{aligned}$$
(22)

is everywhere satisfied on the DTM. This means that the maximum inclination of the DTM should be less than \(45^{\circ }\). It is interesting that, integrating Eq. (21) , we see that

$$\begin{aligned} \delta g_{t}^{+}(\mathbf {\xi })&= \mu \int \frac{d_{2} \mathbf {\eta }}{\vert \mathbf {\xi } - \mathbf {\eta } \vert } - \frac{\mu }{2} \int \frac{(H_{\mathbf {\xi }} - H_{\mathbf {\eta }})^{2}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \mathbf {\eta } \nonumber \\&\quad + \frac{3}{8} \mu \int \frac{(H_{\mathbf {\xi }} - H_{\mathbf {\eta }})^{4}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{5}} d_{2} \mathbf {\eta } + \cdots \end{aligned}$$
(23)

where each integral is in fact converging thanks to Eq. (22). However none of the above integrals is a convolution while, taking as an example the second order term, we could write

$$\begin{aligned} \frac{\mu }{2}\int _{D} \frac{(H_{\mathbf {\xi }} - H_{\mathbf {\eta }})^{2}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \mathbf {\eta }&= \frac{\mu }{2} H_{\mathbf {\xi }}^{2} \int _{D} \frac{d_{2} \mathbf {\eta }}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} - \mu H_{\mathbf {\xi }} \int _{D} \frac{H_{\mathbf {\eta }}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \mathbf {\eta } \nonumber \\&\quad + \frac{\mu }{2} \int _{D} \frac{H_{\mathbf {\eta }}^{2}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{2}} d_{2} \mathbf {\eta } \end{aligned}$$
(24)

where each of the integrals of the right hand side has the form of a convolution. Unfortunately none of them is any more convergent. The problem has been overlooked by saying that in the left hand side of Eq. (24) we can isolate a small area around \(\mathbf {\xi }\) because we take \(H_{\mathbf {\xi }} \equiv H_{\mathbf {\eta }}\) when \(\mathbf {\xi }\), \(\mathbf {\eta }\) belong to the same cell. In our software on the contrary we prefer to adopt a different strategy similar to that proposed in TcLight (Biagi et al. 2000): we define a “small” area (e.g. up to few kilometres) in the plane around 0 as \(D_{\varepsilon }(0)\); in our case, with the subsequent discretization in mind, we use a \(D_{\varepsilon }(0)\) as in Fig. 5.

Fig. 5
figure 5

The set used to isolate the singularity

This is formally defined by the characteristic function:

$$\begin{aligned} I_{\varepsilon }(\mathbf {\eta }) = \chi _{\varepsilon } (\vert \eta _{1} \vert ) \chi _{\varepsilon }(\vert \eta _{2} \vert ) \end{aligned}$$
(25)

with

$$\begin{aligned} \chi _{\varepsilon } (\vert t \vert ) = \left\{ \begin{array}{l l} 1 &{}\quad \text {for}\; \vert t \vert \le \varepsilon \\ 0 &{}\quad \text {elsewhere.}\\ \end{array} \right. \end{aligned}$$
(26)

Note that \(D_{\varepsilon }(0)\) can be translated around any point \(\mathbf {\xi }\) in the plane generating the set

$$\begin{aligned} D_{\varepsilon } (\mathbf {\xi }) = \mathbf {\xi } + D_{\varepsilon } (0) \end{aligned}$$
(27)

with characteristic function

$$\begin{aligned} I_{\varepsilon } (\mathbf {\xi } - \mathbf {\eta }) = \left\{ \begin{array}{l l} 1 & \quad \text {for}\; \mathbf {\xi } - \mathbf {\eta } \in D_{\varepsilon }(0) \\ 0 &\quad \text {elsewhere.}\\ \end{array} \right. \end{aligned}$$
(28)

This would allow, for each computation point P, splitting the integration domain into two parts, namely an inner and an outer region. According to the above definition the inner domain is composed of the DTM cells included into a square, centred in P, with side \(2\varepsilon +1\). For instance if \(\varepsilon\) is equal to 1 the inner part is defined by the 9 DTM cells closest to P (similarly to Fig. 5), if \(\varepsilon\) is equal to 2 the inner part is made of 25 DTM cells, etc. Then we can write:

$$\begin{aligned} \delta g_{t}^{+}(P)&= \mu \int _{D \setminus D_{\varepsilon } (\mathbf {\xi })} \frac{d_{2} \eta }{L_{PQ}} + \mu \int _{D_{\varepsilon } (\xi )} \frac{d_{2} \eta }{L_{PQ}} \nonumber \\&\equiv \delta g_{ou}^{+} (P) + \delta g_{in^{+}} (P). \end{aligned}$$
(29)

The integral \(\delta g_{in}^{+} (P)\) is easily computed by discretization in prisms (in fact only the upper faces contributions); in this way for each grid node and the corresponding prism we don’t have to compute a full grid of values, but only \((2 \varepsilon +1 )^{2}\) values, thus reducing considerably the number of computations and, as a consequence, the computational time. On the other hand the term \(\delta g_{ou}^{+} (P)\) in Eq. (29) can be written as:

$$\begin{aligned} \delta g_{ou}^{+} (P) = \mu \int _{D} \frac{[1 - I_{\varepsilon } (\mathbf {\xi } - \mathbf {\eta }) ]}{L_{PQ}} d_{2} \mathbf {\eta } \end{aligned}$$
(30)

and for this integral we can follow the approach of series development seen in Eq. (21). One has to remark however that now the ratio of Eq. (22) has to be computed for points \(\mathbf {\xi }\), \(\mathbf {\eta }\) distant at least \(\varepsilon + 1\) from one other, if we fix for simplicity \(\Delta x = \Delta y = 1\). So the condition Eq. (22) is much more easily satisfied, specially choosing judiciously \(\varepsilon\) as function of the terrain roughness. Also, the number of terms necessary in Eq. (21) to obtain a good approximation, decreases. Furthermore, referring for instance to the second order terms as in Eq. (24), one has:

$$\begin{aligned} \delta g_{ou,2}^{+} (P)&= \frac{\mu }{2} \int _{D \setminus D_{\varepsilon } (\mathbf {\xi })} \frac{(H_{\mathbf {\xi }} - H_{\mathbf {\eta }})^{2}}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \mathbf {\eta } \nonumber \\&= \frac{\mu }{2} H_{\xi }^{2} \int _{D} \frac{[1 - I_{\varepsilon } (\mathbf {\xi } -\mathbf {\eta })]}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \mathbf {\eta } \nonumber \\&\quad - \mu H_{\xi } \int _{D} \frac{H_{\eta } [1 - I_{\varepsilon } (\mathbf {\xi } - \mathbf {\eta })]}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \eta \nonumber \\&\quad + \frac{\mu }{2} \int _{D} \frac{H_{\eta }^{2} [1 - I_{\varepsilon } (\mathbf {\xi } - \mathbf {\eta })]}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{3}} d_{2} \mathbf {\eta }. \end{aligned}$$
(31)

As we see all the integrals in Eq. 31 are now convolution integrals and none of them is anymore singular.

A little thought shows that, by using the kernels:

$$\begin{aligned} K_{k} (\mathbf {\xi } - \mathbf {\eta }) = \frac{1 - I_{\varepsilon }(\mathbf {\xi } - \mathbf {\eta })}{\vert \mathbf {\xi } - \mathbf {\eta } \vert ^{ 2k + 1}} \end{aligned}$$
(32)

referring to Eq. 23 and collecting all the terms up to the maximum power 2N, one is reduced to compute an expression like:

$$\begin{aligned} \delta g_{ou}^{+} (P) = \sum _{k=0}^{N} \sum _{j=0}^{2k} C_{kj} H_{\xi }^{2k-1} \left\{ K_{k} *H_{ \mathbf {\eta }}^{j} \right\} \end{aligned}$$
(33)

with \(C_{k j}\) known constants.

Indeed the key point in Eq. 33 is that the convolution can be computed by the Fourier formula:

$$\begin{aligned} K_{k} *H_{ \mathbf {\eta }}^{j} = F^{-1} \left\{ F \lbrace K_{k} \rbrace \cdot F \lbrace H_{ \mathbf {\eta }}^{j} \rbrace \right\} \end{aligned}$$
(34)

which can be performed by discretization and application of FFT algorithm. In the GTE software the two numbers \(\varepsilon\) and N (taken both as integers) can be chosen by the user.

2. GTE on a grid at constant height \(\overline{H}\). We assume that the plane \(h= \overline{H}\) is totally above the topography. Therefore we can write

$$\begin{aligned} \frac{1}{L_{PQ}}&= \frac{1}{\left[ s^{2} + \overline{H}^{2} - 2 \overline{H} H_{\mathbf {\eta }} + H_{\mathbf {\eta }}^{2} \right] ^{\frac{1}{2}}} \nonumber \\&= \frac{1}{\left[ s^{2} + \overline{H}^{2} \right] ^{\frac{1}{2}}} \cdot \frac{1}{\left[ 1 - 2 \frac{\overline{H}}{s^{2} + \overline{H}^{2}} H_{\mathbf {\eta }} + \frac{1}{s^{2} + \overline{H}^{2}} H_{\mathbf {\eta }}^{2} \right] ^{ \frac{1}{2}}} \end{aligned}$$
(35)

If we call

$$\begin{aligned} L_{O} = L_{P_{O} Q_{O}} = \left[ s^{2} + \overline{H}^{2} \right] ^{\frac{1}{2}}, \end{aligned}$$
(36)

Eq. 35 can be expanded in (always convergent) power series in \(H_{\mathbf {\eta }}\), namely:

$$\begin{aligned} \frac{1}{L_{PQ}}\, =\, \frac{1}{L_{O}} \,+\, \frac{\overline{H}}{L_{O}^{3}} H_{\mathbf {\eta }}\, +\, \frac{3 \overline{H}^{2} - L_{O}^{2}}{2 L_{O}^{5}}\, H_{\mathbf {\eta }}^{2}\, +\, \frac{\overline{H} ( 5 \overline{H}^{2} - 3 L_{O}^{2} )}{2 L_{O}^{7}} H_{\mathbf {\eta }}^{3} \,+\, \cdots \end{aligned}$$
(37)

As we see by integrating \(\frac{1}{L_{PQ}^{2k+1}}\) over D several terms are generated each of which can be put in the form:

$$\begin{aligned} (j \ge 2k) \qquad \int _{D} \Bigg ( \frac{ \overline{H}}{L_{0}} \Bigg )^{(2k +1)} \Bigg ( \frac{H_{\mathbf {\eta }}}{ \overline{H}} \Bigg )^{j} d_{2} \mathbf {\eta } = F_{ k j} ( \mathbf {\xi }). \end{aligned}$$
(38)

Indeed such terms are easily computed by Fourier, using the convolution theorem. Note has to be taken that both terms under the integral in Eq. 38 are smaller than or equal to 1 and in particular \(( \frac{ \overline{H}}{L_{0}})^{2k + 1}\), as a bounded function that can be put to zero when \(s = \vert \mathbf {\xi } - \mathbf {\eta } \vert\) is larger than the diameter of D, has always a regular Fourier transform.

So in Eqs. 37 and 38 the singularity problem is overcome; yet when \(\overline{H}\) is only a small distance above the top of the topography (see Fig. 6) there are values of \(\frac{ \overline{H}}{L_{O}}\) and \(\frac{H_{\mathbf {\eta }}}{ \overline{H}}\) that in some areas can be very close to 1 strongly degrading the effectiveness of the approximation by series development in Eq. 37. To counteract such an effect we have implemented in GTE a particular algorithm, that we called slicing, schematically represented in Fig. 6.

Fig. 6
figure 6

Slicing the topographic body to compute the grid at height \(\overline{H}\)

The idea is that the terrain correction of the topographic body is computed at height \(\overline{H}\) slice by slice and then added. In doing so the reference plane is brought up at the base of the slice in such a way that the ratio of the height of the slice and the height of the computation grid is never close to 1. To explain, in Fig. 6, the middle slice has a ratio \(\frac{H_{2} - H_{1}}{ \overline{H} - H_{1}}\) which is smaller than \(\frac{1}{2}\). Then when we move to the upper slice we still have \(\frac{H_{top} - H_{2}}{ \overline{H} - H_{2}}\) smaller than \(\frac{1}{2}\).

The number of slices can be fixed by the user, as for the height it can be either chosen by the user or taken automatically by the software. In this second case the first height is fixed at \(H_{1} = 0.4 \overline{H}\), then \(H_{2} = 0.4 ( \overline{H} - H_{1})\) and so farther. Note that in the case of the computation of a grid close to the surface of the DTM the parameter \(\varepsilon\) can be different for each slicing thus improving the convergence and optimizing the computational time. To better explain how these values affect the calculation, a small sensitivity test will be presented in the practical applications section.

Remark 1

GTE for sparse points.

There are cases in which terrain effects have to be computed at sparse points, but, given the dimension of the problem, we still want to take advantage of some Fourier algorithm. We still distinguish the two cases, when the computation points are on DTM or they are in space. For the first case GTE computes a simple bi-linear interpolation to each computation point, from the values at the four corners of the cell to which P belongs. If on the contrary the sparse computation points \(\left\{ P_{k} \right\}\) are above the topography, but indeed not all at the same height, the software computes two grids in correpsondence of the minimum (\(H_{min}\)) and the maximum (\(H_{max}\)) heights of \(\left\{ P_{k} \right\}\). Then let P, the computation point, be as in Fig. 7.

Fig. 7
figure 7

Spatial interpolation at P

We take the cover cell and interpolate the terrain effect from \(G_{i}^{+}\) and \(G_{i}^{-}\) to \(P^{+}\) and \(P^{-}\) respectively. Such horizontal interpolations are performed by bi-linear functions. Finally we interpolate linearly from \(P^{-}\), \(P^{+}\) to P. Several experiments have shown that instead of computing more grids and using a higher order polynomial in vertical direction, it is always preferable to split the sparse points in several subsets according to their altitude, compute a couple of grid for each subset, and then to go linearly. The same tests have also shown that, in case of airborne acquisitions, keeping the height difference of one subset smaller than 500 m will in general maintain the error smaller than 0.1 mGal.

Remark 2

GTE for bathymetry.

We repeat Fig. 1 with only rock and water in Fig. 8.

Fig. 8
figure 8

The geometry of the body composed by \(B_{t}\) (topographic body), \(B_{r}\) (basement with rock density), \(B_{w}\) (basin filled with water); \(H_{O}\) maximum depth of \(B_{w}\), \(\overline{H}\) height of the grid where we want to compute \(\delta g\)

Let us recall that our purpose is to compute the gravimetric effect of the body \(B_{t} \cup B_{w}\). Indeed we have already a software capable of computing the gravity effect of \(B_{t}\); we want to show how to use the same software to compute the gravity effect of \(B_{w}\). Let us use the notation \(\delta g(\rho \vert B)\) = gravity effect of a generic density \(\rho\) distributed in the generic body B. We have:

$$\begin{aligned} \delta g ( \rho _{w} \vert B_{w}) = \delta g ( \rho _{w} \vert B_{O}) - \delta g ( \rho _{w} \vert B_{r}). \end{aligned}$$
(39)

Here \(B_{0}\) is a big prism the upper and the lower faces of which lay on the planes \(h = 0\) and \(h = -H_{0}\), i.e. \(B_{0}=B_{r} \cup B_{w}\). The first term on the R.H.S. is just the effect of the prism \(B_{0}\) that the software handles easily. The second term in Eq. 39, namely \(\delta g ( \rho _{w} \vert B_{r})\) is just the effect of the body \(B_{r}\), with a suitably reduced density, computed at a grid on the plane at height \(H = H_{O} + \overline{H}\) above the base of \(B_{r}\). This is exactly what our software already does if we just change the values of \(\mu\) to \(G \rho _w\) and the height from \(\overline{H}\) to \(H_{O} + \overline{H}\). Note that if we want to make \(B_{t} \cup B_{r} \cup B_{w}\) uniform, because then its effect is that of a Bouguer plate (or better prism), once we removed \(\delta g ( \rho _{r} \vert B_{t})\) we simply have to compute \(\delta g ( \rho _{w} \vert B_{w})\) with Eq. 39 but substituting \(\rho _{w}\) with \(\rho _{r}-\rho _{w}\).

It is worth noticing that with the same method but just changing the density \(\rho\) in the multiplicative constant \(\mu\) one could also take into account that the density below the sea floor is that of a sediment rather than that of rock. So the problem of bathymetry is solved.

Remark 3

GTE for Moho and sediments.

To handle the Moho effects we can use exactly the same reordering that we did for bathymetry, by suitably changing density constant. Only since the Moho is deeper and generally smoother than sea floor, depending on the resolution of the model available, the user can apply the simple prism algorithm implemented in GTE (in case of low resolution), or the FFT routine without slicing and with a small \(\varepsilon\) (e.g. \(\varepsilon =3\)). Similar is the situation with sediments, where the algorithm will have to be applied once for the lower surface and once for the upper surface of the sediments.

Remark 4

GTE for gravity gradiometry.

A part for classical airborne gravity surveys, nowadays also airborne gravity gradiometer systems used for geophysical exploration are becoming more and more important. Even if GTE has not been developed explicitly for gravity gradients, it allows to numerically compute at least the second derivative of the gravitational field in the vertical direction. In fact this component is already computed and used when interpolating from the two grids to the sparse points. A simple numerically test showed that for a complex DTM (such the one depicted in Fig. 9), GTE is able to compute the second vertical derivative of the potential with an accuracy of about 5 E in less than 60 s.

Concluding this long section let us recall here that all the choices done in designing the software have been driven by numerical tests, with the purpose of guaranteeing an accuracy in the computation of \(\delta g\) at the level of \(10^{-2}\) mGal, always assuring a fast computation. In any case, since the final accuracy of the terrain correction largely depends on the specific geometry of the problem (i.e. on the specific digital terrain model and on the distance between topography and the observation points), all the parameters of the GTE software, like the number of slicing sections as well as the \(\varepsilon\) parameter or even the number of convolutions can be set by the final user. However, to facilitate the use of the software some profiles have been a priori set. In Table 1 we report the main characteristics of each profile implemented for the computation of the gravitational effect of topography and bathymetry.

Table 1 Number of slices and number of prisms used for each slice to reduce the FFT singularity for different profiles

4 GTE performances

To evaluate the performances of the GTE software some numerical tests have been performed. The tests will be mainly focused on the computation of the terrain correction for airborne gravimetry (the algorithm presented in Sect. 3, case 2) which represents the most important feature of the GTE software. In particular the aim of these tests is to compare the accuracy and the computational time of GTE algorithms and software with respect to those implemented in standard scientific software such as the GRAVSOFT package (Tscherning et al. 1992) or the Tesseroids one (Uieda et al. 2011). GRAVSOFT is a suite of Fortran programs developed to model the gravitational signal. The package is widely used for scientific and production purposes. For instance it has been used for geoid determination of the Nordic Area (Tscherning and Forsberg 1987; Forsberg et al. 1997), parts of UK (Dodson and Gerrard 1990), Italy (Benciolini et al. 1984), Catalonia (Andreu and Simo 1992), the Mediterranean Area (Arabelos and Tziavos 1996), Turkey (Ayhan 1993) and in numerous smaller projects for local detailed geoid determination. Among the difference functionalities of the GRAVSOFT package here we will concentrate on the TC software only. Just note that the TCFOUR software, as many FFT based algorithms, permits to compute only the gravitational effect of topographic masses on the surface defined by the DTM itself (as in the first case presented in Sect. 3) it is therefore not suitable for airborne gravity surveying but can be used for ground as well as shipborne surveys. The TC software is more flexible allowing the computation of the gravitational effect of a DTM at any point in the space (outside the masses). to improve its speed, TC can consider two grids (one at high and one at low resolution), for cells close to the point were the terrain effect should be computed the high-resolution model is used, while for distant cells the low resolution one is considered. The threshold can be set by the user. Moreover, to compute the effect of a single cell of the DTM the user can choose between different solutions: one can use the prism equation (Nagy 1966) or approximate its solution with MacMaillian’s formula (MacMillan 1930) or even with the effect of a point mass. The approximation used is automatically chosen by the software as a function of the geometry of each specific computation. Note that, in GRAVSOFT, the masses of each prism (or point) is computed according to its latitude thus approximating, even if in a quite rough way, one of the most important effect of the Earth sphericity. Furthermore in GRAVSOFT also a method to deal with inconsistencies between ground stations and the DTM is implemented. Actually the user can choose if modifying smoothly the terrain model in an inner-zone to give the correct elevation at the computation point, or to move the stations on the DTM itself, or to leave the station free above the DTM.

Actually, TC can calculate prisms close to the station, an interpolation method in between and FFT far outside. Furthermore it has also methods to deal with inconsistencies between the stations and the DTM (station in masses e.g.). I would discuss that options more in detail and cut the general description of GRAVSOFT

As for Tesseroids, it is a collection of command-line C programs to model the gravitational potential, acceleration, and gradient tensor of topographic masses. Tesseroids supports models and computation grids in Cartesian and spherical coordinates. The main geometric element used in the modelling process is a spherical prism, also called a tesseroid, the gravitational effect of which can be computed by means of approximated formula (Asgharzadeh et al. 2007). The software basically computes the gravitational effect of each tesseroid by summing up the effect of a number of point masses optimally distributed and weighted inside the tesseroid. Indeed, the accuracy of the solution remains essentially unchanged for different numbers of point masses as long as the node spacing is smaller that the distance to the observation point (Asgharzadeh et al. 2007), therefore in using the software particular attention has been paid to respect this simple law. Some new developments (Szwillus et al. 2012), based on adaptive changing the topography resolution with Tesseroids, need to be mentioned here, since they can probably considerably reduce the computational time. Tesseroids is mainly used for geophysical studies at different scales from the very local one, such as the reconstruction and analysis of the Grotta Gigante cave signal (a Karstic cave in the Northern part of Italy Pivetta and Braitenberg 2015), to the regional ones such as the study of the crustal structure in the Andean region (Alvarez et al. 2014) or the study of the European Alps orogenetic belt (Braitenberg et al. 2013). All the tests have been performed on a single node of a supercomputer equipped with two 8-cores Intel Haswell 2.40 GHz processors (for a total of 16 cores) with 128 GB RAM.

Before presenting the numerical tests, it should be observed that, since we are supposing to be in planar approximation, the solution obtained by means of the pure prism equation (i.e. the GTE VERYSLOW solution) represents the exact solution of the problem and can be used for comparisons. Another comment is required at this step: there is still, in fact, one problem that should be faced to correctly evaluate the final accuracy of the terrain correction here presented. In general, the actual terrain, that should be considered to properly reduce gravity observations, cannot being exactly represented by flat topped prisms like in the examples here reported. In literature this problem is usually solved by interpolating the terrain close to the observation point, i.e. for distances smaller than 100 m according to the standards defined by Hinze et al. (Hinze et al. 2005), and computing its effect for instance by means of polyhedral approximation. Here this effect, which is in general relevant only when dealing with ground observations as will be shown later on, is evaluated by bi-linearly interpolating the digital elevation model close to the observation point (i.e. for horizontal distances smaller than 300 m) to a resolution of 10 \(\times\) 10 cm and computing its effect by means of prisms. Note that this finer description well approximates the polyhedral solution. The difference between the gravitational effect of the flat topped prisms and this finer description, called in the following flat prism approximation, will be reported for each experiment.

The first dataset used for the testing purpose is located in the south part of New Mexico, between \(31.5^\circ\) and 35 S and \(105^\circ\) and \(108^\circ\) W. The digital elevation model is a grid with 351 rows and 301 columns with a spatial resolution of 36 arcsecond. It is a mountainous region characterized by a mean elevation of 1670 m with a minimum of 1050 m and a maximum of 3445 m (Fig. 9).

Fig. 9
figure 9

Digital terrain model used for the first test

The first test performed consists in comparing, in terms of accuracy and computational time, the results computed on a regular grid (the same grid defined by the DTM) at 3500 m obtained by the different GTE profiles as well as by different software solutions. Note that since the test area is completely onshore both profiles SLOW and VERYSLOW are computing the gravitational effect by using the prism equation only.

The altitude of the grid has been chosen to be sure to compute the gravitational effect of the topography always outside the masses, therefore as already said it has been fixed at 3500 m, only 55 m above the highest peak. Results of this first test are presented in Fig. 10 and summarized in Table 2, where the computational time required for each computation and some statistics on the differences between each solution and the SLOW profile (used as a reference) are reported.

Fig. 10
figure 10

TC compute with the SLOW profile and its differences with respect to the gravitational efect computeb by means of different profiles/software

Table 2 Statistics and computational time on a grid at 3500 m for the different profiles and software tested

Starting from the comparison between the SLOW profile and the GRAVSOFT software (with the standard compilation) it can be seen that the computational time required by GTE (144 s) is less than a third of those required by GRAVSOFT (about 511 s). This is due to the fact that some of the GTE routines have been parallelized, thus exploiting the maximum computational power of the machine. Supposing to run GRAVSOFT in a parallel way, its computational time could be in principle reduced up to a factor 16 to about 30 s, which is comparable to the FAST GTE solution. This is due to the approximations introduced by GRAVSOFT in the computation of the single prism effect. However the difference between the two solutions shows a mean value of \(-6.95\) mGal and a standard deviation of 2.41 mGal; removing a border of about 40 km where border effects of the FFT (Sansò and Sideris 2013) can have some importance the standard deviation drops to 0.7 mGal while the average remains practically unchanged. To improve the mean value of the GRAVSOFT terrain correction one has to force the software to use only the high-resolution grid and compute the effect by means of prism equation. In this case the difference on the average reduces to \(-4\) mGal but the computational time required to reach the GRAVSOFT solution considerably increases to more than 6 h. This \(-4\) mGal difference between the averages of the GTE and GRAVSOFT solutions can be explained by the different algorithms used from the two software to map geodetic coordinates in Cartesian ones: in fact, while GTE uses the mapping presented in Sect. 2, GRAVSOFT defines its Cartesian reference system simply as \(x=111195 \Delta \lambda \cos \overline{ \varphi }\) and \(y=111195\Delta \varphi\), with \(\Delta \lambda\) and \(\Delta \varphi\) the DTM resolution in longitude and latitude respectively (in radians) and \(\overline{ \varphi }\) the average latitude of the DTM itself. As for the Tesseroids results it can be seen that they are closer than GRAVSOFT to those of GTE with an average difference of about 2 mGal and a standard deviation of 0.29 mGal which drops to only 0.17 mGal if the border region is removed from the statistics. It should be observed that the Tesseroids computation is performed directly in spherical approximation, this is the main cause of the 2 mGal difference (as can be observed by Fig. 10). This is also confirmed by the fact that if the spherical correction of Eq. 11 is applied to the GTE result the difference between Tesseroids and GTE drops down to less than 0.5 mGal (0.03 mGal mean value, 0.05 mGal standard deviation, \(\pm 0.3\) mGal as minimum and maximum, see Fig. 11). As for the computational time, even for such a small example it takes more than 8 hours to compute the Tesseroids solution which is two orders of magnitude more than the slowest GTE computational time. Again, supposing to run it in a parallel way on 16 cores, the computational time can theoretically be reduced up to about 2000 s which is however an order of magnitude more than the slowest GTE solution.

Fig. 11
figure 11

Spherical correction compute by means of numerical integration of Eq. 11 and difference between GTE with spherical correction and Tesseroids

Considering the other GTE profiles, namely the VERYFAST, FAST and TRADEOFF, it can be observed that the use of FFT speeds up the computation of a factor ranging between 2 and 10 giving practically the same result (standard deviation of the differences always smaller than 0.1 mGal). The major improvement from the VERYFAST to the FAST profile is basically due to the combine effect of the slicing algorithm and of the increase of the \(\varepsilon\) paramenter. Actually, changing the value of \(\varepsilon\) from 1 to 20 considerably reduces the average difference with respect to the SLOW solution from 0.69 mGal to 0.004 mGal while the computational time is increased from about 6 to 25 s. Also the maximum of the difference decreases from about 2 mGal to just 0.006 mGal. On the contrary, the impact of the slicing on the accuracy is smaller: increasing the number of slices from 1 to 6 does improve only of 0.01 mGal the standard deviation of the result (leaving all the other statistics unchanged). However the slicing tool allows, as stated above, to increase \(\varepsilon\) only where it is required (e.g. on the top of mountainous area), thus optimizing the computation. In fact when dealing with the highest slices large portions of the area is generally empty (see for instance Fig. 6), therefore, even for large \(\varepsilon\), only few prisms are computed. Finally coming to the flat prism approximation (here evaluated only on 10 % of the whole dataset), it can be seen that in this case it can be disregarded being in general smaller than 0.05 mGal.

The same dataset has been used also to test GTE performances for the computation of the terrain effect directly on a grid on the surface of the DTM itself (i.e. the algorithm explained in Section 3.2). In that case Tesseroids cannot be used since its solution became unstable when the observation point is close to the masses. GTE computes the solution in 9.8 s with differences with respect to the pure prism solutions smaller than \(1^{-3}\) mGal while GRAVSOFT takes more than 580 s giving differences of few mGal (\(-6.17\) mGal average and 2.72 standard deviation).As expected, in this case the difference between the flat topped prism and the polyhedral approximation, become significant having a standard deviation of about 1.5 mGal.

The second experiment performed consists in computing the gravitational effect using the same digital elevation model on a set of 1000 sparse points with a variable altitude set at 150 m above the DTM (results are reported in Table 3).

Table 3 Statistics and computational time on 1000 points for the different profiles and software tested

Comparisons between GRAVSOFT, Tesseroids and the SLOW profile are practically unchanged, it should only be observed that the computational time required by GTE does not depend on the number of sparse points since once the two grids are computed it is just a matter of linear interpolations, while in the case of GRAVSOFT and Tesseroid doubling the number of points corresponds to doubling the computational time (note that classical airborne gravimetry surveys can reach more than \(10^6\) points, i.e. 1000 times the number of points used in this experiment). As for the others profiles they basically show the same statistics which are however degradated (the standard deviation increases from less than 0.1 mGal to about 0.9mGal) due to the closeness of the points to the DTM and to the use of just two grids to interpolate points with height differences larger than 1500 m. If we divide the dataset on two subsets according to the points altitude (e.g. fixing a threshold to discriminate between the two subsets at 1800 m) the standard deviation of the differences between the VERYSLOW and the other GTE profiles drops to about 0.2 mGal. In any case we should keep in mind that these results refer to an extreme DTM with an unrealistic situation, since it is probably unsafe to fly so close to the ground with such a rough topography. It should also be observed that in this test GRAVSOFT is the fastest software, however it gives quite inaccurate results with differences with respect to the SLOW profile and to Tesseroids larger than 2 mGal (in terms of standard deviation). In both the comparisons it should be underlined that the fact of having always a positive topography, and of computing the gravitational effect just over the highest peaks, is not helping. In fact the three TC algorithms tested adopt different reference frames which implies different masses for the same DTM cell. As a consequence the gravitational signal due to this inconsistency has the same sign for all the cells grid and therefore cumulate giving high differences in terms of mean value when comparing the results. In any case it is important to note that in geophysics exploration applications the average value of the field is not so important and is usually disregarded. As for the flat topped prism approximation, in this extreme scenario where we suppose an airplane flying at only 150 m above the topography over a mountainous area, shows a standard deviation of 0.26 mGal, which is smaller than the approximation introduced by the use of FFT solutions.

The last test has been performed on a more realistic (and less extreme dataset): a real airborne acquisition performed in the framework of the CarbonNet project (DOPI 2012) has been in fact used. The dataset is made of 404, 384 real airborne observations acquired in 2011 by Sander Geophysics Ltd. to provide a better understanding of the onshore, nearshore and immediate offshore geology of the Gippsland Basin, a sedimentary basin situated in south-eastern Australia, about 200 km east of the city of Melbourne. A DTM with spatial resolution of 250 m, based on AusGeo model (Whiteway 2009), and covering the region between \(37.3^\circ\) and \(39.4^\circ\) S, and \(146.2^\circ\) and \(148.9^\circ\) E for a total number of 819 by 1093 grid cells has been used. The height of the DTM is ranging between 1700 m of the Mount Howitt and \(-2754\) m in correspondence of the beginning of the Bass Canyon with an average height of only 20 m and a standard deviation of 503 m. The aeroplane is flying 165 m above the ocean offshore and follows the topography on shore with a maximum altitude of 369 m. The DTM used as well as the survey tracks are shown in Fig. 12.

Fig. 12
figure 12

Digital terrain model used for the last test. Black dots represent observation points downsampled by a factor of 50

Results are shown in Table 4 where it can be seen how the use of the FFT allows to compute the terrain correction for the considered dataset in less than 1 h while classical software, like GRAVSOFT or Tesseroids, requires from few hours up to more than 1 day.

Table 4 Statistics and computational time on 404, 384 points for the different profiles and software tested. VERYSLOW shows statistics on the computed signal

Actually the VERYFAST profile gives a quick-look of the terrain effect with errors of the order of 0.1 mGal (standard deviations) in less than 10 min, while the FAST profile will give in about 20 min results which are one order of magnitude more accurate (0.016 mGal standard deviation) than any airborne gravimetric survey, thus confirming the goodness of GTE software for this kind of application. The VERYSLOW profile, completely exploiting the potentiality of the machine used for the test, takes only 4 h to compute the solution. Again GRAVSOFT shows the farthest results but computed in a time comparable to those of the VERYSLOW solution. The Tesseroids software is the slowest with more than 5 days of computational time with results very close to those of the GTE software. Again it should be reminded that the large part of this difference is probably due the fact that Tesseroids works in spherical approximation. Coming to the flat prism approximation, here it has been evaluated only on 10 % (randomly chosen) of the observation points. Again it can be seen that this effect can be disregarded when dealing with airborne observations, having a standard deviation of only 0.01 mGal.

5 Conclusions

In this paper we have presented a new software, called GTE, for the computation of the gravitational terrain effect. The GTE solution is basically a combination of FFT techniques and classical prism modelling aiming to keep errors lower than 0.1 mGal. In detail GTE has been developed addressing two major issues required by modern geodetic and geophysical applications, namely high accuracy and high computational performances. As theoretically and numerically proven in the paper planar approximation can in general be used, thus simplifying the problem, when dealing with regions smaller than 200 \(\times\) 200 km, which is the typical situation of local geophysical applications based on airborne gravimetric surveys. In any case some correction terms to account also for the main effects of spherical approximation have been also illustrated. To compute the terrain correction by means of Fourier algorithms, Newton’s integral has been expanded in a Taylor series. Some solutions to address the problems of the convergence of the series (slicing) and of its singularity (prism-FFT mixed algorithm) are also presented.

The comparisons performed have shown that GTE gives results very close to those obtained by prism equation with differences in the case of a real airborne survey of the order of \(10^{-2}\) mGal in about 20 min. This differences slightly increase to 0.06 mGal (average) and 0.021 mGal (standard deviation) if the results are compared with those in spherical approximation computed by Tesseroids.