Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Blais 2008 B

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/220858174

Discrete Spherical Harmonic Transforms: Numerical


Preconditioning and Optimization

Conference Paper · June 2008


DOI: 10.1007/978-3-540-69387-1_74 · Source: DBLP

CITATIONS READS
8 853

1 author:

Rod Blais
The University of Calgary
77 PUBLICATIONS 519 CITATIONS

SEE PROFILE

All content following this page was uploaded by Rod Blais on 03 June 2014.

The user has requested enhancement of the downloaded file.


Discrete Spherical Harmonic Transforms:
Numerical Preconditioning and Optimization

J.A. Rod Blais

Department of Geomatics Engineering


Pacific Institute for the Mathematical Sciences
University of Calgary, Calgary, AB, T2N 1N4, Canada
blais@ucalgary.ca,
www.ucalgary.ca/~blais

Abstract. Spherical Harmonic Transforms (SHTs) which are essentially Fourier


transforms on the sphere are critical in global geopotential and related applica-
tions. Among the best known strategies for discrete SHTs are Chebychev quad-
ratures and least squares. The numerical evaluation of the Legendre functions
are especially challenging for very high degrees and orders which are required
for advanced geocomputations. The computational aspects of SHTs and their
inverses using both quadrature and least-squares estimation methods are dis-
cussed with special emphasis on numerical preconditioning that guarantees reli-
able results for degrees and orders up to 3800 in REAL*8 or double precision
arithmetic. These numerical results of spherical harmonic synthesis and analysis
using simulated spectral coefficients are new and especially important for a
number of geodetic, geophysical and related applications with ground resolu-
tions approaching 5 km.

1 Introduction
On the spherical Earth as on the celestial sphere, array computations can be done for
regional and global domains using planar and spherical formulations. Spherical quad-
ratures and least-squares estimation are used to convert continuous integral formula-
tions into summations over data lattices. Spherical topologies are quite different from
planar ones and these have important implications in the computational aspects of
array data processing.
Spherical geocomputations for regional domains of even continental extents can be
reduced to planar computations and under assumptions of stationarity or shift invari-
ance, discrete array computations can be optimized using Fast Fourier Transforms
(FFTs). Specifically, convolution operations for filtering and other data processing
applications thereby require only O(NlogN) instead of O(N2) operations for N data in
one dimension, O(N2logN) instead of O(N4) operations for NxN data in two dimen-
sions, and so on.
For global appplications, Gaussian, equiangular and other similar regular grids can
be used for spherical quadratures and discrete convolutions. Various quadrature
strategies are available in the literature going back to Gauss and Neumann, in addition
to least-squares estimation techniques (e.g. [8, 16]). Other approaches have also been

M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 638– 645, 2008.
© Springer-Verlag Berlin Heidelberg 2008
Discrete Spherical Harmonic Transforms 639

used for discretization and analysis of functions on the sphere using triangular and
curvilinear tesselations based on inscribed regular polytopes (see e.g. [2]). Depending
on the applications, these strategies may be preferable to the equiangular ones which
will be discussed in the following.
The associated Legendre functions for high degrees and orders are computationally
very challenging. Without any normalization, one can hardly compute SHTs of de-
grees and orders over 50 or so in REAL*8 or double precision arithmetic. With proper
normalization such as the geodetic one used in the following computations, one can
achieve degrees and orders to around 1800 in REAL*8 or double precision arithmetic
[4] and over 3600 in REAL*16 or quadruple precision arithmetic [5,6]. With latitude-
based preconditioning, [13,14,19] achieved about 2700. With Clenshaw’s approach,
similar results can be achieved for appropriately decreasing spectral coefficients such
as with the EGM06 model coefficients of degree and order 2190 [7,13].
The following shows that with proper numerical preconditioning independent of
the latitude, the Legendre functions can be evaluated reliably for degrees and orders
over 3800 in REAL*8 or double precision arithmetic. This is demonstrated explicitly
in synthesis and analysis computations using unit spectral coefficients with equiangu-
lar grids that do not include the poles. In order words, the previously published re-
sults [5,6] using Chebychev quadrature and least squares can be extended to degrees
and orders over 3800 working in REAL*8 or double precision arithmetic. This is
very important for numerous applications in geocomputations for ground resolutions
of about 5 km.

2 Continuous and Discrete SHTs

The orthogonal or Fourier expansion of a function f(θ, λ) on the sphere S2 is given by



f (θ, λ) = ∑ ∑ f n ,m Ynm (θ, λ) (1)
n = 0 |m|≤ n

using colatitude θ and longitude λ, where the basis functions Ynm (θ, λ ) are called the
spherical harmonics of degree n and order m. In particular, the Fourier or spherical
harmonic coefficients appearing in the preceding expansion are obtained as inner
products

f n ,m = ∫ f (θ, λ) Ynm (θ, λ) dσ (2)


S2

with the overbar denoting the complex conjugate with dσ denoting the standard rota-
tion invariant measure dσ = sin θ dθ dλ on S2. In most practical applications, the func-
tions f(θ,λ) are band-limited in the sense that only a finite number of those coefficients
are nonzero, i.e. f n,m ≡ 0 for all degrees n > N and orders |m| < n. Hence, using the
regular equiangular grid θj = jπ/J and λk = k2π/K, j = 0, …, J-1, k = 0, …, K-1, with J
and K to be specified later on, spherical harmonic synthesis can be formulated as
N −1
f (θ j , λ k ) = ∑ ∑ f n,m Ynm (θ j , λ k ) (3)
n = 0 |m|≤ n
640 J.A.R. Blais

and using some appropriate spherical quadrature, the corresponding spherical har-
monic analysis can be formulated as
J −1 K −1
f n ,m = ∑ ∑q j f (θ j , λ k ) Ynm (θ j , λ k ) (4)
j= 0 k = 0

for quadrature weights qj as discussed by various authors e.g. [9,16,3].


The usual geodetic spherical harmonic formulation is given as
∞ n
f (θ, λ) = ∑ ∑ [c nm cos mλ + s nm sin mλ] Pnm (cos θ) (5)
n =0 m=0

where
⎧cnm ⎫ 1 ⎧cos mλ ⎫
⎨ ⎬= ∫
⎩ s nm ⎭ 4π S2
f (θ, λ) ⎨ ⎬ Pnm (cos θ) dσ
⎩ sin mλ ⎭
(6)

with the geodetically normalized Legendre functions Pnm (cos θ) expressed in terms of
the usual spherical harmonics Ynm (θ, λ ) (see e.g. [11] and [3] for details). The tilde
“~” will be used to indicate geodetic normalization in the following.
Explicitly, using the geodetic formulation and convention, one has for synthesis,
N −1 n
f (θ, λ) = ∑ ∑ [c nm cos mλ + s nm sin mλ] Pnm (cos θ) (7)
n =0 m=0

and for analysis, using complex analysis,


1 2π π
4π ∫0 ∫0
c nm + is nm = f (θ, λ) (cos mλ + i sin mλ) Pnm (cos θ)sin θdθdλ
(8)
π
= ∫ [u m (θ) + iv m (θ)]Pnm (cos θ)sin θdθ
0
where
1 2π
4π ∫0
u m (θ) + iv m (θ) = f (θ, λ) (cos mλ + i sin mλ) dλ (9)

which is simply the parallel-wise Fourier transform of the data.


Hence using data equispaced in longitude and the corresponding Discrete Fourier
Transform (DFT) and Inverse DFT (IDFT), one can write for each parallel,
{f (θ, λ k )} ⎯⎯⎯
DFT
→ {u m (θ) + iv m (θ)} ⎯⎯⎯
IDFT
→ {f ′(θ, λ k )} (10)
and correspondingly, for each meridian, with some appropriate Chebychev Quadra-
ture (CQ) or Least Squares (LS) to be described explicitly below,
{c nm + is nm } ⎯⎯⎯⎯⎯
SYNTHESIS
→ {u m (θ) + iv m (θ)} ⎯⎯⎯⎯
CQ or LS
→ {c′nm + is′nm } (11)

in which the Synthesis is only partial, i.e. in the Fourier domain. Notice that in gen-
eral for band limit N, N rows of equilatitude data are required with LS while 2N rows
of equispaced equilatitude data are required with the CQ, and at least 2N equispaced
data are required for DFT per parallel (see e.g. [5,6] for more discussion).
Discrete Spherical Harmonic Transforms 641

Furthermore, for data grids with Δθ = Δλ which are often required in practice, such as
{(qj, lk) | qj = jp/N, lk = kp/N; j = 0, 1, …, N-1, k = 0, 1, …, 2N-1}
for LS, or
{(qj, lk) | qj = jp/2N, lk = kp/2N; j = 0, 1, …, 2N-1, k = 0, 1, …, 4N-1}
for CQ, the poles can be excluded with a shift in latitude
{(qj, lk) | qj = (j+½)p/N, lk = kp/N; j = 0, 1, …, N-1, k = 0, 1, …, 2N-1}
and correspondingly,
{(qj, lk) | qj = (j+½)p/2N, lk = kp/2N; j = 0, 1, …, 2N-1, k = 0, 1, …, 4N-1}
which allow the use of hemispherical symmetries in the associated Legendre functions
Pnm(cos (π – θ)) = (-1)n+m Pnm(cos θ)
Notice that these data grids with Δθ = Δλ have Nx2N and 2Nx4N quantities and N2
spectral coefficients for band limit N. More details with simulated results can be
found in [5,6].

3 Numerical Preconditioning and Optimization


The numerical evaluation of the associated Legendre functions Pnm(cosθ) for colati-
tude θ, is very challenging for high degrees n and orders m. To see this, one only has
to evaluate the diagonal terms Pnn(cos 1º) for n = 1, 2, …, 100, …, using different
normalizations. Furthermore, there are several strategies with recursions in n and m
and these are far from being numerically equivalent (see e.g. [1,3,14]).
The geodetically normalized associated Legendre functions Pnm (cos θ) are com-
puted as a lower triangular matrix with the rows corresponding to the degrees n and
the columns corresponding to the orders m. With the initialization for degrees and
orders 0 and 1, P00 (cos θ) = 1, P10 (cos θ) = 3 cos θ and P11 (cos θ) = 3 sin θ, the
diagonal terms Pnn (cos θ) = (2n + 1) / 2n sin θ Pn −1,n −1 (cos θ) and the subdiagonal
terms Pn ,n −1 (cos θ) = 2n + 1 cos θ Pn −1,n −1 (cos θ) computed recursively. The remaining
terms for n ≥ 2 and n-2 ≥ m ≥ 0 are evaluated with a three-term formula
cos θ Pnm (cos θ) = α nm Pn −1,m (cos θ) + α n +1,m Pn +1,m (cos θ)

with α nm = (n − m)(n + m) / (2n − 1)(2n + 1) as detailed in [18], based on [10, 15].


With this approach, degrees and orders up to 1800 or so have been achieved quite
reliably with REAL*8 or double precision and over 3600 with REAL*16 or quadru-
ple precision arithmetic [5, 6].
Using IEEE standards for floating point arithmetic on personal and similar com-
puters, the EXPONENT limits for real, double and quadruple precisions are as follows:

Variable Type Minimum EXPO- Maximum EXPONENT


NENT
REAL*4 -125 128
REAL*8 -1021 1024
REAL*16 -16381 16384
642 J.A.R. Blais

Hence to avoid underflow problems in computing Pnm (cos θ) , a simple strategy is


to bias the EXPONENT of the corresponding variable by a large number and remove
the bias once the computations are done. Specifically, using personal and similar
computers with REAL*8 or double precision arithmetic, a bias of 1000 was applied to
the EXPONENT of the variable in question and the resulting numerical computations
are very stable. More details are included in the next Section.
This strategy of biasing the EXPONENT is independent of the colatitude θ
which is very important in this context. The literature on computing very high degree
spherical harmonics contains numerous strategies such as using the Clenshaw summa-
tion approach [13], preconditioning the variable with 10280sinθ in SHTools [19],
modifying the recursion to avoid high powers of sinθ [14], and others. These modi-
fications have been reported to achieve degrees around 2700-2800 in synthesis com-
putations [13, 14] and in synthesis and analysis [19]. Notice that in synthesis only
computations, it is only necessary to avoid underflows and set the corresponding in-
cremental contributions to zero while in synthesis and analysis computations, the nu-
merical recovery of the input spectral coefficients is expected in addition to avoiding
possible underflows.

4 Numerical Experimentation
To test the numerical preconditioning procedure, consider the following
{c nm + is nm } ⎯⎯⎯⎯⎯
SYNTHESIS
→ {u m (θ) + iv m (θ)} ⎯⎯⎯⎯
CQ or LS
→ {c′nm + is′nm }

with the partial SYNTHESIS in the Fourier domain as


N −1
u m (θ) + iv m (θ) = ∑ (c
n=m
nm + is nm )Pnm (cos θ) (12)

for 2N isolatitudes with Δθ = π/2N for CQ and N isolatitudes with Δθ = π/N for LS.
In longitude, 2N equispaced points with Δλ = π/2N for both CQ and LS in the follow-
ing experimentation. A shift in latitude of the grids by half Δθ has been implemented
to exclude the poles.
The Chebychev quadrature is as follows
2N −1
c′′nm + is′′nm = ∑ q (u
j= 0
j jm + iv jm )Pnm (cos θ j ) (13)

with ujm ≡ um(θj) and vjm ≡ vm(θj), and CQ weights


N −1
1 1
qj = sin ( ( j + ½ )π /2N ) ∑ sin ( (2h + 1)( j + ½ )π /2N ) (14)
N h =0 2h +1
with q2N-j = qj for j = 0, 1, …, N-1 by hemispherical symmetry. These computations
are roughly O(N3) for degree N.
The least-squares formulation per degree m is as follows
Discrete Spherical Harmonic Transforms 643

N −1

∑P
n =m
nm (cos θ j ) (c′′′nm + is′′′nm ) = u m (θ j ) + iv m (θ j ) (15)

with isolatitudes
θ j = ( j + ½ )π / N = (2 j + 1)π /2N for j = 0,1,..., N − 1 .

The least-squares computations for c′′′nm + is′′′nm per degree m are obviously very
demanding and roughly O(N4). The elements in the corresponding normal matrices
can be evaluated using the Christoffel-Darboux formula as shown in [18, Appendix
B] based on [12], but this has not yet been implemented in the code yet.
Starting with simulated unit spectral coefficients, the reconstructed coefficients are
compared with the input coefficients and Root-Mean-Square (RMS) values are com-
puted for various degrees and orders using both CQ and LS. The key results, all ob-
tained in REAL*8 or double precision arithmetic, are shown in Table 1 for degrees
and orders to 3800. The results for degrees and orders to 1800 or so agree exactly
with those REAL*8 or double precision results published in [5 and 6]. The second
column of Table 1 are the RMS results on a Notebook (NB) while the third column
are the RMS results on a desktop PC, both with AMD Athlon64 Dual-Core Proces-
sors. The RMS decreases to E-04 for 3900 with CQ but the situation is better using
LS with E-13 for 3900 and E-09 for 4000. The numerical stability exhibited in Table
1 for synthesis/ analysis for degrees over 3000 has not previously been seen anywhere
else in the literature.

Table 1. Numerical RMS Results for SYNTHESIS/ANALYSIS with simulated unit spectral
coefficients on AMD64 NB and PC in REAL*8 or Double Precision arithmetic

Degrees CQ RMS on AMD64 NB LS RMS on AMD64 PC


N (data grid: 2Nx2N) (data grid: Nx2N)
1000 1.24557E-12 5.53768E-14
2000 3.16427E-12 1.13533E-13
3000 6.72616E-12 1.67988E-13
3200 2.59890E-12 1.66504E-13
3400 3.86647E-12 1.65382E-13
3600 3.54980E-12 1.64626E-13
3800 5.63723E-11 2.08633E-13

5 Concluding Remarks
Considerable work has been done on solving the computational complexities, and
enhancing the speed of calculation of spherical harmonic transforms for different
equiangular grids. The numerical problems of evaluating the associated Legendre
functions for very high degrees and orders have been solved using numerical precon-
ditioning in terms of the EXPONENT of the corresponding variable. Explicitly, using
644 J.A.R. Blais

simulated unit spectral coefficients for degrees and orders up to 3800, partial synthe-
sis and analysis lead to RMS errors of orders 10-12-10-13. When starting with simulated
spherical harmonic coefficients corresponding to 1/degree2, the previously results can
be expected to improve by a couple of orders of magnitude, as experienced in previ-
ous experimental work [4, 5, 6]. The latter simulations would perhaps be more indica-
tive of the expected numerical accuracies in practice.
As enormous quantities of data are involved the intended gravity field applications,
parallel and grid computations are imperative for these applications. Preliminary ex-
perimentation with parallel processing has already been done [17] and these REAL*8
or double precision results can readily be duplicated in parallel environments.

Acknowledgement. The author would like to acknowledge the sponsorship of the


Natural Science and Engineering Research Council in the form of a Research Grant
on Computational Tools for the Geosciences. Special thanks are also expressed to Dr.
M. Soofi, Post Doctoral Fellow (2005-2006) in Geomatics Engineering and Geo-
science, University of Calgary, for helping with the optimization of the code for dif-
ferent computer platforms.

References
1. Adams, J.C., Swarztrauber, P.N.: SPHEREPACK 2.0: A Model Development Facility
(1997), http://www.scd.ucar.edu/softlib/SPHERE.html
2. Blais, J.A.R.: Optimal Spherical Triangulation for Global Multiresolution Analysis and
Synthesis. In: The 2007, Fall Meeting of the American Geophysical Union in San Fran-
cisco, CA (2007)
3. Blais, J.A.R., Provins, D.A.: Spherical Harmonic Analysis and Synthesis for Global Mul-
tiresolution Applications. Journal of Geodesy 76(1), 29–35 (2002)
4. Blais, J.A.R., Provins, D.A.: Optimization of Computations in Global Geopotential Field
Applications. In: Sloot, P.M.A., Abramson, D., Bogdanov, A.V., Gorbachev, Y.E., Don-
garra, J., Zomaya, A.Y. (eds.) ICCS 2003. LNCS, vol. 2658, pp. 610–618. Springer, Hei-
delberg (2003)
5. Blais, J.A.R., Provins, D.A., Soofi, M.A.: Spherical Harmonic Transforms for Discrete
Multiresolution Applications. Journal of Supercomputing 38, 173–187 (2006)
6. Blais, J.A.R., Provins, D.A., Soofi, M.A.: Optimization of Spherical Harmonic Transform
Computations. In: Sunderam, V.S., van Albada, G.D., Sloot, P.M.A., Dongarra, J. (eds.)
ICCS 2005. LNCS, vol. 3514, pp. 74–81. Springer, Heidelberg (2005)
7. Blais, J.A.R., Soofi, M.A.: Optimization of Discrete Spherical Harmonic Transforms and
Applications. Poster Presentation at the 2006 Fall Meeting of the American Geophysical
Union in San Francisco, CA (2006)
8. Colombo, O.: Numerical Methods for Harmonic Analysis on the Sphere. Report no. 310,
Department of Geodetic Science and Surveying, The Ohio State University (1981)
9. Driscoll, J.R., Healy Jr., D.M.: Computing Fourier Transforms and Convolutions on the 2-
Sphere. Advances in Applied Mathematics 15, 202–250 (1994)
10. Gradshteyn, I.S., Ryzhik, I.M.: Tables of Integrals, Series and Products. Academic Press,
London (1980)
11. Heiskanen, W.A., Moritz, H.: Physical Geodesy, p. 363. W.H. Freeman, San Francisco
(1967)
Discrete Spherical Harmonic Transforms 645

12. Hildebrand, F.B.: Introduction to Numerical Analysis. McGraw-Hill, New York (1956)
13. Holmes, S.A., Featherstone, W.E.: A Unified Approach to the Clenshaw Summation and
the Recursive Computation of Very High Degree and Order Normalised Associated Leg-
endre Functions. Journal of Geodesy 76, 279–299 (2002)
14. Jekeli, C., Lee, J.K., Kwon, J.H.: On the Computation and Approximation of Ultra-High-
Degree Spherical Harmonic Series. Journal of Geodesy 81(9), 603–615 (2007)
15. Paul, M.K.: Recurrence Relations for Integrals of Associated Legendre Functions. Bulletin
Geodesique 52, 177–190 (1978)
16. Sneeuw, N.: Global Spherical Harmonic Analysis by Least-Squares and Numerical Quad-
rature Methods in Historical Perspective. Geophys. J. Int. 118, 707–716 (1994)
17. Soofi, M.A., Blais, J.A.R.: Parallel Computations of Spherical Harmonic Transforms, Oral
Presentation at the 2005 Annual Meeting of the Canadian Geophysical Union, Banff, Al-
berta, Canada (2005)
18. Swarztrauber, P.N., Spotz, W.F.: Generalized Discrete Spherical Harmonic Transforms. J.
Comp. Phys. 159, 213–230 (2000)
19. Wieczorek, M.: SHTOOLS: Tools for Working with Spherical Harmonics. Centre National de
la Recherche Scientifique, Institut de Physique du Globe de Paris (2007), http://www.
ipgp.jussieu.fr/~wieczor/SHTOOLS/www/accuracy.html

View publication stats

You might also like