S2kit
1.1
Toolkit for working with functions defined on the sphere
|
Example of source code to computie inverse spherical harmonic transform using the seminaive and naive algorithms. More...
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <fftw3.h>
#include "s2kit/FST_semi_memo.h"
#include "s2kit/cospml.h"
#include "s2kit/weights.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 inverse spherical harmonic transform using the seminaive and naive algorithms.
Computed function samples using spherical coefficients of the function, which are given in the named input file, and writes those samples in the named output file.
The code will pre-compute associated Legendre functions before doing inverse transform. This won't a 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.
Sample call:
The format of the input coefficient file is an interleaved real/imaginary parts of the coefficients, where the coefficients are given in "code" order, as defined in test_s2_semi_memo.c:
To help you out, there is a function IndexOfHarmonicCoeff() which returns the array index of the coefficient f_{l,m}
.
The format of the output sample file is an interleaved real/imaginary parts of the function samples arranged in "latitude-major" format, i.e. the function is sampled in this order:
Definition in file test_s2_semi_memo_inv.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 72 of file test_s2_semi_memo_inv.c.