SHTns 3.6.1
shtns.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010-2021 Centre National de la Recherche Scientifique.
3 * written by Nathanael Schaeffer (CNRS, ISTerre, Grenoble, France).
4 *
5 * nathanael.schaeffer@univ-grenoble-alpes.fr
6 *
7 * This software is governed by the CeCILL license under French law and
8 * abiding by the rules of distribution of free software. You can use,
9 * modify and/or redistribute the software under the terms of the CeCILL
10 * license as circulated by CEA, CNRS and INRIA at the following URL
11 * "http://www.cecill.info".
12 *
13 * The fact that you are presently reading this means that you have had
14 * knowledge of the CeCILL license and that you accept its terms.
15 *
16 */
17
22#ifdef __cplusplus
23 #include <complex>
24 typedef std::complex<double> cplx;
25 typedef std::complex<float> cplx_f;
26#else
27 #include <complex.h>
28 typedef _Complex double cplx;
29 typedef _Complex float cplx_f;
30#endif
31
32#ifdef __cplusplus
33extern "C" {
34#endif /* __cplusplus */
35
38#define SHTNS_INTERFACE 0x30602
39
41typedef struct shtns_info* shtns_cfg;
42
44typedef struct shtns_rot_* shtns_rot;
45
51 sht_for_rotations
52};
53#define SHT_NO_CS_PHASE (256*4)
54#define SHT_REAL_NORM (256*8)
55
65};
66#define SHT_NATIVE_LAYOUT 0
67#define SHT_THETA_CONTIGUOUS 256
68#define SHT_PHI_CONTIGUOUS (256*2)
69#define SHT_SOUTH_POLE_FIRST (256*32)
70
71#define SHT_SCALAR_ONLY (256*16)
72#define SHT_LOAD_SAVE_CFG (256*64)
73#define SHT_ALLOW_GPU (256*128)
74#define SHT_ALLOW_PADDING (256*256)
75#define SHT_ROBERT_FORM (256*512)
76#define SHT_FP32 (256*1024)
77
78
79#ifndef SHTNS_PRIVATE
80struct shtns_info { // allow read-only access to some data (useful for optimization and helper macros)
81 const unsigned int nlm;
82 const unsigned short lmax;
83 const unsigned short mmax;
84 const unsigned short mres;
85 const unsigned short nlat_2;
86 const unsigned int nlat;
87 const unsigned int nphi;
88 const unsigned int nspat;
89 const unsigned short *const li;
90 const unsigned short *const mi;
91 const double *const ct;
92 const double *const st;
93 const unsigned int nlat_padded;
94 const unsigned int nlm_cplx;
95};
96#endif
97
98// MACROS //
99
104
106#define LiM(shtns, l,im) ( (((im)*(2*shtns->lmax + 2 - ((im)+1)*shtns->mres))>>1) + (l) )
108#define LM(shtns, l,m) ( (((((unsigned short)(m))/shtns->mres)*(2*shtns->lmax + 2 - ((m)+shtns->mres)))>>1) + (l) )
111#define LM_LOOP( shtns, action ) { int lm=0; do { action } while(++lm < shtns->nlm); }
114#define LM_L_LOOP( shtns, action ) { int lm=0; do { int l=shtns->li[lm]; action } while(++lm < shtns->nlm); }
116#define LM_cplx(shtns, l, m) ( ((l) <= shtns->mmax) ? (l)*((l)+1)+(m) : shtns->mmax*(2*(l) - shtns->mmax) + (l)+(m) )
118
119
122#define NSPAT_ALLOC(shtns) (shtns->nspat)
123
124// HELPER MACROS //
125
127#define PHI_DEG(shtns, ip) (360./(shtns->nphi*shtns->mres))*(ip)
129#define PHI_RAD(shtns, ip) (2.*M_PI/(shtns->nphi*shtns->mres))*(ip)
130
131
132// FUNCTIONS //
133
135long nlm_calc(long lmax, long mmax, long mres);
136
138long nlm_cplx_calc(long lmax, long mmax, long mres);
139
140void shtns_verbose(int);
141void shtns_print_version(void);
142const char* shtns_get_build_info(void);
143
144#ifndef SWIG
145
147
150
152shtns_cfg shtns_init(enum shtns_type flags, int lmax, int mmax, int mres, int nlat, int nphi);
154shtns_cfg shtns_create(int lmax, int mmax, int mres, enum shtns_norm norm);
156int shtns_set_grid(shtns_cfg, enum shtns_type flags, double eps, int nlat, int nphi);
158int shtns_set_grid_auto(shtns_cfg, enum shtns_type flags, double eps, int nl_order, int *nlat, int *nphi);
160shtns_cfg shtns_create_with_grid(shtns_cfg, int mmax, int nofft);
162int shtns_use_threads(int num_threads);
164int shtns_set_batch(shtns_cfg shtns, int howmany, long spec_dist);
165
166void shtns_reset(void);
169
171void shtns_robert_form(shtns_cfg, int robert);
172
173void* shtns_malloc(size_t bytes);
174void shtns_free(void* p);
175
176
178
181double sh00_1(shtns_cfg);
182double sh10_ct(shtns_cfg);
183double sh11_st(shtns_cfg);
184double shlm_e1(shtns_cfg, int l, int m);
186int shtns_gauss_wts(shtns_cfg, double *wts);
187
189
192
196void SH_Zrotate(shtns_cfg, cplx *Qlm, double alpha, cplx *Rlm);
198void SH_Yrotate(shtns_cfg, cplx *Qlm, double alpha, cplx *Rlm);
200void SH_Yrotate90(shtns_cfg, cplx *Qlm, cplx *Rlm);
202void SH_Xrotate90(shtns_cfg, cplx *Qlm, cplx *Rlm);
203
204
206shtns_rot shtns_rotation_create(const int lmax, const int mmax, int norm);
210void shtns_rotation_set_angles_ZYZ(shtns_rot r, double alpha, double beta, double gamma);
212void shtns_rotation_set_angles_ZXZ(shtns_rot r, double alpha, double beta, double gamma);
214void shtns_rotation_set_angle_axis(shtns_rot r, double theta, double Vx, double Vy, double Vz);
218int shtns_rotation_wigner_d_matrix(shtns_rot r, const int l, double* mx);
220void shtns_rotation_apply_cplx(shtns_rot r, cplx* Zlm, cplx* Rlm);
222void shtns_rotation_apply_real(shtns_rot r, cplx* Qlm, cplx* Rlm);
223
225
228
237int legendre_sphPlm_array(shtns_cfg shtns, const int lmax, const int im, const double x, double *yl);
238int legendre_sphPlm_deriv_array(shtns_cfg shtns, const int lmax, const int im, const double x, const double sint, double *yl, double *dyl);
240
243
246void mul_ct_matrix(shtns_cfg, double* mx);
249void st_dt_matrix(shtns_cfg, double* mx);
251void SH_mul_mx(shtns_cfg, double* mx, cplx *Qlm, cplx *Rlm);
253
261
264
269void spat_to_SH(shtns_cfg shtns, double *Vr, cplx *Qlm);
274void SH_to_spat(shtns_cfg shtns, cplx *Qlm, double *Vr);
279void SH_to_spat_cplx(shtns_cfg shtns, cplx *alm, cplx *z);
284void spat_cplx_to_SH(shtns_cfg shtns, cplx *z, cplx *alm);
286
289
291void spat_to_SHsphtor(shtns_cfg, double *Vt, double *Vp, cplx *Slm, cplx *Tlm);
293void SHsphtor_to_spat(shtns_cfg, cplx *Slm, cplx *Tlm, double *Vt, double *Vp);
295void SHsph_to_spat(shtns_cfg, cplx *Slm, double *Vt, double *Vp);
297void SHtor_to_spat(shtns_cfg, cplx *Tlm, double *Vt, double *Vp);
298
300void spat_cplx_to_SHsphtor(shtns_cfg, cplx *Vt, cplx *Vp, cplx *Slm, cplx *Tlm);
302void SHsphtor_to_spat_cplx(shtns_cfg, cplx *Slm, cplx *Tlm, cplx *Vt, cplx *Vp);
305#define SH_to_grad_spat(shtns, S,Gt,Gp) SHsph_to_spat(shtns, S, Gt, Gp)
306
309
312void spat_to_SHqst(shtns_cfg, double *Vr, double *Vt, double *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm);
315void SHqst_to_spat(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double *Vr, double *Vt, double *Vp);
316
317void spat_cplx_to_SHqst(shtns_cfg, cplx *Vr, cplx *Vt, cplx *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm);
318void SHqst_to_spat_cplx(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, cplx *Vr, cplx *Vt, cplx *Vp);
320
324void spat_to_SH_l(shtns_cfg, double *Vr, cplx *Qlm, int ltr);
325void SH_to_spat_l(shtns_cfg, cplx *Qlm, double *Vr, int ltr);
326
327void SHsphtor_to_spat_l(shtns_cfg, cplx *Slm, cplx *Tlm, double *Vt, double *Vp, int ltr);
328void SHsph_to_spat_l(shtns_cfg, cplx *Slm, double *Vt, double *Vp, int ltr);
329void SHtor_to_spat_l(shtns_cfg, cplx *Tlm, double *Vt, double *Vp, int ltr);
330void spat_to_SHsphtor_l(shtns_cfg, double *Vt, double *Vp, cplx *Slm, cplx *Tlm, int ltr);
331
332void spat_to_SHqst_l(shtns_cfg, double *Vr, double *Vt, double *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm, int ltr);
333void SHqst_to_spat_l(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double *Vr, double *Vt, double *Vp, int ltr);
336#define SH_to_grad_spat_l(shtns, S,Gt,Gp,ltr) SHsph_to_spat_l(shtns, S, Gt, Gp, ltr)
337
342void spat_to_SH_ml(shtns_cfg, int im, cplx *Vr, cplx *Ql, int ltr);
343void SH_to_spat_ml(shtns_cfg, int im, cplx *Ql, cplx *Vr, int ltr);
344
345void spat_to_SHsphtor_ml(shtns_cfg, int im, cplx *Vt, cplx *Vp, cplx *Sl, cplx *Tl, int ltr);
346void SHsphtor_to_spat_ml(shtns_cfg, int im, cplx *Sl, cplx *Tl, cplx *Vt, cplx *Vp, int ltr);
347void SHsph_to_spat_ml(shtns_cfg, int im, cplx *Sl, cplx *Vt, cplx *Vp, int ltr);
348void SHtor_to_spat_ml(shtns_cfg, int im, cplx *Tl, cplx *Vt, cplx *Vp, int ltr);
349
350void spat_to_SHqst_ml(shtns_cfg, int im, cplx *Vr, cplx *Vt, cplx *Vp, cplx *Ql, cplx *Sl, cplx *Tl, int ltr);
351void SHqst_to_spat_ml(shtns_cfg, int im, cplx *Ql, cplx *Sl, cplx *Tl, cplx *Vr, cplx *Vt, cplx *Vp, int ltr);
354#define SH_to_grad_spat_ml(shtns, im, S,Gt,Gp,ltr) SHsph_to_spat_ml(shtns, im, S, Gt, Gp, ltr)
355
357
361double SH_to_point(shtns_cfg, cplx *Qlm, double cost, double phi);
362void SH_to_point_cplx(shtns_cfg, cplx *alm, double cost, double phi, cplx* z_out);
363void SH_to_grad_point(shtns_cfg, cplx *DrSlm, cplx *Slm,
364 double cost, double phi, double *vr, double *vt, double *vp);
365void SHqst_to_point(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm,
366 double cost, double phi, double *vr, double *vt, double *vp);
367
368void SH_to_lat(shtns_cfg shtns, cplx *Qlm, double cost,
369 double *vr, int nphi, int ltr, int mtr);
370void SHqst_to_lat(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double cost,
371 double *vr, double *vt, double *vp, int nphi, int ltr, int mtr);
373
374
375#endif
376
377#ifdef __cplusplus
378}
379#endif /* __cplusplus */
void shtns_rotation_set_angle_axis(shtns_rot r, double theta, double Vx, double Vy, double Vz)
Defines a rotation of angle theta around axis of cartesian coordinates (Vx,Vy,Vz).
Definition sht_func.c:1486
void SH_Xrotate90(shtns_cfg, cplx *Qlm, cplx *Rlm)
rotate Qlm by 90 degrees around X axis and store the result in Rlm.
Definition sht_func.c:342
void SH_Yrotate(shtns_cfg, cplx *Qlm, double alpha, cplx *Rlm)
rotate Qlm around Y axis by arbitrary angle, using composition of rotations. Store the result in Rlm.
Definition sht_func.c:379
void shtns_rotation_apply_cplx(shtns_rot r, cplx *Zlm, cplx *Rlm)
apply rotation to the orthonormal spherical harmonic expansion Zlm of a complex-valued field,...
Definition sht_func.c:1951
void SH_Zrotate(shtns_cfg, cplx *Qlm, double alpha, cplx *Rlm)
Rotate a SH representation Qlm around the z-axis by angle alpha (in radians), which is the same as ro...
Definition sht_func.c:37
void shtns_rotation_destroy(shtns_rot r)
Release memory allocated for the rotation object.
Definition sht_func.c:1411
void shtns_rotation_set_angles_ZXZ(shtns_rot r, double alpha, double beta, double gamma)
Defines a rotation parameterized by the 3 intrinsic Euler angles with ZXZ convention.
Definition sht_func.c:1480
void SH_Yrotate90(shtns_cfg, cplx *Qlm, cplx *Rlm)
rotate Qlm by 90 degrees around Y axis and store the result in Rlm.
Definition sht_func.c:361
shtns_rot shtns_rotation_create(const int lmax, const int mmax, int norm)
Creation of a spherical harmonic rotation object for degrees and orders up to lmax and mmax respectiv...
Definition sht_func.c:1394
void shtns_rotation_set_angles_ZYZ(shtns_rot r, double alpha, double beta, double gamma)
Defines a rotation parameterized by the 3 intrinsic Euler angles with ZYZ convention.
Definition sht_func.c:1443
void shtns_rotation_apply_real(shtns_rot r, cplx *Qlm, cplx *Rlm)
apply rotation to the orthonormal spherical harmonic expansion Qlm of a real field,...
Definition sht_func.c:1670
int shtns_rotation_wigner_d_matrix(shtns_rot r, const int l, double *mx)
Generate spherical-harmonic rotation matrix for given degree l and orthonormal convention (Wigner-d m...
Definition sht_func.c:1587
void shtns_destroy(shtns_cfg)
free memory of given config, which cannot be used afterwards.
Definition sht_init.c:1287
int shtns_use_threads(int num_threads)
Enables multi-thread transform using OpenMP with num_threads (if available). Returns number of thread...
Definition sht_init.c:1635
int shtns_set_grid(shtns_cfg, enum shtns_type flags, double eps, int nlat, int nphi)
Precompute everything for a given spatial grid. Use for advanced initialization, after shtns_create.
Definition sht_init.c:1575
void * shtns_malloc(size_t bytes)
allocate appropriate CPU memory (pinned for gpu, aligned for avx, ...). Use shtns_free to free it.
Definition sht_init.c:1338
shtns_cfg shtns_create(int lmax, int mmax, int mres, enum shtns_norm norm)
Defines the sizes of the spectral description. Use for advanced initialization.
Definition sht_init.c:1112
void shtns_unset_grid(shtns_cfg)
unset the grid.
Definition sht_init.c:1277
void shtns_reset(void)
destroy all configs, free memory, and go back to initial state.
Definition sht_init.c:1329
shtns_cfg shtns_init(enum shtns_type flags, int lmax, int mmax, int mres, int nlat, int nphi)
Simple initialization of the spherical harmonic transforms of given size. Calls shtns_create and shtn...
Definition sht_init.c:1613
shtns_cfg shtns_create_with_grid(shtns_cfg, int mmax, int nofft)
Copy a given config but allow a different (smaller) mmax and the possibility to enable/disable fft.
Definition sht_init.c:1240
long nlm_cplx_calc(long lmax, long mmax, long mres)
compute number of spherical harmonics modes (l,m) to represent a complex-valued spatial field,...
Definition sht_init.c:107
int shtns_set_batch(shtns_cfg shtns, int howmany, long spec_dist)
beta: Modify plan to perform several transforms together (batch). This is useful to get good performa...
Definition sht_init.c:1592
int shtns_gauss_wts(shtns_cfg, double *wts)
fill the given array with Gauss weights. returns the number of weights written (0 if not a Gauss grid...
Definition sht_init.c:1651
long nlm_calc(long lmax, long mmax, long mres)
compute number of spherical harmonics modes (l,m) to represent a real-valued spatial field for given ...
Definition sht_init.c:99
void shtns_free(void *p)
free memory allocated with shtns_malloc
Definition sht_init.c:1342
void shtns_robert_form(shtns_cfg, int robert)
set the use of Robert form. If robert != 0, the vector synthesis returns a field multiplied by sin(th...
Definition sht_init.c:1622
int shtns_set_grid_auto(shtns_cfg, enum shtns_type flags, double eps, int nl_order, int *nlat, int *nphi)
Precompute everything and choose the optimal nlat and nphi for a given non-linear order.
Definition sht_init.c:1375
void SHqst_to_point(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double cost, double phi, double *vr, double *vt, double *vp)
Evaluate vector SH representation Qlm at physical point defined by cost = cos(theta) and phi.
Definition sht_func.c:669
void SH_to_point_cplx(shtns_cfg, cplx *alm, double cost, double phi, cplx *z_out)
writes value to z_out.
Definition sht_func.c:516
void SH_to_lat(shtns_cfg shtns, cplx *Qlm, double cost, double *vr, int nphi, int ltr, int mtr)
synthesis at a given latitude, on nphi equispaced longitude points.
Definition sht_func.c:815
void SHqst_to_lat(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double cost, double *vr, double *vt, double *vp, int nphi, int ltr, int mtr)
synthesis at a given latitude, on nphi equispaced longitude points.
Definition sht_func.c:732
double SH_to_point(shtns_cfg, cplx *Qlm, double cost, double phi)
Evaluate scalar SH representation Qlm at physical point defined by cost = cos(theta) and phi.
Definition sht_func.c:585
void SH_mul_mx(shtns_cfg, double *mx, cplx *Qlm, cplx *Rlm)
Apply a matrix involving l+1 and l-1 to an SH representation Qlm. Result stored in Rlm (must be diffe...
Definition sht_func.c:484
void st_dt_matrix(shtns_cfg, double *mx)
compute the matrix (stored in mx, a double array of size 2*NLM) required to apply sin(theta)*d/dtheta...
Definition sht_func.c:471
void mul_ct_matrix(shtns_cfg, double *mx)
compute the matrix (stored in mx, a double array of size 2*NLM) required to multiply an SH representa...
Definition sht_func.c:453
void SHqst_to_spat(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double *Vr, double *Vt, double *Vp)
3D vector transform from radial-spheroidal-toroidal spectral components (see Radial - Spheroidal - To...
Definition sht_com.c:42
void SHtor_to_spat(shtns_cfg, cplx *Tlm, double *Vt, double *Vp)
transform toroidal spherical harmonic coefficients Tlm to the spatial theta and phi components (Vt,...
Definition sht_com.c:50
void SHqst_to_spat_cplx(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, cplx *Vr, cplx *Vt, cplx *Vp)
complex vector transform (3D).
Definition sht_func.c:1206
void SHsph_to_spat(shtns_cfg, cplx *Slm, double *Vt, double *Vp)
transform spheroidal spherical harmonic coefficients Slm to the spatial theta and phi components (Vt,...
Definition sht_com.c:54
void SHsphtor_to_spat(shtns_cfg, cplx *Slm, cplx *Tlm, double *Vt, double *Vp)
transform spheroidal-toroidal spherical harmonic coefficients (Slm,Tlm) to the spatial theta and phi ...
Definition sht_com.c:34
void spat_to_SHqst(shtns_cfg, double *Vr, double *Vt, double *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm)
3D vector transform from spherical coordinates to radial-spheroidal-toroidal spectral components (see...
Definition sht_com.c:46
void SHsphtor_to_spat_cplx(shtns_cfg, cplx *Slm, cplx *Tlm, cplx *Vt, cplx *Vp)
transform spheroidal-toroidal spherical harmonic coefficients (Slm,Tlm) to the spatial theta and phi ...
Definition sht_func.c:1060
void spat_cplx_to_SHsphtor(shtns_cfg, cplx *Vt, cplx *Vp, cplx *Slm, cplx *Tlm)
transform the theta and phi components (Vt,Vp) of a complex valued vector into its spheroidal-toroida...
Definition sht_func.c:1135
void spat_to_SH(shtns_cfg shtns, double *Vr, cplx *Qlm)
transform the scalar field Vr into its spherical harmonic representation Qlm.
Definition sht_com.c:30
void SH_to_spat(shtns_cfg shtns, cplx *Qlm, double *Vr)
transform the spherical harmonic coefficients Qlm into its spatial representation Vr.
Definition sht_com.c:26
void spat_cplx_to_SHqst(shtns_cfg, cplx *Vr, cplx *Vt, cplx *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm)
complex vector transform (3D).
Definition sht_func.c:1197
void SH_to_spat_cplx(shtns_cfg shtns, cplx *alm, cplx *z)
complex scalar synthesis.
Definition sht_func.c:998
void spat_cplx_to_SH(shtns_cfg shtns, cplx *z, cplx *alm)
complex scalar analysis.
Definition sht_func.c:943
void spat_to_SHsphtor(shtns_cfg, double *Vt, double *Vp, cplx *Slm, cplx *Tlm)
transform the theta and phi components (Vt,Vp) of a vector into its spheroidal-toroidal spherical har...
Definition sht_com.c:38
struct shtns_rot_ * shtns_rot
pointer to data structure describing a rotation, returned by shtns_rotation_create().
Definition shtns.h:44
_Complex double cplx
double precision complex number data type
Definition shtns.h:28
const char * shtns_get_build_info(void)
get version and build information as a string (the same as the one printed by shtns_print_version())
Definition sht_init.c:927
double sh10_ct(shtns_cfg)
return the spherical harmonic representation of cos(theta) (l=1,m=0)
Definition sht_init.c:82
void shtns_verbose(int)
controls output during initialization: 0=no output (default), 1=some output, 2=degug (if compiled in)
Definition sht_init.c:54
void shtns_print_version(void)
print version information to stdout.
Definition sht_init.c:951
int legendre_sphPlm_array(shtns_cfg shtns, const int lmax, const int im, const double x, double *yl)
Compute values of legendre polynomials noramalized for spherical harmonics, for a range of l=m....
void shtns_print_cfg(shtns_cfg)
print information about given config to stdout.
Definition sht_init.c:972
double shlm_e1(shtns_cfg, int l, int m)
return the l,m SH coefficient corresponding to unit energy.
Definition sht_init.c:90
double sh00_1(shtns_cfg)
return the spherical harmonic representation of 1 (l=0,m=0)
Definition sht_init.c:78
struct shtns_info * shtns_cfg
pointer to data structure describing an SHT, returned by shtns_init() or shtns_create().
Definition shtns.h:41
_Complex float cplx_f
single precision (float) complex number data type
Definition shtns.h:29
shtns_type
different SHT types and algorithms
Definition shtns.h:57
@ sht_quick_init
gauss grid, with minimum initialization time (useful for pre/post-processing)
Definition shtns.h:62
@ sht_reg_poles
quick initialization of a regular grid including poles (Clenshaw-Curtis quadrature)....
Definition shtns.h:63
@ sht_reg_dct
slow initialization of a regular grid (self-tuning). The grid is equispaced and avoids the poles (Féj...
Definition shtns.h:61
@ sht_auto
use fastest algorithm and grid. This currently implies using the Gauss grid and is thus the same as s...
Definition shtns.h:59
@ sht_reg_fast
quick initialization of a regular grid. The grid is the same as with sht_reg_dct
Definition shtns.h:60
@ sht_gauss_fly
legendre polynomials are recomputed on-the-fly for each transform (may be faster on some machines,...
Definition shtns.h:64
@ sht_gauss
use gaussian grid and quadrature. Allows on-the-fly or matrix-based algorithms.
Definition shtns.h:58
double sh11_st(shtns_cfg)
return the spherical harmonic representation of sin(theta)*cos(phi) (l=1,m=1)
Definition sht_init.c:86
shtns_norm
Different Spherical Harmonic normalizations. See also section Normalization for details.
Definition shtns.h:47
@ sht_fourpi
Geodesy and spectral analysis : 4.pi normalization.
Definition shtns.h:49
@ sht_orthonormal
orthonormalized spherical harmonics (default).
Definition shtns.h:48
@ sht_schmidt
Schmidt semi-normalized : 4.pi/(2l+1)
Definition shtns.h:50
Definition shtns.h:80
const unsigned int nphi
number of spatial points in Phi direction (longitude)
Definition shtns.h:87
const double *const ct
cos(theta) array (size nlat)
Definition shtns.h:91
const unsigned short lmax
maximum degree (lmax) of spherical harmonics.
Definition shtns.h:82
const double *const st
sin(theta) array (size nlat)
Definition shtns.h:92
const unsigned short *const li
degree l for given mode index (size nlm) : li[lm]
Definition shtns.h:89
const unsigned short mmax
maximum order (mmax*mres) of spherical harmonics.
Definition shtns.h:83
const unsigned int nlm
total number of (l,m) spherical harmonics components.
Definition shtns.h:81
const unsigned int nlat_padded
number of spatial points in Theta direction, including padding.
Definition shtns.h:93
const unsigned int nlm_cplx
number of complex coefficients to represent a complex-valued spatial field.
Definition shtns.h:94
const unsigned short *const mi
order m for given mode index (size nlm) : mi[lm]
Definition shtns.h:90
const unsigned int nspat
number of real numbers that must be allocated in a spatial field.
Definition shtns.h:88
const unsigned short mres
the periodicity along the phi axis.
Definition shtns.h:84
const unsigned short nlat_2
half of spatial points in Theta direction (using (shtns.nlat+1)/2 allows odd shtns....
Definition shtns.h:85
const unsigned int nlat
number of spatial points in Theta direction (latitude) ...
Definition shtns.h:86