Ssht  1.3.3
Fast and exact spin spherical harmonic transforms
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 <math.h>
10 
11 #include "ssht_types.h"
12 
13 
14 #ifdef __cplusplus
15 extern "C"{
16 #endif
17 
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 = lrint(floor(sqrt(ind)));
93  *m = ind - (*el)*(*el) - (*el);
94 
95 }
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif
ssht_sampling_weight_mw
ssht_complex_double ssht_sampling_weight_mw(int p)
Definition: ssht_sampling.c:35
ssht_sampling_gl_p2phi
double ssht_sampling_gl_p2phi(int p, int L)
Definition: ssht_sampling.c:457
ssht_sampling_mw_ss_ntheta
int ssht_sampling_mw_ss_ntheta(int L)
Definition: ssht_sampling.c:286
ssht_sampling_dh_nphi
int ssht_sampling_dh_nphi(int L)
Definition: ssht_sampling.c:408
ssht_sampling_mw_t2theta
double ssht_sampling_mw_t2theta(int t, int L)
Definition: ssht_sampling.c:195
ssht_sampling_gl_nphi
int ssht_sampling_gl_nphi(int L)
Definition: ssht_sampling.c:472
ssht_sampling_dh_t2theta
double ssht_sampling_dh_t2theta(int t, int L)
Definition: ssht_sampling.c:359
ssht_complex_double
double complex ssht_complex_double
Definition: ssht_types.h:53
ssht_sampling_mw_n
int ssht_sampling_mw_n(int L)
Definition: ssht_sampling.c:247
ssht_sampling_dh_p2phi
double ssht_sampling_dh_p2phi(int p, int L)
Definition: ssht_sampling.c:393
ssht_sampling_weight_dh
double ssht_sampling_weight_dh(double theta_t, int L)
Definition: ssht_sampling.c:63
ssht_sampling_mw_ss_nphi
int ssht_sampling_mw_ss_nphi(int L)
Definition: ssht_sampling.c:321
ssht_sampling_dh_ntheta
int ssht_sampling_dh_ntheta(int L)
Definition: ssht_sampling.c:374
ssht_sampling_gl_thetas_weights
void ssht_sampling_gl_thetas_weights(double *thetas, double *weights, int L)
Definition: ssht_sampling.c:92
ssht_sampling_gl_n
int ssht_sampling_gl_n(int L)
Definition: ssht_sampling.c:487
ssht_sampling_mw_ntheta
int ssht_sampling_mw_ntheta(int L)
Definition: ssht_sampling.c:176
ssht_sampling_mw_p2phi
double ssht_sampling_mw_p2phi(int p, int L)
Definition: ssht_sampling.c:229
ssht_sampling_mw_ss_p2phi
double ssht_sampling_mw_ss_p2phi(int p, int L)
Definition: ssht_sampling.c:305
ssht_sampling_mw_ss_t2theta
double ssht_sampling_mw_ss_t2theta(int t, int L)
Definition: ssht_sampling.c:267
ssht_sampling_mw_ss_n
int ssht_sampling_mw_ss_n(int L)
Definition: ssht_sampling.c:340
ssht_sampling_mw_nphi
int ssht_sampling_mw_nphi(int L)
Definition: ssht_sampling.c:210
ssht_sampling_gl_ntheta
int ssht_sampling_gl_ntheta(int L)
Definition: ssht_sampling.c:438
ssht_sampling_dh_n
int ssht_sampling_dh_n(int L)
Definition: ssht_sampling.c:423
ssht_types.h