S2kit
1.1
Toolkit for working with functions defined on the sphere
|
Example of source code to computie spherical harmonic transform using the seminaive and naive algorithms. More...
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <fftw3.h>
#include "s2kit/FST_semi_fly.h"
#include "s2kit/weights.h"
#include "s2kit/util.h"
#include "util/csecond.h"
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
Example of source code to computie spherical harmonic transform using the seminaive and naive algorithms.
The code will compute associated Legendre functions on the fly. This will be part of what's being timed.
In its current state, assuming that will seminaive at all orders. If you wish to change this, modify the cutoff
variable in this file, i.e. cutoff = ...
at what order to switch from seminaive to naive algorithm.
Idea is to record the execution time for the spectral -> grid -> spectral
roundtrip.
The strategy is to generate random coefficients representing a complete spherical harmonic series of funcions Y(m,l)
. The ordering of the these coefficients is assumed to be the same as an output of the FSTSemiFly() function, namely:
This means that there are (bw*bw)
coefficients.
Once the coefficients are generated, the corresponding function is synthesized using InvFSTSemiFly(), then transformed (analyzed) using FSTSemiFly(). Then timing data will be printed.
Sample call:
data_format
argument of each function further down from REAL
to COMPLEX
. This is also documented in the file FST_semi_fly.c Definition in file test_s2_semi_fly.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 59 of file test_s2_semi_fly.c.