My Project
ssht_sampling.h
Go to the documentation of this file.
1 // SSHT package to perform spin spherical harmonic transforms
2 // Copyright (C) 2011 Jason McEwen
3 // See LICENSE.txt for license details
4 
5 
6 #ifndef SSHT_SAMPLING
7 #define SSHT_SAMPLING
8 
9 #include <complex.h>
10 #include <math.h>
11 
12 
13 
14 #ifdef __cplusplus
15 extern "C"{
16 #endif
17 
18 SSHT_COMPLEX(double) ssht_sampling_weight_mw(int p);
19 double ssht_sampling_weight_dh(double theta_t, int L);
20 void ssht_sampling_gl_thetas_weights(double *thetas, double *weights, int L);
21 
22 double ssht_sampling_mw_t2theta(int t, int L);
23 double ssht_sampling_mw_p2phi(int p, int L);
24 int ssht_sampling_mw_n(int L);
25 int ssht_sampling_mw_ntheta(int L);
26 int ssht_sampling_mw_nphi(int L);
27 
28 double ssht_sampling_mw_ss_t2theta(int t, int L);
29 double ssht_sampling_mw_ss_p2phi(int p, int L);
30 int ssht_sampling_mw_ss_n(int L);
32 int ssht_sampling_mw_ss_nphi(int L);
33 
34 double ssht_sampling_dh_t2theta(int t, int L);
35 double ssht_sampling_dh_p2phi(int p, int L);
36 int ssht_sampling_dh_n(int L);
37 int ssht_sampling_dh_ntheta(int L);
38 int ssht_sampling_dh_nphi(int L);
39 
40 double ssht_sampling_gl_p2phi(int p, int L);
41 int ssht_sampling_gl_n(int L);
42 int ssht_sampling_gl_ntheta(int L);
43 int ssht_sampling_gl_nphi(int L);
44 
45 
46 //============================================================================
47 // Harmonic index relations
48 //============================================================================
49 
50 
67 static inline void ssht_sampling_elm2ind(int *ind, int el, int m) {
68 
69  *ind = el * el + el + m;
70 
71 }
72 
73 
90 static inline void ssht_sampling_ind2elm(int *el, int *m, int ind) {
91 
92  *el = sqrt(ind);
93  *m = ind - (*el)*(*el) - (*el);
94 
95 }
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
ssht_sampling_gl_p2phi
double ssht_sampling_gl_p2phi(int p, int L)
Definition: ssht_sampling.c:459
ssht_sampling_mw_ss_ntheta
int ssht_sampling_mw_ss_ntheta(int L)
Definition: ssht_sampling.c:288
ssht_sampling_dh_nphi
int ssht_sampling_dh_nphi(int L)
Definition: ssht_sampling.c:410
SSHT_COMPLEX
SSHT_COMPLEX(double) ssht_sampling_weight_mw(int p)
Definition: ssht_sampling.c:37
ssht_sampling_mw_t2theta
double ssht_sampling_mw_t2theta(int t, int L)
Definition: ssht_sampling.c:197
ssht_sampling_gl_nphi
int ssht_sampling_gl_nphi(int L)
Definition: ssht_sampling.c:474
ssht_sampling_dh_t2theta
double ssht_sampling_dh_t2theta(int t, int L)
Definition: ssht_sampling.c:361
ssht_sampling_mw_n
int ssht_sampling_mw_n(int L)
Definition: ssht_sampling.c:249
ssht_sampling_dh_p2phi
double ssht_sampling_dh_p2phi(int p, int L)
Definition: ssht_sampling.c:395
ssht_sampling_weight_dh
double ssht_sampling_weight_dh(double theta_t, int L)
Definition: ssht_sampling.c:65
ssht_sampling_mw_ss_nphi
int ssht_sampling_mw_ss_nphi(int L)
Definition: ssht_sampling.c:323
ssht_sampling_dh_ntheta
int ssht_sampling_dh_ntheta(int L)
Definition: ssht_sampling.c:376
ssht_sampling_gl_thetas_weights
void ssht_sampling_gl_thetas_weights(double *thetas, double *weights, int L)
Definition: ssht_sampling.c:94
ssht_sampling_gl_n
int ssht_sampling_gl_n(int L)
Definition: ssht_sampling.c:489
ssht_sampling_mw_ntheta
int ssht_sampling_mw_ntheta(int L)
Definition: ssht_sampling.c:178
ssht_sampling_mw_p2phi
double ssht_sampling_mw_p2phi(int p, int L)
Definition: ssht_sampling.c:231
ssht_sampling_mw_ss_p2phi
double ssht_sampling_mw_ss_p2phi(int p, int L)
Definition: ssht_sampling.c:307
ssht_sampling_mw_ss_t2theta
double ssht_sampling_mw_ss_t2theta(int t, int L)
Definition: ssht_sampling.c:269
ssht_sampling_mw_ss_n
int ssht_sampling_mw_ss_n(int L)
Definition: ssht_sampling.c:342
ssht_sampling_mw_nphi
int ssht_sampling_mw_nphi(int L)
Definition: ssht_sampling.c:212
ssht_sampling_gl_ntheta
int ssht_sampling_gl_ntheta(int L)
Definition: ssht_sampling.c:440
ssht_sampling_dh_n
int ssht_sampling_dh_n(int L)
Definition: ssht_sampling.c:425