Ssht  1.3.3
Fast and exact spin spherical harmonic transforms
Macros | Functions
ssht_test.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "ssht/ssht.h"
Include dependency graph for ssht_test.c:

Macros

#define NREPEAT   5
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 

Functions

double ran2_dp (int idum)
 
void ssht_test_gen_flm_complex (complex double *flm, int L, int spin, int seed)
 
void ssht_test_gen_flm_real (complex double *flm, int L, int seed)
 
void ssht_test_gen_lb_flm_complex (complex double *flm, int L_zero, int L, int spin, int seed)
 
void ssht_test_gen_lb_flm_real (complex double *flm, int L0, int L, int seed)
 
int null_test (const complex double *X, int n)
 
int nan_test (const complex double *X, int n)
 
int main (int argc, char *argv[])
 

Detailed Description

Applies SSHT algorithms to perform inverse and forward spherical harmonic transforms (respectively) to check that the original signal is reconstructed exactly (to numerical precision). Test is performed on a random signal with harmonic coefficients uniformly sampled from (-1,1).

Usage: ssht_test B spin [B0], e.g. ssht_test 64 2 32

Author
Jason McEwen

Macro Definition Documentation

◆ MAX

#define MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

◆ NREPEAT

#define NREPEAT   5

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

Null and Nan Tests!

Harmonic Coefficients

Harmonic Coefficients

◆ nan_test()

int nan_test ( const complex double *  X,
int  n 
)

Test for nan vector

Parameters
[in]Xvector of complex double
[in]nlength of X.
Return values
Yreturns int 1 if no nans, 0 if nan entires exist. i.e. 0 = fail, 1 = pass.

◆ null_test()

int null_test ( const complex double *  X,
int  n 
)

Test for null vector

Parameters
[in]Xvector of complex double
[in]nlength of X.
Return values
Yreturns int 0 if all zeros, 1 if non-zero i.e. 0 = fail, 1 = pass.

◆ ran2_dp()

double ran2_dp ( int  idum)

Generate uniform deviate in range [0,1) given seed. (Using double precision.)

Note
Uniform deviate (Num rec 1992, chap 7.1), original routine said to be 'perfect'.
Parameters
[in]idumSeed.
Return values
ran_dpGenerated uniform deviate.
Author
Jason McEwen

◆ ssht_test_gen_flm_complex()

void ssht_test_gen_flm_complex ( complex double *  flm,
int  L,
int  spin,
int  seed 
)

Generate random spherical harmonic coefficients of a complex signal.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]LHarmonic band-limit.
[in]spinSpin number.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

◆ ssht_test_gen_flm_real()

void ssht_test_gen_flm_real ( complex double *  flm,
int  L,
int  seed 
)

Generate random spherical harmonic coefficients of a real spin=0 signal.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]LHarmonic band-limit.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

◆ ssht_test_gen_lb_flm_complex()

void ssht_test_gen_lb_flm_complex ( complex double *  flm,
int  L0,
int  L,
int  spin,
int  seed 
)

Generate random spherical harmonic coefficients of a complex signal with lower band-limit.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]L0Lower harmonic band-limit.
[in]LUpper harmonic band-limit.
[in]spinSpin number.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen

◆ ssht_test_gen_lb_flm_real()

void ssht_test_gen_lb_flm_real ( complex double *  flm,
int  L0,
int  L,
int  seed 
)

Generate random spherical harmonic coefficients of a real spin=0 signal with lower band-limit.

Parameters
[out]flmRandom spherical harmonic coefficients generated.
[in]L0Lower harmonic band-limit.
[in]LUpper harmonic band-limit.
[in]seedInteger seed required for random number generator.
Return values
none
Author
Jason McEwen